Hi all,
What are the default preflashed contents in the out of box nrf52840 flash?
I assume that bootloader is not present. If my assumption is correct how preflashed blinky application is executed?
Please answer. Thanks a lot.
Thanks,
Sridhar
Hi all,
What are the default preflashed contents in the out of box nrf52840 flash?
I assume that bootloader is not present. If my assumption is correct how preflashed blinky application is executed?
Please answer. Thanks a lot.
Thanks,
Sridhar
The chip itself is normally shipped blank. The devKit or module manufacturer may or may not pre-flash their own firmware.
If flash comes only with application from 0x00000000 address then how it is executed?
How MBR/SD knows the application start address in rom? Suppose I generate hex file with X address, how MBR knows code execute from X address?
All SD's are precoded for a particular start address. The correct rom application address is in the release notes for each version of SD. Not all SD's have the same application starting address as feature creep forces the SD to occupy more space with subsequent versions.
You have to compile your application with the correct rom start address that corresponds to your SD version.
If you want to change the application start address in an SD this link discusses how to do that:
https://devzone.nordicsemi.com/f/nordic-q-a/17317/s132-and-custom-application-start-address
As of my understanding whatever snippet you have given sd_softdevice_vector_table_base_set(APP_START_ADDR), first that should be programmed at precoded address and after that to this APP_START_ADDR targeted application softdevice will jump. This is what called as application switching using softdevice or bootloader is called right.
So two applications need to be programmed at two different locations.
Huh? I really don't understand your question.
You don't have to tell the SD anything. The SD is provided as a precompiled hex file. It already knows where your application is supposed to be. You only have to tell it via the API if you move your application.
All Cortex-M series maps as follow
Addr 0: contains the address of the top of the stack. SP will be loaded with this value on reset
Addr 4: contains the address of the reset function. PC will be loaded with this value on reset, then reset function will be executed.
Starting at address 8 is the interrupt vector. See this startup vector table source code and the reset function.
When using softdevice. softdevice will be the main application and your firmware is a kind of plugin so after softdevice is initialized, it will jump to your app. Which means your firmware must be located at a certain location depending on the version of softdevice used.
If softdevice is not used, your firmware is the main app.
I hope this clears up the confusion
All Cortex-M series maps as follow
Addr 0: contains the address of the top of the stack. SP will be loaded with this value on reset
Addr 4: contains the address of the reset function. PC will be loaded with this value on reset, then reset function will be executed.
Starting at address 8 is the interrupt vector. See this startup vector table source code and the reset function.
When using softdevice. softdevice will be the main application and your firmware is a kind of plugin so after softdevice is initialized, it will jump to your app. Which means your firmware must be located at a certain location depending on the version of softdevice used.
If softdevice is not used, your firmware is the main app.
I hope this clears up the confusion