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

NRF_FSTORAGE_DEF(nrf_fstorage_t fstorage) error if i compile,i face a error below,how can i fix it, i need to dynamic know the bootloader beginning addr

#if 1

#define DFU_APP_DATA_RESERVED (0x1000) * 3
#define NRF_UICR_BOOTLOADER_START_ADDRESS (NRF_UICR_BASE + 0x14)
#define TAG_START_ADDR ((* (uint32_t *)NRF_UICR_BOOTLOADER_START_ADDRESS) - DFU_APP_DATA_RESERVED)
#define TAG_END_ADDR ((* (uint32_t *)NRF_UICR_BOOTLOADER_START_ADDRESS))
#define FSTORAGE_START_ADDR (((* (uint32_t *)NRF_UICR_BOOTLOADER_START_ADDRESS) - DFU_APP_DATA_RESERVED) -0x1000)
#endif

static void fstorage_evt_handler(nrf_fstorage_evt_t * p_evt);
NRF_FSTORAGE_DEF(nrf_fstorage_t fstorage) =
{
/* Set a handler for fstorage events. */
.evt_handler = fstorage_evt_handler,

/* These below are the boundaries of the flash space assigned to this instance of fstorage.
* You must set these manually, even at runtime, before nrf_fstorage_init() is called.
* The function nrf5_flash_end_addr_get() can be used to retrieve the last address on the
* last page of flash available to write data. */

.start_addr = TAG_START_ADDR ,//0x6d000,
.end_addr = TAG_END_ADDR ,//0x71000, 

#endif
};

if i compile,i face a error below,how can i fix it, i need to dynamic know  the bootloader beginning addr 

..\..\..\main.c(1080): error: #28: expression must have a constant value
.start_addr = TAG_START_ADDR ,//0x6d000,//TAG_START_ADDR ,
..\..\..\main.c(1081): error: #28: expression must have a constant value

Related