sipeed / MaixPy-v1

MicroPython for K210 RISC-V, let's play with edge AI easier
https://wiki.sipeed.com/maixpy
Other
1.68k stars 439 forks source link

new user: how to install new MaixPy firmware #455

Open dylanmc opened 2 years ago

dylanmc commented 2 years ago

Describe the bug I have a MAiX Amigo, it powers on and the LCD reports firmware v0.5.0. I have downloaded a new firmware, and tried copying it to a micro-SD card and booting the Amigo, but nothing I do (holding down different buttons, etc.) seems to cause a firmware update. Unclear from the website how to get started.

Expected behavior Firmware update happens

Actual behaviour Screen reports "Welcome to MaixPy v0.5.0 : maixpi.sipeed.com"

Please complete the following information

dylanmc commented 2 years ago

I figured it out (in case others have issues).

Steps:

You should get output like this:

-- SDK_PATH:/Users/.../MaixPy
maixpy
-- flash config changed, update at /Users/.../MaixPy/projects/maixpy_amigo_tft/.flash.conf.json
-- flash start
=============== flash config =============
-- flash port    :/dev/tty.usbserial-004043B
-- flash baudrate:1500000
-- flash board:maixduino
-- flash open terminal:False
-- flash download to sram:False
-- flash noansi:False
-- flash slow mode:True
-- flash firmware:/Users/.../MaixPy/projects/maixpy_amigo_tft/build/maixpy.bin

-- kflash start
[INFO]COM Port Selected Manually: /dev/tty.usbserial-004043B
[INFO]Default baudrate is115200, later it may be changed to the value you set.
[INFO]Trying to Enter the ISP Mode...
*
[INFO]Greeting Message Detected, Start Downloading ISP
Downloading ISP: |===============================================================================| 100.0% 10kiB/s
[INFO]Booting From 0x80000000
[INFO]Wait For 0.1 second for ISP to Boot
[INFO]Boot to Flashmode Successfully
[INFO]Selected Baudrate: 1500000
[INFO]Baudrate changed, greeting with ISP again ...
[INFO]Boot to Flashmode Successfully
[INFO]Selected Flash: On-Board
[INFO]Initialization flash Successfully
Programming BIN: |===============================================================================| 100.0% 54kiB/s
[INFO]Rebooting...
== flash end ==

After following these instructions, the /dev/tty port it created changed (it's now /dev/tty.usbserial-001043B), and I can access the MicroPython prompt via the serial port, but nothing shows up on the display. It's new firmware (yay!), but I was expecting things on the LCD screen. Perhaps this is related to the python error at system start:

{"board_info": {"SPI_MISO": 6, "SPI_CS": 12, "NEXT": 20, "LED_B": 17, "LED_W": 32, "I2S0_MCLK": 13, "I2S0_WS": 18}
Traceback (most recent call last):
  File "main.py", line 15, in <module>
KeyError: loading
MicroPython v0.6.2-72-g22a8555b5 on 2021-11-01; Sipeed_M1 with kendryte-k210

I think this is now issue #435

arthurkafer commented 2 years ago

Every MaixPy firmware comes with a boot.py and a main.py file, but it probably doesn't have anything in the default file using LCD. You can flash AI models just like you flashed your firmware, but it has some other steps to follow to make it work correctly