DA14683: Turn off FLASH in Cached Mode

I am working on a Bluetooth Low Energy (BLE) project with a custom board running a DA14683 MCU.
The VDD1V8 rail on the DA14683 powers the FLASH and an additional MCU.
Every once in a while I have to turn off the VDD1V8 rail of the DA14683 to shut down the additional MCU to save energy.
Because the DA14683 is running in cached mode, the program will stop working when the FLASH is turned off.

The DA14683 datasheet mentions a mirror mode.
On the basis of the description from the datasheet, the mirror mode would allow me to load my program from FLASH and run the program from RAM.
Unfortunately the SDK does not support the mirror mode, when the program code location is set to FLASH.
The compilation process will abort with an error "sdk/bsp/config/bsp_memory_layout.h:140:18: error: #error "QSPI mirrored mode is not supported!"", when I set the code location to FLASH and the execution mode to mirror mode.

Is it possible with the SDK to load the program from FLASH into RAM during startup or runtime and start executing the program from RAM for a BLE project?

  • Hi Klara,

    Thank you for posting your question online.
    According to DA14683 Datasheet, 3.4.3 BootROM Sequence, page:26

    If you follow the BootROM sequence diagram you will see that when we try Serial Booting, we will end up Downloading the code to the Data RAM.
    When we try NVM Booting (page 27 in DA14683 Datasheet):

    As you can also see in B. Cached Mode ,page 20:

    You can place code segments inside RAM (during Cache mode) but not your whole code. 
    Are you using QSPI Flash in your project? If yes which one?
    Regarding the issue that SDK 1.0.14 does not support mirrored mode from Flash, I will look into it and get back to you. 

    Kind Regards,

  • Hi Klara,

    Regarding the issue that SDK 1.0.14 does not support mirrored mode from Flash:
    Yes SDK 1.0.14 does not support mirrored mode from Flash.
    Please check the Screenshot below:

    __RETAINED_CODE --> You can Retain Code
    __RETAINED --> You can Retain zero-initialized Data
    __RETAINED_RW--> You can Retain non-zero initialized Data
    You can mark your code (each function separately) with __RETAINED_CODE, then the linker will go and give this address on the RAM address space and inside system_init we will copy this code into RAM.
    All you have to do is use the preprocessor macro on your functions.
    Please try and share the results.

    Kind Regards,