Gene Smith a écrit :
> Spencer Oliver wrote:
>   
>>> This is a bit off topic for this list but thought I would ask 
>>> since quite a bit of discussion on programming STM32 is here.
>>>
>>> This is in regard to "in-application programming" (IAP) mentioned in
>>> PM0042 Programming manual. Does this mean that your 
>>> application running in flash can program flash without moving 
>>> the code to RAM?
>>>
>>>       
>> Yes this can be done on the stm32
>>
>> Cheers
>> Spen
>>     
>
>
> Thanks for verifying this. I also found an app note AN2557 and some 
> sample code on how to do this:
> http://www.st.com/stonline/products/literature/an/13588.pdf
>
>   
There is also an example of a bootloader with serial. I wrote a
bootloader that uses the CAN so I can upgrade my software by connecting
to the diagnostic connector in the vehicle. I haven't tested it with GCC
yet but there was an issue with IAR where the program would crash
shortly after
I would jump to the new application. It turned out that IAR was poping
some data off the stack which brought the stack 8 bytes too high.
This is with the lastest IAR. Bringing the stack 8 bytes lower to start
with fixed the problem. All I was doing was like in the appnote, jump
indirectly to
the code using the address in the new vector table.

ST must have two charge pumps so you can run code in a block while
programming the other one. This is very nice, for most processors you must
run out of RAM to do that. The bus is stalled a bit when you write the
flash. In the small application that I have done I use 2 sectors as
EEPROM simulation.

Michel

-- 
Tired of Microsoft's rebootive multitasking?
then it's time to upgrade to Linux.
http://home.comcast.net/~mcatudal

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to