We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
in main() I have two pieces of code - the first one needs to start at the beginning of main and it is very small the second one will be placed just after at the beginnig adddress + 200h can you tell me the directive(s) to use to set this second piece of code to be placed at this specific address after the beginning of main()
Here is the way I start the main application from the bootloader: 1) I write a magic cookie into a variable. 2) I trigger a software reset. 3) Early in the bootloader, I check if the magic cookie is present. If so, I jump to the main application starting address.
This way the main application starts up alomost from the reset state. Very convenient.
But who writes the magic cookie? Can't be the application because it hasn't been started until the boot loader runs.
Would be meaningless for the boot loader to write a magic cookie and then test it.
Magic cookies are good for having an application perform a forced reboot, and with the cookie tell the boot loader to _not_ boot into the application again, but to instead perform a transfer.
For normal operation, it's better to have the application area covered by a CRC-32 or similar, and have the boot loader scan the area to verify if the computed CRC-32 is correct.