https://toitlang.org/ logo
Trying to initialize uart on esp32c6
# help
a
Running
Copy code
import gpio
import uart
UART_RX_GPIO ::= 20
UART_TX_GPIO ::= 19
main:
  port := uart.Port
    --rx=gpio.Pin UART_RX_GPIO
    --tx=gpio.Pin UART_TX_GPIO
    --baud_rate=115200
Getting
Copy code
Potential deadlock detected:
  Process: 2
  Program: a42ef4b4-b892-6588-9883-ce3d1e1e3b30
  BCI: 0x5c6
  Primitive: 10:1
fatal: Potential dead-lock

abort() was called at PC 0x4202f7fd on core 0
Core  0 register dump:
MEPC    : 0x40806b76  RA      : 0x4081546e  SP      : 0x40831da0  GP      : 0x40824824
TP      : 0x40831fe0  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130
S0/FP   : 0x40831ddc  S1      : 0x40831ddc  A0      : 0x40831ddc  A1      : 0x40831dbe
A2      : 0x00000000  A3      : 0x40831e09  A4      : 0x00000001  A5      : 0x4082d000
A6      : 0x00000000  A7      : 0x76757473  S2      : 0x40831dc0  S3      : 0x00000001
S4      : 0x004c4b40  S5      : 0x00000005  S6      : 0x028e885f  S7      : 0x408332c0
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000002  MTVAL   : 0x00000000
MHARTID : 0x00000000
not sure what the Primitive is, and seemignly i can only reproduce it on this hardeware setup. Got any pointers?
im starting to guess its the noconsole / console esp defdault UART thing that I vaugly remember from a year ago now, and its just not a very nice error message 😄
Although I just tried envelopes wiht CONFIG_ESP_CONSOLE_NONE=y etc and didnt solve it!
10:1 in 189 i believe is
PRIMITIVE(create, 11)
f
It's indeed 'create'. No idea how that one could block...
Since you are building yourself, could you maybe add a few printfs to the function to see where it gets stuck? https://github.com/toitlang/toit/blob/6d7fc990007289a43b49beec6871e46f73bbaee5/src/resources/uart_esp32.cc#L778
a
oh yes, im deep in these printfs now 😛 Getting there
Got a patch that seems to work for me, will make a PR shortly, just walking home
Quite nice being able to do the full thing end to end now! Maybe I can go back and debug my i2c deadlocks 😂
@floitsch so I'm pretty sure this is what ultimately fixed my ESP32c6 https://github.com/toitlang/toit/pull/2999
i see conflicts with master, would be hillarious if this is already fixed in the latest release, that id idnt quite try yet, hahaha
Maybe I'll wait and find that out tommorrow when I have the device again and I can try v2.0.0-alpha.190 which has https://github.com/toitlang/toit/commit/6a9ee388c8c7af25554f352143a3267dfea56618
yup, i think you fixed the clk issue 😛
f
Argh. I missed that you were on 189.
a
it was a fun journey nonetheless
and your rewrite did fix some issues then 😄 I expect
f
190 has a completely rewritten uart
a
yeah, I vaugly remember it now from when you put the release notes in discord
f
Hopefully more fixing than breaking 🙂
a
i was already so far down the rabbit hole i didnt think about just trying to update xD
f
🙂
And well done. I had a look at fixing things with the old UART code and gave up. You actually managed to find a fix.
a
maybe not the only one that was needed 😛 but either way, I'll be happy to have my device UART working in the morning 😄
Aaaah, @floitsch 190 is not yet in a jaguar release? 🙁
f
No. Not yet. 190 had some big changes (like UART and esptool) and I wanted to test it a bit more before shipping it to our users with Jaguar.
a
"cleanest" way to easily use the default 190 envelope with the existing jag?
f
Probably using toit-repo-path. But I can do a 190 release soon (today?). Especially since you have confirmed that 190 works for you.
a
> Especially since you have confirmed that 190 works for you. Still need to do that, i havnt run it just, just read the codd!
I wonder if you might be able to look at https://github.com/toitlang/toit/pull/2998 for the same reelase? 😉 Cant use our c3 pins without it (but again fine as I have a cyustom build for that already)
f
That would require a new SDK release. Note that you can use the pins with a flag. (And your PR is for s3 not c3).
a
> Note that you can use the pins with a flag ooh, that skips the check?
f
Yes. The "restricted" can be forced
a
looks like I need / want my own envelope anyway to set the ESP with SRAM off so that I dont get warnings!
3 Views