This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

cant access flash when bootloader is present

i am trying to use flash to store and read data. I am able to do that when there is only softdevice and application. but when there is bootloader code get stuck. softdevice using is s130 2.0.1. i used keil to generate hex . softdevice and bootloader(buttonless) hex are loaded with nrfgo then app is loaded using nrfconnect(dfu). to give command to flash data given by uart(pin 0.1 and p0.2) . ble_flash.c function i am using to access flash.

NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Een << NVMC_CONFIG_WEN_Pos);

this is line used before erasing the page. i had put two led turn on instructions before and after this line and came to the conclusion that after this line execute code seem stuck somewhere.

cant figure out why?. because without bootloader ,code works.

Parents Reply
  • ok ...so in the sd_flash write it was memory address instead of page number.

    err_code = sd_flash_write((uint32_t *)((NRF_FICR->CODESIZE - 20)*NRF_FICR->CODEPAGESIZE),data_32_1,2);

    with this i get , err_code = NRF_SUCCESS and  NRF_EVT_FLASH_OPERATION_SUCCESS in sys_evt_dispatch

    with pointers ..able to read data direclty from address...

Children
Related