adafruit / Adafruit_nRF52_Arduino

Adafruit code for the Nordic nRF52 BLE SoC on Arduino
Other
615 stars 496 forks source link

Make User Data memory region customable (for custom bootloader) #778

Closed JOSE-Sendance closed 10 months ago

JOSE-Sendance commented 1 year ago

Is your feature request related to a problem? Please describe. When using a custom bootloader, the bootloader needs more space than the default one. I want to change the base adress of the bootloader to 0xE0000. So the User data also needs to be shifted down from 0xED000 to 0xD9000

Describe the solution you'd like In the file: .platformio\packages\framework-arduinoadafruitnrf52\libraries\InternalFileSytem\src\InternalFileSystem.cpp

add some #ifndef LFS_FLASH_ADDR so that it can be defined in platform.ini via the compile flags.

#ifndef LFS_FLASH_ADDR        
#ifdef NRF52840_XXAA
#define LFS_FLASH_ADDR        0xED000
#else
#define LFS_FLASH_ADDR        0x6D000
#endif
#endif // LFS_FLASH_ADDR

In the linker file for the application it would also need a change, or somehow to be configurable:

.platformio\packages\framework-arduinoadafruitnrf52\cores\nRF5\linker\nrf52840_s140_v6.ld

    FLASH (rx)     : ORIGIN = 0x26000, LENGTH = 0xED000 - 0x26000     change to=>
    FLASH (rx)     : ORIGIN = 0x26000, LENGTH = 0xD9000 - 0x26000

Additional context I am not sure if it needs to be changed somewhere else as well.

hathach commented 10 months ago

this feature is not supported, however, we can still review and merge your PR if the changes is clear and not invasive.