This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I have setup a custom linker section in SRAM bank1 (of 0..7) and hope that this memory will persist through a system reset using the driverlib call to ResetCtl_initiateHardResetWithSource(). Will memory be retained, assuming I have setup SRAM bank1 for retention using the following.
SYSCTL->SRAM_BANKEN = SYSCTL_SRAM_BANKEN_BNK1_EN; // Enable only SRAM banks 0 and 1
.
.
ResetCtl_initiateHardResetWithSource(RESET_SRC_2)
Should memory be retained through such a hard reset?
Thanks,
Aaron
The contents of a SRAM bank are lost only when the bank is powered off, which can happen only when it is explicitly disabled in the BANKEN register, when it is explicitly configured to be powered off during LPM3/4 in the BANKRET register, or if the entire chip loses power.
Any other actions will retain SRAM.
(And the C startup code will re-initialize everything in the .data and .bss sections.)
To Robert's point: www.ti.com/.../slau132m.pdf . SLAU132m page 107.
Regards,
Chris
Thanks guys. Those commands look useful, but I have already setup my code to put my array, ap_data_buf[], into a seperate section.
Do you see anything suspicious here?
Thanks,
Aaron
--retain=flashMailbox
MEMORY
{
MAIN (RX) : origin = 0x00000000, length = 0x00040000
INFO (RX) : origin = 0x00200000, length = 0x00002000 /* Reduced to include only bank 0 (of 0-7) allocation */
SRAM_CODE (RWX): origin = 0x01000000, length = 0x00004000 /* Was: SRAM_CODE (RWX): origin = 0x01000000, length = 0x00010000 */
SRAM_DATA (RW) : origin = 0x20000000, length = 0x00002000 /* Was: SRAM_DATA (RW) : origin = 0x20000000, length = 0x00010000 */
SRAM_AP_DATA (RX) : origin = 0x20002000, length = 0x00002000 /* Added for bank 1 (of 0-7) allocation */
}
SECTIONS
{
.intvecs: > 0x00000000
.text : > MAIN
.const : > MAIN
.cinit : > MAIN
.pinit : > MAIN
.init_array : > MAIN
.flashMailbox : > 0x00200000
.vtable : > 0x20000000
.data : > SRAM_DATA
.bss : > SRAM_DATA
.sysmem : > SRAM_DATA
.stack : > SRAM_DATA (HIGH)
.ap_data : > SRAM_AP_DATA /* Added for bank 1 (of 0-7) allocation */
}
/* Symbolic definition of the WDTCTL register for RTS */
WDTCTL_SYM = 0x4000480C;
Hi guys,
I just figured it out, I think. If I add "type=NOLOAD" to the last line of the SECTIONS directive, then the .ap_data section is not cleared during a reset.
.ap_data : type=NOLOAD > SRAM_AP_DATA /* Added for bank 1 (of 0-7) allocation */
-Aaron
========================================================================
FYI, the complete file:
MEMORY
{
MAIN (RX) : origin = 0x00000000, length = 0x00040000
INFO (RX) : origin = 0x00200000, length = 0x00002000 /* Reduced to include only bank 0 (of 0-7) allocation */
SRAM_CODE (RWX): origin = 0x01000000, length = 0x00004000 /* Was: SRAM_CODE (RWX): origin = 0x01000000, length = 0x00010000 */
SRAM_DATA (RW) : origin = 0x20000000, length = 0x00002000 /* Was: SRAM_DATA (RW) : origin = 0x20000000, length = 0x00010000 */
SRAM_AP_DATA (RW) : origin = 0x20002000, length = 0x00002000 /* Added for bank 1 (of 0-7) allocation */
}
SECTIONS
{
.intvecs: > 0x00000000
.text : > MAIN
.const : > MAIN
.cinit : > MAIN
.pinit : > MAIN
.init_array : > MAIN
.flashMailbox : > 0x00200000
.vtable : > 0x20000000
.data : > SRAM_DATA
.bss : > SRAM_DATA
.sysmem : > SRAM_DATA
.stack : > SRAM_DATA (HIGH)
.ap_data : type=NOLOAD > SRAM_AP_DATA /* Added for bank 1 (of 0-7) allocation */
}
/* Symbolic definition of the WDTCTL register for RTS */
WDTCTL_SYM = 0x4000480C;
**Attention** This is a public forum