Programming Maix m1w using Arduino

Hello,

I’ve made a custom board with a Maix M1w. Connecting the ISP_TX & ISP_RX to an Arduino Mega and then that to my PC over USB. I can see the output of the default firmware of the m1w and can interact with it (use the python REPL). However, was trying to figure out how to actually flash the firmware to the M1w using the Arduino and connect to the M1w to the MaixPy IDE (again using the arduino). I’ve broken out the BOOT and RST pins, not sure exactly which order they need to be pulled up/down in. If anyone could help me out that’d be great!

Thanks!

Here is the boot sequence as I understand it

  1. RESET pin is deasserted.

  2. Both harts begin executing at 0x00001000.

  3. Both harts jump to firmware at 0x88000000.

  4. One hart is chosen as a boot hart.

  5. Firmware reads value of pin IO_16 (ISP).

    • If the pin is low, enter ISP mode. This mode allows loading data to ram,
      writing it to flash, and booting from specific addresses.
    • If the pin is high, continue boot.
  6. Firmware reads the next stage from flash (SPI3) to address 0x80000000.

    • If byte 0 is 1, the next stage is decrypted using the built-in AES
      accelerator and the one-time programmable, 128-bit AES key.
    • Bytes 1 to 4 hold the length of the next stage.
    • The SHA-256 sum of the next stage is automatically calculated, and verified
      against the 32 bytes following the next stage.
  7. The boot hart sends an IPI to the other hart telling it to jump to the next
    stage.

  8. The boot hart jumps to 0x80000000.