ESP32C3 Super Mini - Hardware SPI resets the board #7506
Replies: 1 comment
-
Posted at 2025-01-23 by @gfwilliams Hi - I'm afraid I'm not sure why it would be broken, no - however @SimonGAndrews has recently done a bunch of work on I2C and that needed a bit of fettling to work nicelty with the C3, so SPI might be the same. Honestly, I wouldn't be put off using software SPI - whichever way you write the data Espruino will wait until the transmission is complete, so using hardware over software really doesn't gain you very much. Posted at 2025-01-23 by @SimonGAndrews Hi @devsnd , I would be happy to help figure this out. My current project needs to use SPI for an analog input chip. And also wanted to prove the I2c was working on S3 also. Posted at 2025-01-23 by @devsnd Thanks @gfwilliams, I thought the SPI bus would be buffered in hardware, but if it's a blocking operation either way, I'll just continue using software SPI and call it a day! Thank you for clearing that up. Posted at 2025-01-23 by @devsnd Hey @SimonGAndrews, This is the board I'm working with: https://www.aliexpress.com/item/1005006599448997.html Except for the SPI everything has been working nicely so far (BLE, WiFi), only exception being that the LED1 is on pin 8 for the super mini board. So I have to use Posted at 2025-01-23 by @enaon
I am sorry if the question is a bit irrelevant. Is this the 2.25 the ESP32 version of espruino, using https://www.espruino.com/Espressif+Flash? I am having troyble with an esp32 wemos board, the wifi stops after some time, I get an ERROR: Connect failed (err 118). I just want a verification that esp32 works stable in general. Posted at 2025-01-23 by @SimonGAndrews @devsnd
spi_bus_initialize is called in Espruino from targets/esp32/jshardwareSpi.c Attachments: Posted at 2025-01-24 by @gfwilliams Thanks for looking into this @SimonGAndrews - I just posted on the GitHub issue
Yes - for higher speeds hardware SPI will be able to push data faster but you'll never hit that with At some point it might make sense to make it async, but a lot of JS code expects that it is synchronous (eg setting a pin, sending by SPI, disabling that pin) Posted at 2025-01-26 by @devsnd @enaon for me the WiFi is also kinda flaky. I'm trying to work around it in software now, by adding retries and reconnects, but it's far from ideal. I stumbled upon this article here (https://roryhay.es/blog/esp32-c3-super-mini-flaw) which basically says that there's a bunch of boards out there that have flawed PCB designs. I still have to get out my calipers to check if my board is one of the bad ones... @SimonGAndrews very interesting that you can reproduce on your S3. I won't be a big help in the investigation, except for trying out any new firmwares you prepare that you want tested in a c3 board... my time is very limited currently and software SPI is good enough for my purposes, as Gordon attests. Posted at 2025-01-27 by @SimonGAndrews @devsnd the problem you found is in the c3 and s3 builds. I’ve found a fix for it that works in both. The testing is going ok so far. It’s great that you found it , the more people using the builds , the better to help make them stable. PS - that’s a good practical article you found regarding the Wi-Fi Posted at 2025-01-27 by @gfwilliams
Yes, I hit this too, and in the end I think it killed the RF stage of my C3 board. I wasted so much time on this thinking it was an Espruino problem - maybe try and return them and get some decent ones. There's not a bunch we can do in software Posted at 2025-01-28 by @enaon
thank you for you time to answer, I guess my case may not be related to the s3's issues, as I have an old esp32 wemos module that I know wifi was working fine hardware wise, I used it with moongoose os for some years now, it was stable. I will play some more, thank you again. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2025-01-22 by @devsnd
Hey! I bought one of those tiny ESP32C3 Super Mini boards; I built and flashed the firmware for ESP32C3_IDF4 and it works nicely (tested all pins with a LED, at least). However, when I try to use hardware SPI, the board seems to reset. The bluetooth connection is interrupted and then my uploaded code into RAM is gone. However, when I use software SPI, it works fine.
I'm trying to get the Nokia 5110 display to run, like described here: https://www.espruino.com/PCD8544
The working code:
and non working code using hardware SPI:
The board already crashes upon calling the
.setup
function.EDIT: the board is running 2v24.196 right now, will try to flash a build from the current master branch to seew if it persists....
Does anybody have an idea why this wouldn't work?
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions