There was a problem communicating with the IIC on the ESP32-S3

Issue #490 resolved
YongYu created an issue

Hi!John. I had a problem communicating with the IIC on the ESP32-S3. I bought an ESP32-S3 to test, model number: ESP32-S3-wroom-1-N16R8. This is picture 1, 2

I burned the S3 firmware and unwired it by following the IIC pins in the firmware (SDA=8,SCL=9). Picture 3.But it can't read the values of the line sensor and other IIC communication devices. video1

What is strange is that I changed the serial port of the IIC to SDA=0,SCL=1. Although I connected the cable to IO8 and 9. MicroBlocks did not report an error.

In addition, I also found that during the programming process, the platform became clunky. video2

I'm looking forward to your advice. We want to use the ESP32-S3 on the new development board.

Comments (6)

  1. John Maloney repo owner

    What is strange is that I changed the serial port of the IIC to SDA=0,SCL=1. Although I connected the cable to IO8 and 9. MicroBlocks did not report an error.

    Software running on the chip (including software written in C++ or assembly language) depends on the programmer to tell it what is connected to the pins. Thus, it's up to you to make sure that you are connecting your I2C device to the I2C pins specified in the software. If you did not change the MicroBlocks source code, those pins will be the ones in the pins_arduino.h file for your variant (SDA=8,SCL=9). If you changed the MicroBlocks source code to use SDA=0,SCL=1, then it will be those pins.

    Whichever pins you use, they must have external pullup resistors on the SDA and SCL pins or the low-level I2C driver will hang and the board will become unresponsive. That might explain the issue shown in video2.

    Most I2C peripherals have built-in pullup resistors. However, if you have connected your I2C device to the wrong pins then the actual SDA and SCL pins will not be pulled up and you will experience a hang.

    Normally, you could recover from a hang by resetting or power-cycling the board. But since you have a "when started" script that tries to use the I2C pins it will simply hang again every time it restarts. If this is happening, try connecting the I2C board to the other set of pins (e.g. SDA=0,SCL=1).

    Another possible test: connect I2C peripherals to both pairs of pins, then use MicroBlocks to determine which pins are actually being used.

    Finally, if your board does not respond whichever pins you have connected, you may need to use esptool to erase flash. Erasing flash will clear your MicroBlocks "when started" program to prevent the board from crashing on startup.

    Hint: When developing things like I2C operations that have potential to crash the board it is safer to NOT put the test code under a "when started" hat. Instead, just click on the blocks or scripts you want to test to run them manually. Then, if the board does crash, you can recover easily.

  2. Log in to comment