delay(1) needed in while() loop for ESP32-S3 #169
Replies: 8 comments 9 replies
-
Did some testing and here are my results. Mostly for my future recollection as my head hurts this morning. ESP32-S3: delay(1) seems to be required in while loops not sure if anyone wants to do testing on the ESP32-S2 or ESP32-C3 but I would guess that they are like the ESP32-S3. Hence: I would propose that we use delay(1) in while loops for compatibility purposes. I don't think we should do precompiler preprocessing based on MCU because delay(1) won't have any appreciable effect on the program running in other microcontrollers. Thoughts? |
Beta Was this translation helpful? Give feedback.
-
Greetings, |
Beta Was this translation helpful? Give feedback.
-
I'd agree with Timm, seems like this issue is really only on my end. If you want to spend time that would be awesome but it's not necessary. It would be a great way to test out JTAG functionality. I've meant to try this but the JTAG hardware requires 6 additional pins and the hardware. There are different kinds of hardware you can use but the most cost efficient is ESP-PROG which you can find on Ali express and probably Amazon or other places. I'll link to a video of a guy I really like demonstrating the use of JTAG and PlatformIO. The Xiao ESP32-S3 has 6 solder pads on the back that can be used but they are pretty tiny. I'm not sure if the C3 has the same. Yeah the C3 has the same pads. You'd need to solder wire or make some kind of header to hook up the cable from the ESP-PROG: PlatformIO JTAG debugging: Video demonstrating how to set up and perform debugging: |
Beta Was this translation helpful? Give feedback.
-
Thanks i look forward to seeing platformio video. I have used jtag many
times but never on esp32, and apparently it is built-in to the C3 usb cable.
…On Tue, May 9, 2023 at 8:26 AM Jeff Lehman ***@***.***> wrote:
I've meant to try this but the JTAG hardware requires 6 additional pins
and the hardware. There are different kinds of hardware you can use but the
most cost efficient is ESP-PROG which you can find on Ali express and
probably Amazon or other places. I'll link to a video of a guy I really
like demonstrating the use of JTAG and PlatformIO. The Xiao ESP32-S3 has 6
solder pads on the back that can be used but they are pretty tiny. I'm not
sure if the C3 has the same.
PlatformIO JTAG debugging:
https://docs.platformio.org/en/latest/platforms/espressif32.html#debugging
Video demonstrating how to set up and perform debugging:
https://youtu.be/TivyIFF-dzw
—
Reply to this email directly, view it on GitHub
<#169 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACG5G7DETE6MBSWPSZCSNDXFJAY5ANCNFSM6AAAAAAXWRTK3Q>
.
You are receiving this because you commented.Message ID:
<timmbogner/Farm-Data-Relay-System/repo-discussions/169/comments/5849386@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Well good news and bad news -- the good news is that it looks like the built-in usb cable works for JTAG, but I read a warning that during deep sleep the USB will be turned off, and I guess that would mean JTAG will fail. So, I guess I am even more interested in your videos! :-) Note I haven't actually tested jtag with the usb cable yet, here is what I have so far: (ubuntu system) hab$ pio pkg exec -p tool-openocd-esp32 -c "openocd -f board/esp32c3-builtin.cfg" -bill |
Beta Was this translation helpful? Give feedback.
-
And by the way, not using jtag, just the arduino ide and the example sketch, here is what I see on the serial monitor: FDRS User Node initializing... |
Beta Was this translation helpful? Give feedback.
-
Thanks for testing it out! Yours works too just like Timm without issue. Must be something on my end and I'll try to figure it out at some point. Thanks! |
Beta Was this translation helpful? Give feedback.
-
By the way, a reference to the built-in jtag in the C3: And note-- besides just using the same usb cable that is used for arduino ide, etc, there are two pads for a dedicated jtag usb. I havent tried that yet. But I guess at this point I should cobble an external jtag interface that I can use with other esp32 modules besides the C3. |
Beta Was this translation helpful? Give feedback.
-
So I've been banging my head on the wall for awhile and can't figure out what is going on so I'm hoping someone can help. For the code listed below if I comment out the delay(1) line the output seems to hang at that point but does not go into watchdog timeout. It will just not proceed past that line - the serial shell output just outputs the previous DBG and nothing else. I've tried to search for the answer but cannot find a thing. So, for ESP32 why is that delay(1) line necessary? delay(0) and yield() do not seem to work - delay(1) is required; but why??? Note that when testing this the gateway that it is trying to ping is not alive. But what I expect it to do is time out at the given 300ms but that does not happen. It seems to just hang. Also, if I replace the delay(1) with a DBG statement it also seems to work without issue. I just can't understand why that stuff is needed.
MCU is a Seeed Xiao ESP32-S3
Beta Was this translation helpful? Give feedback.
All reactions