Yes i worked for datasheet in psoc designer and I used bootloader v3.0, so there is no problems with proper work of example. I want to protect this example to always start bootloader. For exapmle if apps starts at 0xFA memory so i want to put start_bootloader at 0xFA and add it to protected space of memory. Thanks to that my app will always start a bootloader and even if update goes wrong i can communicate by ic2 to bootloader and send new application again.
1 of 1 people found this helpful
If you additionally look at the module datasheet you can see the memory map,
where BL code is protected and retained after an upgrade. There is also an
address you set for the start of API code for the target code, which insures BL
code against erasure.
Note that the checksum controls invocation of BL, so if it is altered after a successful
upgrade the BL will be invoked again on startup. You can always modify this to be
triggered by other HW or SW.
I think you not tested this app. You just seen datasheet. In BL there are just functions app do not start from bootloader. It start from int main(void) so if you do not add call fuctions bootloader will not be avaliable.
application starts from 0xAF not from bootloader and if i send correctly my program it will jump to those functions and everything work fine after reboot. But if I lost source of energy in middle time of sending there will be no call fuction in my "new" not fully upgradet application.
i want to start my app from BootLdrI2C_Start(); then jump to 0xAF.
1 of 1 people found this helpful
"I think you not tested this app. You just seen datasheet."
You are correct, I have not tested ap, so will refrain from further comment.
There are people on this forum that should bve able to help you.
Thanks anyway for support.
Someone hava an idea?
I want to change example bootloader to version where bootloader will start in background automatically without using call fuction bootloader_start(); Also i want to protect this space of memory against rewrite.
Partially i find a solution, If you use a build in module of bootloader in psoc designer it works in simple way(it is written in datasheet). It starts an aplication and it check control sum of flash user program if it is equal with that in memory program starts corectly but if not it starts only bootloader and wait in infinite loop to recieve a program.
The conclusions is simple, i had avesome luck/unluck cuz i tested it and in the middle of sending application i removed power supply. After that it can't even start a bootloader. In final result it means that my previous application had the same control checksum or there was unexplained issue.
Should I play a lotery or something with this luck?
But still can I write a aplication and put function in specific place of memory? maybe in assembler? I don't know everyfing of c/c++ so it is possible there is some directive or command?
Some thoughts -
1) To handle power loss or communication link fault during boot upgrade
you can use combination of LVD interrupt and energy storage like super
caps to hold up the processor long enough to finish a block/row write
and "handle" controlled shutdown. Timer for communication link that goes
dead. Failure to keep processor in normal operating conditions during
block/row erase can yield completely unpredictable results. Possible
corruption in other areas of FLASH not intended.
2) Consider writing your own BL, or modify the project earlier referred to.
3) In compiler manual there are directives to force variables/code into specific