EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Micro with USB ISP

Started by Alexander Kane March 25, 2011
On 2011-03-25, Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> wrote:
> In comp.arch.embedded, > Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote: >> On 2011-03-25, Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> wrote: >>> >>> Atmel SAM7S can be programmed through USB. Needs a special programming >>> application that can be downloaded from Atmel. >> >> Assuming you are talking about SAM-BA, this requires jumpers setting on >> the board to force the SAM-BA code to be copied into the first couple >> of flash sectors. >> >> According to a comment in a Atmel hosted tutorial, there is a limit on >> the number of times the SAM-BA code can be copied (IIRC, 100 times was >> mentioned). > > Yes, once the device is programmed, you need te restore the bootloader > before you can program it again. For this you need to set the TST pin > on power up. We do this via an extra pin on our programming connector > on one product, via a jumper and a standard USB connector on another > product. > > The datasheet claims 10000 write cycles. With the need to first write > the boot loader, that would imply 5000 programming cycles. More than > enough for most applications. I have never run into a programming > problem, not even on a test board. >
I have now looked further into this. Since I was unsure about the accuracy of what was said in the Atmel tutorial, let me start by apologising to the Atmel tutorial author as he is quite correct; there is indeed a upper limit of 100 times for which you can be sure that the SAM-BA re-flashing process will work. In my defence however, I should point out that the required information to understand the issue is buried in the middle of the errata section of the AT91SAM7S datasheet (at least on the version I am using, which is dated Aug 2010). The issue is not the number of times you can write to a flash sector. As you say, and as I already knew, there is a 10000 write cycle endurance. The issue is that after each restoration of the SAM-BA code to flash, the flash sectors containing the SAM-BA code are locked and there is a endurance limit of 100 cycles for setting the lock bits. From the AT91SAM7S datasheet (doc6175): |40.6.4 Non Volatile Memory Bits (NVM Bits) | |40.6.4.1 NVM Bits: Write/Erase Cycles Number | |The maximum number of write/erase cycles for Non Volatile Memory bits is 100. |This includes Lock Bits (LOCKx), General Purpose NVM bits (GPNVMx) and the |Security Bit. | |This maximum number of write/erase cycles is not applicable to 256 KB Flash |memory, it remains at 10K for the Flash memory. | |Problem Fix/Workaround |None. Depending on how you read the datasheet, clearing the lock bit and then it been set again when SAM-BA is reloaded, may be counted as 2 operations which means that the unlock sectors -> burn own code -> reload SAM-BA sequence may only be guaranteed for 50 cycles. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world

Memfault Beyond the Launch