sipeed/MaixPy-v1

new user: how to install new MaixPy firmware

dylanmc opened this issue · 2 comments

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

  • Firmware version: 0.5.0
  • Board: Maix Amigo
  • OS: n/a

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

Steps:

  • download this repository to get the tools and scripts needed to flash the firmware
  • ensure Python serial support is installed, or if not pip3 install pyserial
  • cd MaixPy/projects/maixpy_amigo_tft (or whichever board you have)
  • plug in your MaixPy device
  • figure out which serial device it has created (in my case, on macOS, it created /dev/tty.usbserial-004043B) it also created an ...A device, but that didn't seem to work with the flash command
  • download the maixpy firmware release you want to flash - I chose maixpy_v0.6.2_72_g22a8555b5_amigo_tft_defaults.bin, and move it to ./build/maixpy.bin
  • run the flash command of the project.py script:
    python3 project.py -B maixduino -p /dev/tty.usbserial-004043B -b 1500000 flash
  • this script flashes the file in build/maixpy.bin to your device.

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

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