cancel
Showing results for 
Search instead for 
Did you mean: 

Changing programmed code while code is running

mkrason
Associate II
Posted on August 05, 2008 at 12:09

Changing programmed code while code is running

3 REPLIES 3
mkrason
Associate II
Posted on May 17, 2011 at 09:54

Hello,

I'm currently working on a project where I need to update the code on 2 processors, 1 atmega324p and 1 str912. I was able to update code on the atmega324p using a boot loader, but from what I've read the str912 does not have a boot loader or the option for one.

My new plan is to add code to the atmega324p to update the code on the st. The problem arises that I need to be able to connect with the ST's currently running code, and send it data to over write the code that is running. I think I can accomplish this by putting a receiving function in high memory of the ST that will not be touched.

My question then becomes is it possible to overwrite the program memory of an st processor while it is running code as long as I don't overwrite the overwriting function?

If anyone has any suggestions that are better than my current plan or even suggestions for helping my plan to work, I would greatly appreciate it.

~Mike

sjo
Associate II
Posted on May 17, 2011 at 09:54

Mike,

Have a look at this forum for examples or the str9 app notes - link below.

True the str9 does not have a system bootloader included, but adding your own is not a problem.

http://www.st.com/mcu/familiesdocs-101.html

Cheers

sjo

mkrason
Associate II
Posted on May 17, 2011 at 09:54

Thank you for pointing me there. I think I can make that work but instead of doing a true-to-life bootloader, I think I'm going to go with the ST jumping to the ''bootloader'' in bank 1, while still maintaining bank 0 as the boot bank.

I think it has potential to work. At least it looks like it will on my white board.