Calling i2c.scan() causes restart on Wemos D1 mini pro
The following code copied to REPL
from machine import Pin, I2C
i2c = I2C(sda=Pin(4), scl=Pin(5))
i2c.scan()
..results in device restart:
>>> i2c.scan()
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x40100000, len 30716, room 16
tail 12
chksum 0xc8
ho 0 tail 12 room 4
load 0x3ffe8000, len 996, room 12
tail 8
chksum 0x06
load 0x3ffe83f0, len 1080, room 0
tail 8
chksum 0x11
csum 0x11
���2�N�{��N|�
l
d$l`B���
��r�l�N�
�n�
d ��{�p��l
l`�n�l�l�
l`��s�l
���
d$ rl��rl��"�|��B$b��B|����$$b��o�no��lo���$�ll����
d �o����cc
ld䌎�B���c
l�bsd{$r�o����|���c�܄$�r����
MicroPython v1.19.1-337-gbd4e45fd6 on 2022-08-26; ESP module with ESP8266
Type "help()" for more information.
Issue observed with the latest stable (v1.19.1 (2022-06-18) .bin) and also nightly build (v1.19.1-337-gbd4e45fd6 (2022-08-26) .bin).
The problem goes away when board is flashed with v.1.18 or when using Arduino IDE to scan I2C bus. Here's an example after flashing with 1.18:
MicroPython v1.18 on 2022-01-17; ESP module with ESP8266
Type "help()" for more information.
>>>
>>> from machine import Pin, I2C
>>> i2c = I2C(sda=Pin(4), scl=Pin(5))
>>> i2c.scan()
[]
HW info:
- Wemos D1 mini pro (clone), all pins unconnected
- connected via microUSB to a PC
Command used for flashing:
esptool.py --port /dev/ttyUSB0 --baud 1000000 write_flash --flash_size=4MB -fm dio 0 FILENAME.bin
ESP8266 1.8.3-80 i2c.scan shows all available ports
Hi. While I was trying to connect a 24LC02B external 2k EEPROM to my wemos 1D mini board (essentially a esp8288 with usb serial converter) I had problem to scan i2c ports.
This is what I tried.
>>> from machine import Pin, I2C
>>> i2c = I2C(scl=Pin(5), sda=Pin(4))
>>> i2c.scan()
[8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119]
I connected eeprom's scl sda to 5 and 4 respectively and WP and Address pins are grounded (expecting a 80 address from the eeprom)
When I ignore this problem and try to writeto_mem it think it succeeded but readfrom_mem only returns 0x00.
Downgrading also doesn't work, issue is persistent with 1.8.2-104.