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

Softdevice load instruction as data?

Hi,

I am developing application update, the environment is NRF52832 and softdevice S132, compiler and debugger is IAR.

What I have done are:

1. Application binary file is downloaded through bluetooth to Flash.

2. Watchdog reset system.

3. At system startup, check the flag to identify it is watchdog reset and new application binary file is stored.

4. Disable softdevice by softdevice_handler_sd_disable() function, update application using nrf_nvmc_page_erase() and nrf_nvmc_write_words() functions from RAM.

5. When updating finished, watchdog reset system again.

6. During system rebooting, the code runs in softdevice area and try to fetch Reset_Handler() address(0x3645C) from __vector_table(0x1C000), problem happens. After the PC is loaded as 0x3645C, I found this address is treated as 32-bit Data but 16-bit instruction! So NMI is generated.

About softdevice, my understanding is it is isolated to application. The only connection between them is the __vector_table. So as long as this table sits in 0x1C000, softdevice can hand over the control to application. But in my case, why this hand over is failed?

Is there anyone had the similar problem before? Please advise, thanks!

Dawei

Parents Reply Children
No Data
Related