Go Down

Topic: How to delete the previous program on the MCU ? (Read 37353 times) previous topic - next topic



I've uploaded a program on the MCU, but i want to upload another totally different program on the MCU, how can i delete the previous one?

Thanks a lot.  :)

Coding Badly

You don't need to delete the previous one.  Uploading over-writes an existing application.


Just upload a new one, it can only hold and run 1 program at once, the old one will be deleted when you upload the new one.


Oct 19, 2009, 03:36 pm Last Edit: Oct 19, 2009, 05:58 pm by max88poon Reason: 1
Problem Solved !
Thanks everyone :)


is there any difference between :

1) bootloaded MCU (upload again serially)
2) upload again by external programmer

do they both erase the previous program?

Coding Badly

Feb 09, 2010, 07:43 pm Last Edit: Feb 09, 2010, 07:45 pm by bcook Reason: 1
1) bootloaded MCU (upload again serially)

Overwrites the previous program.

2) upload again by external programmer

Typically overwrites the previous program.  It depends on how the external programmer is used.


Doesn't uploading via an external programmer also overwrite the bootloader?  This happens when I use Studio4 to upload a program requiring the bootloader to be reloaded before using in the Arduino again.

ken H.

Coding Badly

Doesn't uploading via an external programmer also overwrite the bootloader?

I believe the program can be positioned in memory so as to not overwrite the bootloader.  An external programmer should give very fine control over what gets put where.  But you certainly should try this first!


The thing to remember is that with program memory, you can only change (program) a 1 bit to a 0 bit, but not a 0 bit to a 1 bit. So the act of reloading always involves first 'erasing' program memory so that all bits are set to 1 and then programing the new code into it.

The main difference in loading via bootloader Vs external hardware programmer is that the bootloader code doesn't get erased when the chip is erased because of fuse bits set to 'protect' that portion of program memory.

At least that is how I've come to understand all the various explanations.


Go Up