This can be an important normal task, for instance when retrying an eeprom waiting for its last write burn cycle to complete before it will respond again. We needed to do this on both the ESP32 S3 and the ESP32 S2 and found different issues on each (it seemed the Espressif I2C implementation is pretty […]
All posts by
Error codes
List of error code values https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/error-codes.html
.5 Debugging tips and info
Sharing IO pins – UART See here. Sharing IO pins – JTAG See here. Log output Get a runtime full log output via the serial port using esp-idf debug.
esp-idf debug
Outputting a full log via the serial port when debugging can sometimes be really helpful, because it contains all sorts of state information. idf.py menuconfig In the VS Code “TERMINAL” window, enter: idf.py menuconfig(You may need to use CTRL + ] to end its current mode and get its command prompt first) This will bring […]
.TWAI general
Documentation https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/twai.html Initialise CAN Bus Handling Alerts You need to check for and handle the TWAI_ALERT_BUS_OFF and TWAI_ALERT_BUS_RECOVERED to protect against the CAN bus ceasing to function if there are bus issues. Polling for alerts twai_read_alerts() uses a ticks_to_wait value, whereby if there is no alert it will wait the specified number of FreeRTOS ticks […]
Moving or renaming a project
Delete your projects “\build” folder. Update project() with a new project name in CMakeLists.txt (in projects root folder)
CAN bus renamed
Since V4.x release of esp-idf, the can bus peripheral is now called the TWAI (Two-Wire Automotive Interface) by Espressif. It’s still the same peripheral.The can.c etc files were left for backwards compatibility in V4.x esp-idf, and have been removed from V5.x of esp-idf. Various old documentation still exists for CAN, buts it’s the TWAI docs […]
CS Pin Control
Manually controlling CS pins When adding a SPI device, set its .spics_io_num to -1 Now when you access other device, ensure you set CS low before you use it and high again afterwards
Bit-banging IO pins
Example
Compiler errors
See here.
