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

Discussion about SAM7 Series and ARM7TDMI based products.

Moderator: nferre

jandas
Posts: 2
Joined: Fri Apr 24, 2015 11:30 am

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

Fri May 08, 2015 9:19 pm

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)
        ARM

resetVector:
        LDR     pc, =resetHandler        ; Reset

// rest of vectors here....

        SECTION       .cstartup:CODE:NOROOT(2)
        ARM

resetHandler:
         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
                
                END


Thanks for any input on a possible solution

jan
jandas
Posts: 2
Joined: Fri Apr 24, 2015 11:30 am

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

Thu Dec 03, 2015 5:41 pm

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

Jan

Return to “SAM7 ARM7TDMI MCU”

Who is online

Users browsing this forum: No registered users and 2 guests