adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.04k stars 1.2k forks source link

Kaluga not connecting via USB (since esp-idf update?) #4951

Closed jepler closed 3 years ago

jepler commented 3 years ago

I am using the uf2 bootloader (0.4.0) installed with Adafruit ESPTool.

Firmware downloaded from s3 and installed via uf2/KALUGA1BOOT: adafruit-circuitpython-espressif_kaluga_1.3-en_US-20210625-5a4a803.uf2

Behavior

With the above named firmware version, the CIRCUITPY drive does not appear. The LEDs do blink, so CircuitPython appears to start.

Linux dmesg shows errors like device descriptor read/64, error -110

Reverting to adafruit-circuitpython-espressif_kaluga_1.3-en_US-20210625-d67fb85.uf2 from s3 works

I think this indicates the problem was introduced by #4195

I did not test any other boards or installing via .bin.

@askpatrickw you may be interested in taking a look.

askpatrickw commented 3 years ago

@jepler i'm away from my desk for a few days. But I do have a Kaluga and can try to repo next week.

dhalbert commented 3 years ago

Does the .bin work?

jerryneedell commented 3 years ago

Using the .bin , mine boots but goes in to safe mode

uto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file an issue with the contents of your CIRCUITPY drive at 
https://github.com/adafruit/circuitpython/issues

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.0.0-alpha.3-474-g37c52110c on 2021-07-01; Kaluga 1 with ESP32S2
>>> 
jerryneedell commented 3 years ago

ah -- but it is OK if I remove my old code.py (using the OV7670 demo code from a few weeks ago

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.0.0-alpha.3-474-g37c52110c on 2021-07-01; Kaluga 1 with ESP32S2
>>> 
>>> 
jepler commented 3 years ago

My device (probably) had an OV____ camera demo on CIRCUITPY too, fwiw.

jepler commented 3 years ago

I also have a magtag with uf2. 6.3.0 works, but adafruit-circuitpython-adafruit_magtag_2.9_grayscale-en_US-20210701-37c5211.uf2 apparently goes into a bootloader loop, blinking purple on all LEDs once, then yellow/orange on the first led 4 times, then blinking purple on all LEDs forever.

https://user-images.githubusercontent.com/1517291/124188732-464eb180-da85-11eb-9f5b-dae6d26a244e.mp4

At Dan's suggestion I was going to try wiping the uf2 bootloader and try with a bare "bin" file, but I had trouble with esptool (related to the computer I was using, probably) and didn't get that far.

rsbohn commented 3 years ago

When I copy the .UF2 adafruit-circuitpython-adafruit_funhouse-en_GB-20210701-37c5211.uf2 to my funhouse the dotstars flash purple. Doesn't happen with the 7.0.0-alpha.3.

rsbohn commented 3 years ago

I can then go into boot mode and install 7.0.0-alpha.3 (tries to run code.py, fails because I haven't updated the libraries yet).

dhalbert commented 3 years ago

I tried the latest builds on a Metro ESP32 and a Feather S2. Without a code.py, they come up and I can use the REPL.

I had a random test program on the Feather S2, and found that this simple program causes a crash:

import busio
import board
import displayio
import adafruit_il0373

displayio.release_displays()

spi = busio.SPI(board.SCK, board.MOSI)
epd_cs = board.D9
epd_dc = board.D10

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000)

The last line causes a crash. If I remove the displayio.FourWire(), there is no crash.

I didn't actually have a display attached, but it doesn't matter: the display is output-only.

jfurcean commented 3 years ago

I was able to duplicate the crash on the Feather S2 with the latest from s3.

import busio
import board
import displayio
import adafruit_displayio_ssd1306

displayio.release_displays()

i2c = busio.I2C(board.SCL, board.SDA)

display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=32)

The last line is what causes the crash as well.

I confirmed that it doesn't crass with adafruit-circuitpython-unexpectedmaker_feathers2-en_US-20210625-d67fb85.uf2 from s3.

jerryneedell commented 3 years ago

See comments on PR #4960 -- it fixes this issue on the Kaluga and on the Funhouse

dhalbert commented 3 years ago

Confirming that #4960 fixes my crash as well. Will merge!