hello all, i am very confused about flash programming concept.please have a look at the below issue i am writing code for STM32f103c8 in keil. i want to write the code at some address(not default address) and want execute from the same location..waht are the changes i need to do and where should i change.could you please tell me in brief regarding this flash programming concept
thanks in advance
So why did you write a post where you totally forgot the main facts?
Like _why_ you want your program stored and run at a non-default address - you don't think that matters a bit? Like how the processor will be able to figure out where your program happens to be?
The code execution always starts from the Reset Vector address. But the manufacturers, generally write bootloader (IAP code or ISP code) at vector address. Thus the user code begins from some other address. This jump to address is set by the IDE depending upon the controller selected (and hence the code memory consumed by the controller bootloader code).
You may also start writing vector address, but the bootloader will be erased and you may not be able to program your chip using ISP/IAP. Perform full chip erase to erase bootloader code.
WARNING: Dont erase bootloader code, if you are not aware of what will be consequences and or even dont know how to re-program the bootloader code.
Do they?
I think the bootloaders provided by the chip manufacturers are usually in ROM - not in the user Flash space.
In the STM32, this bootloader is controlled by the BOOT pins; it loads the code, and then jumps to the reset vector address. This is invisible to the user project.
I think you are getting confused with writing your own bootloader - which, obviously, does have to start from the reset vector and does have to load the "application" to a different address, and make the jump to the application...?
For the STM32, ST provide an application note & example of how to do this - search the ST resources for "In-Application Programming" (IAP).