-
Hi All! I have a custom ESP32C3 board that I want to use to log sensor data to a csv on an SD-Card. The sensors (MPU6050 and BME280) are connected to the I2C bus. The chip is talking to them via the sensor API's. I intend to use the Filesystem API to write logs. SetupGPIO6 - SCL Firmware FlowThe firmware works by:
ProblemBetween when i remove step 2 (invoking Sadly, I'm not sure how to setup the ESP32 OpenOCD to step through firmware properly on zephyr to debug. It'd be great if someone could also point out how I could do this. If its easier, I'm happy to run it purely in terminal. LinksUWAA Flight Computer is the repo i'm currently working in. Its based off the example project. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 21 replies
-
The current Zephyr OpenOCD version 0.11 doesn't support ESP32 yet (not sure when v0.12 will be integrated), so you need to build the ESP32 OpenOCD build and then tell west to use that. See https://docs.zephyrproject.org/latest/boards/riscv/esp32c3_devkitm/doc/index.html#debugging for how to specify the OpenOCD version to use when doing west build which is then used when you do west debug. To build the ESP32 Fork of OpenOCD, do the usual:
I set it up in this case to do the install to the source folder just to keep things together. You then follow this with the following commands from your Zephyr build directory:
As for your I2C and SD card issues it is hard to tell if you have a pin configuration issue or a threading issue. I would personally try to run the commands in a single thread as a test case to make sure that works. Also, check the final DT in build/zephyr/zephyr.dts to see if there is anything there that you are not expecting that would cause a pinctrl issue. |
Beta Was this translation helpful? Give feedback.
-
@rftafas Hi Ricardo. Henry isn't seeing a crash, he is just seeing that I2C sensor reads are failing when SD card (running in SPI mode) file system is successfully mounted. This is on an ESP32-C3. |
Beta Was this translation helpful? Give feedback.
I may have found a solution but I'm not sure if this is something that should be flagged... Perhaps the docs may be enough to tell others and I may have been a bit dumb 😅
Findings
I probed the lines and found that the MTDO pin used for JTAG debugging was outputting a signal whenever the device would start up. When I switch the pins to a different pin (GPIO10), I am able to use both, SD Card and I2C. I'm not sure why this would stop the system from spitting out data from the I2C lines but i thought. Should this be flagged as a potential problem?
For reference, SDA was connected to GPIO7 and SCL was connected to GPIO6.
Waveforms
Multi-Threading Performance
EDIT: I've since tried this with…