forked from zephyrproject-rtos/gsoc-2022-arduino-core
-
-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Not sure you want individual issues but this is what I am seeing so far.
Blink:
Hangs Serial in debug and standard modes. Nothing on Serial1
Thread_Create:
Looses Serial with following error on Serial1 in debug or standard mode:
[00:00:35.704,000] <err> usbd_cdc_acm: IRQ callback is not set
I2C:
Scanner works but keep seeing error on Serial1
[00:00:28.439,000] <err> renesas_ra_iic: i2c_ra_iic_transfer: Write failed.
Ran the BMI270 sparkfun library on wire and that seems to be working no issue. Not seeing the spew which is good.
SPI:
Not implemented yet
Note: keep having to put it into boot mode to load a sketch but maybe thats just the previous sketch that is being run.
Metadata
Metadata
Assignees
Labels
No labels
Activity
facchinm commentedon Apr 1, 2025
The problem reported as
is related to the missing hook for 1200bps touch on USB_DEVICE_NEXT devices (for now, only the C33).
I2C problem is very likely due to the not found addresses during scan()
WIll take a look at the other issues in the next days
KurtE commentedon Apr 2, 2025
I was curious about this, so took a look at it. If my quick look at the MBED sources is correct, most
of the Renesas boards (except UNO R4 Wifi), do not use the 1200 touch.
That is in boards.txt they have:
portenta_c33.upload.use_1200bps_touch=false
Also in the SerialUSB.cpp file (MBED), I see:
So I am guessing maybe it just uses DTR to reboot? Or other mechanism?
Looking through zephyr code (and forum posts), I don't believe there is any callbacks for when DTR changes
state. Wondering if we can emulate it with 12000bbs hook on zephyr... will give it a try.
facchinm commentedon Apr 2, 2025
On the Renesas core we use dfu-runtime infrastructure to trigger the reset 😉
For this core, the old stack had a callback (that we implement here ) but it looks like there's no equivalent on the NEXT stack
KurtE commentedon Apr 2, 2025
Thanks, it looked like you have the 1200... hook defined in the variant.cpp file. And I put in printk statement into
it which is not getting set.
I noticed in the config fies, that most of the others had the .conf file define of:
CONFIG_USB_CDC_ACM=y
But the C33 has instead:
CONFIG_USBD_CDC_ACM_CLASS=y
So then wondering if there is a code path difference(s) in the zephyr or modules where either we are not receiving the message or the processing is different and does not call the callback...
EDIT: When I do try to program the C33, there is a 1200 BPS
SET_LINE_CODING message received from the C33 in the function
usbd_cdc_acm_ctd which is in zephyr/subsystem/usb/device_next/class/usbd_cdc_acm.c
I added the printk:
And I am seeing:
And as I suspected, I am not seeing those message from Portenta H7 build.
KurtE commentedon Apr 6, 2025
More updates on trying to get SerialX to work.
I have a hacked up version of the SerialPassthrough example sketch, where I am also printing up some start up data...
I am still having issues with Serial2... Have not tried Serial1 as being used as console
window.
But today I have had success talking to Serial3 and Serial4. Will check Serial2 again.
(Moved it over to breakout board was using Hat carrier.
On Serial2, it was hanging in the low level module. R_SCI_UART_Open right after the interrupts were
enabled.
*** Booting Zephyr OS build v4.1.0-901-g666b48e54479 ***
usbd_cdc_acm_ctd: SET_LINE_CODING: 9600
usbd_cdc_acm_ctd: SET_LINE_CODING: 115200
uart_ra_sci_configure: 0x4bde0 0x20054760 0x20001998
apply_config err:0
first time try not close first
R_SCI_UART_Open(0x2000199c 0x200019d4) Enter
p_extend(0x200019f4): 0x20001a08 0 0 0
before RX enable 28 31
before TX enable:29 30
Bef
Print Port/Pin Function Select
Port0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Port1: 6 6 6 6 6 3 0 0 0 0 5 0 0 0 0 0
Port2: 0 0 0 0 0 0 0 0 0 0 0 23 0 0 23 0
Port3: 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0
Port4: 0 0 0 0 5 23 23 19 0 0 0 0 0 0 0 0
Port5: 5 19 4 4 0 0 4 0 5 0 0 7 7 5 0 0
Port6: 3 3 5 5 5 0 4 4 0 0 0 5 0 5 5 0
Port7: 23 23 23 23 23 23 0 20 0 0 0 0 0 0 0 0
Port8: 0 4 0 0 0 5 0 0 0 0 0 0 0 0 0 0
Port9: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PortA: 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PortB: 20 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PortC: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PortD: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PortE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PortF: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
SCI0: SMR:0 SCR:0 SSR:0 SEMR:0 SPTR:0 SCMR:0 FCR:0 CR:0 0 0 0
SCI1: SMR:0 SCR:0 SSR:0 SEMR:0 SPTR:0 SCMR:0 FCR:0 CR:0 0 0 0
SCI2: SMR:0 SCR:0 SSR:0 SEMR:0 SPTR:0 SCMR:0 FCR:0 CR:0 0 0 0
SCI3: SMR:0 SCR:B4 SSR:C4 SEMR:20 SPTR:3 SCMR:FA FCR:F800 CR:0 0 0 0
SCI4: SMR:0 SCR:0 SSR:0 SEMR:0 SPTR:0 SCMR:0 FCR:0 CR:0 0 0 0
SCI5: SMR:0 SCR:70 SSR:92* SEMR:44 SPTR:6 SCMR:F2 FCR:F801 CR:0 0 0 0
SCI6: SMR:0 SCR:70 SSR:92* SEMR:44 SPTR:6 SCMR:F2 FCR:F801 CR:0 0 0 0
SCI7: SMR:0 SCR:70 SSR:92* SEMR:44 SPTR:6 SCMR:F2 FCR:F801 CR:0 0 0 0
SCI8: SMR:0 SCR:70 SSR:92* SEMR:44 SPTR:6 SCMR:F2 FCR:F801 CR:0 0 0 0
SCI9: SMR:0 SCR:70 SSR:84 SEMR:44 SPTR:7 SCMR:F2 FCR:F801 CR:0 0 0 0
IELSR registers:
0:0x6D 1:0x6E 2:0x6B 3:0x6C 40x17F 5:0x17D 6:0x17E 7:0x31 8:0x30 9:0x193 10:0x194 11:0x0 12:0x0 13:0x0 14:0x0 15:0x0
16:0x0 17:0x0 18:0x0 19:0x0 20:0x19E 21:0x19F 22:0x1A0 230x1A1 24:0x1A4 25:0x1A5 26:0x1A6 270x1A7 28:0x1AA 29:0x1AB 30:0x1AC 310x1AD
32:0x1B0 33:0x1B1 34:0x1B2 35*0x1B3 36:0x0 37:0x0 38:0x0 39:0x0 40:0x0 41:0xA 42:0xB 43:0x0 44:0x0 45:0x0 46:0x0 47:0x0
48:0x0 49:0x31 50:0x30 51:0x16F 52:0x0 53:0x0 54:0x17F 55:0x0 56:0x0 57:0x0 58:0x0 59:0x0 60:0x0 61:0x0 62:0x0 63:0x0
64:0x0 65:0x0 66:0x0 67:0x0 68:0x0 69:0x0 70:0x0 71:0x0 72:0x0 73:0x0 74:0x1B6 75:0x1B7 76:0x1B8 77:0x1B9 78:0x0 79:0x0
80:0x0 81:0x0 82:0x0 83:0x0 84:0x0 85:0x0 86:0x0 87:0x0 88:0x0 89:0x0 90:0x0 91:0x78 92:0x79 93:0x7A 94:0x7B 95:0x0
KurtE commentedon Apr 6, 2025
Update: Serial2 appears to be working as well. Wonder if Serial1 and 2 are reversed in my list... That is the debug actually goes out on Serial2?
Thought I would see how it all works with each other, so I did a quick and dirty update to one of the tests I
have done on Teensy boards, while I worked on the Serial code and later with the UNOR4, with the rewrite PR that was never integrated... Simply Daisy chain the TX of one Serial port to the RX of another... and see if all of them get all of the data...
Short answer looks like it is losing data...
Will check this out later. Already works better than some of the others...
KurtE commentedon Apr 7, 2025
@facchinm - wondering about code versus schematic for C33 for Serial ports...
That is the Schematic shows:
But the code is setup with the order SCI9, SCI7, SCI6, SCI5?
MBED: from pins_arduino.h
From Variant.cpp
Back to the schematic:
We then map:
And the one I have not added yet but MBED: as guessing you might be using the other device tree stuff you added, but could easily
Serial5 -> SCI8
KurtE commentedon Apr 7, 2025
@facchinm @pillo79 - Sorry for asking lots of questions. I think I may mark my current C33 PR as ready to merge although was looking at the Wire objects. MBED defines 4 of them, whereas we only have one....
Currently on the Zephyr side we only define:
in pin control
And in the DTS we have
So I was going to define the iic0 object in the overlay...
Simple enough to define the correct pins for it...
But not sure about:
interrupts = <91 1>, <92 1>, <93 1>, <94 1>;
I know it is the Interrupt slot number as my debug code from Serial stuff printed out the table:
And 91-94 have 0x78-0x7B, which from the RM tables I see:
But my guestion is, who decides that slots 91-94 are the proper ones to use? How many others are hard coded? Can the build simply allocate unused ones for this? Or is it done just to make it easy for a library, to not have to look it up?
KurtE commentedon Apr 7, 2025
Quick update:
I added it to my overlay as I mentioned. Changed 91-94 to 87-90. And now have Wire and WIre1.
Not sure about Wire2 yet as it is SCI2
Also like Serial, not sure about WIre3 yet as it is SCI3 and is internal ...
Like can we mix IIC objects with SCI objects in their object lists...
But looks like it works. I tested it using Sparkfun QWIIC buttons, one on Wire and the other on Wire1. One hook up was
through a board that Paul of PJRC made us several years ago for us to test Wire code on Teensy boards... The other used a
QWIIC break out cable.
Pardon the mess as my table/desk has several different hookups and this one alone has the ones mentioned plus USB to Serial
adapter.
mjs513 commentedon May 17, 2025
@KurtE = should we even bother keeping this open at this point?
KurtE commentedon May 17, 2025
@mjs513 - maybe not... I think some stuff was merged in... Will have to see again if/when officially the board is merged into zephyr and then those changes back to ArduinoCoreZephyr and see where we are at.