Go Down

Topic: Programming Flash via IAP in our code (Arduino Due) (Read 3013 times) previous topic - next topic


As we know In-Application-Programming (IAP) is a feature of At91SAM chip in Due board, that means we can program the internal flash within our running code. Since IAP routine should be fetched and executed at ROM memory, then the programming the flash 0 (executing our code) is possible (the instruction fetching is from ROM, not from flash 0 inside of IAP invoking). And IAP, this name, should be meaningful. Otherwise, IAP is nothing different with manually using EEFC controller.

But the fact is that I found it is cannot write anything into flash 0 on Due board from within my code. I also check the security bit in GPNVM (0x2), the flash 0 is not secured, and set to start-up memory. And any commands for writing flash 0 (e.g. write, erase, set or clear the bit of GPNVM) is not possible, the IAP cannot return from calling. Any commands for reading flash 0 is perfectly working (e.g. get desciptor, lock bit, calibration bit and GPNVM bit).

Please note that the official manual of At91SAM (doc11057.pdf) is not correct for IAP address, that is stored at 0x00100008 (NMI vector), rather than 0x00800008. I succussfully tested several flash commands. Only cannot write anything into flash 0.

Anyone met the same problem? Is this related with the signals of pins, such as ERASE, TST etc. or it is related

Coding Badly


Sorry, I found I posted to wrong panel, then I deleted the old one and posted here in the right place.

Coding Badly

...then I deleted the old one...

It's much more likely that a helpful moderator deleted your other post.  But you are welcome to take credit.  It's no skin off my nose.


When I start from Flash 1, then Flash 0 can be written. But before the reset, if you change something in starting Flash, the processor seems crashed.


Hi I used IAP with a sam3s2c and was unable to use it until i put SysTicker(0) or disabling the systicker when using IAP.
I don't know if this can help because i get my due board last week and never try this with the board.


Go Up