I'm trying to enable saving of coredump to flash. I'm running on nrf52840 with NRF SDK 1.6.1.
I have defined the following:
label = "coredump_partition";
reg = <0x000ff000 DT_SIZE_K(4)>;
};
00> coredump erase
00> Stored coredump erased.
I'm trying to enable saving of coredump to flash. I'm running on nrf52840 with NRF SDK 1.6.1.
I have defined the following:
NRF SDK 1.6.1.
ST-Kon said:coredump_flash_backend_start() adds an offset for the header but does not adjust the size but the same amount
I see there was a fix here recently(fixed in NCS v1.9.x), see these 2 commits:
https://github.com/nrfconnect/sdk-zephyr/commit/1dc74d70f265ab753b9ef3f00450426bc2ccf296
https://github.com/nrfconnect/sdk-zephyr/commit/d5520f2e59b7d6d65bb8f4b6e848df1d46e95836
Seems like it's stream_flash_init() that returns an error-code. Could you print the error-code, and post it here? E.g. change the line to something like this to print the value:
I traced the issue down to nrf_flash_sync_exe() in flash_sync_mpsl.c. The error happens when that function tries to obtain the semaphore (with my slight modification to print the status):
After more digging, it appears that the issue is with how nrf uses k_sem_take(). According to Zephyr docs (https://docs.zephyrproject.org/3.0.0/reference/kernel/synchronization/semaphores.html), if k_sem_take is called from ISR, it must use K_NO_WAIT for timeout.
However, NRF SDK uses K_FOREVER or actual timeout values in various places that are involved in the coredump. Because coredump is happening in the ISR, those timeout values are not valid. An assert gets triggered, or if asserts are disabled, I imagine Zephyr is unhappy, which is why we fail to take the semaphore.
Any update on this? Is there a plan to support coredump to flash with BT enabled?
Yes, user15146 , has there been any follow up?