mocleiri / tensorflow-micropython-examples

A custom micropython firmware integrating tensorflow lite for microcontrollers and ulab to implement the tensorflow micro examples.
MIT License
183 stars 87 forks source link

Problem about firmware for Raspberry Pi Pico #105

Open Feihong-web opened 1 year ago

Feihong-web commented 1 year ago

I have drag the firmware.uf2 file to my Raspberry Pi Pico broad. But my computer and THonny IDE can not recognize the broad as an USB device correctly and I can not program on the Pico broad.

mocleiri commented 1 year ago

Can you try to put the board into flash mode before moving the .uf2 file over?

https://micropython.org/download/rp2-pico/

It says to hold down the boot select button as you plug in the usb cable and that will present the disk where it will flash the .uf2 file when copied.

If you just copy it over you are doing a file copy not flashing a new firmware.

Feihong-web commented 1 year ago

Dear Mocleiri, Thank you very much for your reply and help to me. I did hold down the "bootsel" button while plugging in the USB cable. And a disk driver named RPI-RP2 was presented And then I copied the .uf2 file into the disk, but the board couldn't be recognised by the Thonny IDE But if I drag firmware for other RP2040-based board into the Pico board, there is no problems. rp 2 3 Thanks again, Best wishes.

mocleiri commented 1 year ago

Can you try flashing the image for microlite-rp2-adafruit-feather-rp2040-firmware

https://github.com/mocleiri/tensorflow-micropython-examples/actions/runs/3727394117

That's the board I have and others reported that the normal image doesn't work but they were able to flash this one.

dattran-itrvn commented 1 year ago

This error is related to 'MICROPY_HW_FLASH_STORAGE_BASE' in the 'micropython/ports/rp2/rp2_flash.c' file. You need to reduce the size of 'MICROPY_HW_FLASH_STORAGE_BYTES' in the '\micropython\ports\rp2\boards\PICO\mpconfigboard.h' file. #define MICROPY_HW_FLASH_STORAGE_BYTES (1024 * 1024)

The current configuration (1408 * 1024) is for MicroPython. We need to reduce 'MICROPY_HW_FLASH_STORAGE_BYTES' to have enough space for both MicroPython and Tensor Lite for MCU