Page 1 of 1

AT91SAM7L128: Did I Brick it? can it be saved?

Posted: Fri May 08, 2015 9:19 pm
by jandas
While testing out the power states, i wrote this little piece of code to test it.
It worked, but the problem now is that the erase function can't erase the flash anymore. (it needs 200ms of active high signal, but my code switches of the core in a few lines of code)
what are my options to gain access again?

        SECTION .vectors:CODE:NOROOT(2)

        LDR     pc, =resetHandler        ; Reset

// rest of vectors here....

        SECTION       .cstartup:CODE:NOROOT(2)

         LDR     pc, =label

/*      peripheral reset        */
label:        LDR     r0, =AT91C_RSTC_RCR
                LDR     r1, =AT91C_RSTC_PERRST + 0xA5000000
                STR     r1, [r0]
/*      disable watchdog      */
                LDR     r0, =AT91C_WDTC_WDMR
                LDR     r1, =0x3FFF8FFF
                STR     r1, [r0]
/* shutdown */
return:      LDR     r0, =AT91C_SUPC_CR
                LDR     r1, =0xA5000001
                STR     r1, [r0]

/* never should end up here */
restart:     LDR     r0, =resetHandler
                BX      r0

Thanks for any input on a possible solution


Re: AT91SAM7L128: Did I Brick it? can it be saved?

Posted: Thu Dec 03, 2015 5:41 pm
by jandas
If anybody wants to know, I found the solution hidden deep in the technical data sheet.

Page 158:
In order to erase the Flash, the user must perform the following:
• Power-off the chip
• Power-on the chip with TST = 0 and FWUP =0
• Assert Erase during a period of more than 220 ms
• Power-off the chip

it was so easy