rp-rs / rp-hal-boards

Board Support Packages for RP2040 based PCBs
199 stars 82 forks source link

Add support for RP2040 with 16MB of flash #59

Open Fede-26 opened 5 months ago

Fede-26 commented 5 months ago

I want to add support for this board: https://it.aliexpress.com/item/1005003657583800.html. It's a clone of the official pi pico with 16MB of flash.

I can't find how to specify the ROM size like the (pimoroni-pico-lipo-16mb)[https://github.com/rp-rs/rp-hal-boards/tree/main/boards/pimoroni-pico-lipo-16mb].

I believe this is the only change necessary, because when using the C sdk, I just need to copy the official board config and change the ROM size.

jannic commented 5 months ago

I don't have a board with 16MB flash to test this, but as far as I know, all you need to do is update memory.x accordingly. However, there's currently no mechanism to have a BSP specific memory.x.

In fact, it should still work if you don't update it. You just wouldn't be able to use all that flash, but only the first 2MB.

Fede-26 commented 5 months ago

Then why the readme (and the specific documentation in the relative directory) says

Note that if you use this crate the compiler will expect the full 16MB flash space, and so it may not work if you only have the 4MB variant.

?

If you can't change the flash size of each different bsp shouldn't the compiler expect a normal 2MB flash?

For now I think you can just change the memory.x file on the pc accordingly to the size of the flash installed. If that's the only way to change this parameter I believe it should be written in the readme. In this case I can make a pr later.