Hi, all!
Sorry, I'm not good at English myself.
My device is nrf52832. Base code is ble_app_uart (sdk 12.0.0, pca10040, s132).
ADD. fs_sys_event_handler
static void sys_evt_dispatch(uint32_t sys_evt) { // Dispatch the system event to the fstorage module, where it will be // dispatched to the Flash Data Storage (FDS) module. fs_sys_event_handler(sys_evt); // Dispatch to the Advertising module last, since it will check if there are any // pending flash operations in fstorage. Let fstorage process system events first, // so that it can report correctly to the Advertising module. ble_advertising_on_sys_evt(sys_evt); }
ADD. fstorage code
void fstorage_test(void) { static uint32_t data; FS_REGISTER_CFG(fs_config_t fs_config) = { .callback = fs_evt_handler, // Function for event callbacks. .num_pages = NUM_PAGES, // Number of physical flash pages required. .priority = 0xFE // Priority for flash usage. }; fs_ret_t ret = fs_init(); if (ret != FS_SUCCESS) { printf("error\r\n"); } printf("0x%X ~ 0x%X\r\n", (uint32_t)fs_config.p_start_addr,(uint32_t)fs_config.p_end_addr); }
I test, changind page number (NUM_PAGES)
My prediction was this.
NUM_PAGES 1 : 0x7E000 ~ 0x7EFFF
NUM_PAGES 2 : 0x7D000 ~ 0x7DFFF
NUM_PAGES 3 : 0x7C000 ~ 0x7CFFF
But... fstorage_test(); result
NUM_PAGES 1 : 0x7E000 ~ 0x7F000
NUM_PAGES 2 : 0x7C000 ~ 0x7E000
NUM_PAGES 3 : 0x7A000 ~ 0x7D000
NUM_PAGES 4 : 0x78000 ~ 0x7C000
NUM_PAGES 5 : 0x76000 ~ 0x7B000
NUM_PAGES 6 : 0x74000 ~ 0x7A000
NUM_PAGES 7 : 0x72000 ~ 0x79000
Is this the right result?
thank yor for read my problem.