Hi all,
What's happening?
System reboots when "flash_erase" is called with parameters offset 0x1f000 and size 0x1000
Setup:
- NCS v2.0.0
- nRF52832 with 512K flash
- Flash partitions:
/delete-node/ &slot1_partition;
/delete-node/ &scratch_partition;
- project configuration
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_SOC_FLASH_NRF=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y
Code:
#define DRV_SECURE_START_ADDR FLASH_AREA_OFFSET(phsecure)
#define DRV_SECURE_FLASH_SIZE FLASH_AREA_SIZE(phsecure)
static const struct device *secureDev;
void test (void)
{
//
// Test function
//
secureDev = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller));
if ( true == device_is_ready(secureDev) )
{
printk("Secure start addr: %08X and size %d", DRV_SECURE_START_ADDR, DRV_SECURE_FLASH_SIZE);
// Erase secure area
flash_erase(secureDev, DRV_SECURE_START_ADDR, DRV_SECURE_FLASH_SIZE);
// Do anything ....
}
}
Debugging step by step, I've seen that the system reboots when MULTITHREADING_LOCK_RELEASE(); is called inside the function "nrf_flash_sync_exe".
Does anyone have an idea of what is happening?
Thank you
this function is called inside the function