- There is no softdevice in the flash
- I am not using BLE (but ESB Shockburst, maybe this is a problem?)
- Settings partition is at 0x7c000 (0x4000 size), `CONFIG_SETTINGS_NVS_SECTOR_COUNT=2`
- I call it on the main thread not in an ISR
- Zephyr workers and other threads are still running
- Application is not overlapping (size is around 0x489F0)
nrf_nvmc_mode_set(NRF_NVMC, NRF_NVMC_MODE_WRITE);
// ...
NRF_STATIC_INLINE void nrf_nvmc_mode_set(NRF_NVMC_Type *p_reg,
nrf_nvmc_mode_t mode)
{
printk("BPROT CONFIG0: 0x%08x\n", NRF_BPROT->CONFIG0);
printk("BPROT CONFIG1: 0x%08x\n", NRF_BPROT->CONFIG1);
printk("NRF_NVMC->READY: 0x%08x\n", NRF_NVMC->READY);
printk("FICR FLASH: %lu kB\n", NRF_FICR->INFO.FLASH);
printk("FICR RAM: %lu kB\n", NRF_FICR->INFO.RAM);
unsigned int key = irq_lock();
printk("nrf_nvmc_mode_set: Set mode %d\n", mode);
p_reg->CONFIG = (uint32_t)mode;
irq_unlock(key);
printk("nrf_nvmc_mode_set: Finished\n");
}nvs_write: Enter while #1 nvs_write: Exit while #1 nvs_write: Enter while #2 nvs_write: Enter nvs_flash_wrt_entry nvs_flash_wrt_entry: Writing entry id 49153 at offset 8 len 4 nvs_flash_wrt_entry: Writing data at 8 nvs_flash_al_wrt: Writing 4 bytes at 7c008 soc_flash_nrf: write addr 0x0007c008 len 4 write_op: context 0x20005190 write_op: Enter write 4-byte aligned data write_op: Write 4 bytes at flash addr 0x0007c008 from data addr 0x20001efc nvmc_word_write: addr 0x0007c008, value 0x0000001e nvmc_write_mode_set: Set write mode BPROT CONFIG0: 0x00000000 BPROT CONFIG1: 0x00000000 NRF_NVMC->READY: 0x00000001 FICR FLASH: 512 kB FICR RAM: 64 kB nrf_nvmc_mode_set: Set mode 1