Peter Hedlund

AN2295 - Setting up a section as NVRAM

Discussion created by Peter Hedlund on Nov 12, 2008
Latest reply on Jan 6, 2009 by Pavel Lajsner
I am using a GT60 part with the bootloader from AN2295.  I am trying to protect a section from erasure (1A00-19FF) so i can store MAC address, power levels, contrast and various one time settings.  New code updates through the bootloader can't touch this area.  I have been working on this for a while.

Here are clips on how i setup the bootloader ID_STRING section.


FLS_BEG        EQU        $1080   ; FLASH #0 block start
FLS_END        EQU        $1800   ; FLASH #0 block end
FLS_BEG1    EQU        $182C   ; FLASH #1 block start
FLS_END1    EQU        $19FF   ; FLASH #1 block end
FLS_BEG2    EQU        $2000   ; FLASH #2 block start
FLS_END2    EQU        $FDC0   ; FLASH #2 block end


        DC.B    3                    ; number of Flash blocks 
        DC.W    FLS_BEG     ; START ADDRESS OF FLASH   
        DC.W  FLS_END          ; END ADDRESS OF FLASH   
        DC.W    FLS_BEG1    ; START ADDRESS OF FLASH #2
        DC.W    FLS_END1      ; END ADDRESS OF FLASH     #2
        DC.W    FLS_BEG2    ; START ADDRESS OF FLASH #3
        DC.W    FLS_END2      ; END ADDRESS OF FLASH     #3



I am using a BDM to load the bootloader then manually putting values into 1A00 (31 37 30 31)
I then reset the bdm and re-read 1a00 to verify it exists.
When using the bootloader and the PC serial program I put my application in.  (No references are made
in the hex file to locations 1a00-1fff).
I connect it back to the bdm, reset the chip, and read the memory of the device
1a00 is now FF

I would appreciate any input on how i can create a section of memory that the bootloader can't erase.

Outcomes