Case 1: No SD card mounted
- Power on, boots to flash
- Reset button, boots to flash
- Power on, doesn't "boot", just green light and no REPL <=== PROBLEM
- Reset button, boots to SD card
Any idea why the board doesn't boot with a power-on reset?
Setup Code
Boot.py is the same on internal flash and sd card:
Code: Select all
# boot.py -- run on boot-up
# can run arbitrary Python, but best to keep it minimal
import machine
import pyb
import uos
uart=pyb.UART(6,115200)
uos.dupterm(uart)
pyb.country('US') # ISO 3166-1 Alpha-2 code, eg US, GB, DE, AU
pyb.main('main.py') # main script to run after this one
#pyb.usb_mode('VCP+MSC') # act as a serial and a storage device
#pyb.usb_mode('VCP+HID') # act as a serial device and a mouse
pyboard/flash/main.py:
Code: Select all
import pyb
pyb.LED(1).on()
pyb.LED(2).off()
pyb.LED(3).on()
pyb.LED(4).off()
print('HELLO from FLASH')
Code: Select all
import pyb
pyb.LED(1).off()
pyb.LED(2).on()
pyb.LED(3).off()
pyb.LED(4).on()
print('HELLO from SD')