[Adafruit Feather RP2040] No REPL on USB

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
User avatar
dbrazil
Posts: 14
Joined: Mon Apr 26, 2021 5:52 pm

[Adafruit Feather RP2040] No REPL on USB

Post by dbrazil » Tue Jun 08, 2021 6:20 pm

Hi,

I cloned the MicroPython repository and was able to build the firmware for the Feather RP2040 with the command:

Code: Select all

 make BOARD=ADAFRUIT_FEATHER_RP2040
However, after putting the UF2 into the Feather RP2040, I don't see the REPL on USB.
I built, using the same repository, the FW for the PICO and I can confirm I see the REPL on /dev/tty.usbmodem1413301 in the PICO board.

I checked the rp2/mpconfigport.h file and MICROPY_HW_ENABLE_UART_REPL is disabled and MICROPY_HW_ENABLE_USBDEV is enabled; which should give me access to the REPL trough USB.

Any thoughts on what is happening here?

User avatar
dbrazil
Posts: 14
Joined: Mon Apr 26, 2021 5:52 pm

Re: [Adafruit Feather RP2040] No REPL on USB

Post by dbrazil » Mon Jun 14, 2021 5:19 pm

Hi,

Posting the solution for this problem, which I found in the Adafruit Forum - Feather RP2040, does MicroPython work? .

The trick is to patch the mpconfigboard.h file, this is the diff of the patch:

Code: Select all

diff --git a/ports/rp2/boards/ADAFRUIT_FEATHER_RP2040/mpconfigboard.h b/ports/rp2/boards/ADAFRUIT_FEATHER_RP2040/mpconfigboard.h
index 5068d3554..2a9694c82 100644
--- a/ports/rp2/boards/ADAFRUIT_FEATHER_RP2040/mpconfigboard.h
+++ b/ports/rp2/boards/ADAFRUIT_FEATHER_RP2040/mpconfigboard.h
@@ -1,3 +1,5 @@
 // Board and hardware specific configuration
 #define MICROPY_HW_BOARD_NAME                   "Adafruit Feather RP2040"
-#define MICROPY_HW_FLASH_STORAGE_BYTES          (3072 * 1024)
+#define MICROPY_HW_FLASH_STORAGE_BYTES          (7 * 1024 * 1024 + 256 * 1024)  // 7.25MB flash
+#undef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES                   (8 * 1024 * 1024)
In my case, even after building the UF2 firmware with the patch, and flashing the board with it, the REPL wouldn't show up.
The trick was to put the CircuitPython for the Feather RP2040 FW, which erases the flash, then putting patched MicroPython built firmware.

In case you don't want to build it, I included as an attachment a clean firmware I built today. Just unzip it and drag it to the 'flash drive' of the Feather RP2040. :D
Attachments
firmware.uf2.zip
MicroPython v1.15-201-g8c02b9494-dirty on 2021-06-14
(207.75 KiB) Downloaded 156 times

Post Reply