Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 66738

Forum Post: RE: MSP430FR5969: GCC v5.3.0.219 using persistent attribute

$
0
0
[quote user="Peter Philippa"]Could you confirm that a large memory model MUST be used with persistent variables? And/or, do you know a way to use persistent with the small memory model?[/quote]The default msp430fr5969 .ld linker script with CCS 7 was placing the .persistent section in the HIFRAM region: /* This section contains data that is initialised during load but not on application reset. */ .persistent : { . = ALIGN(2); PROVIDE (__persistent_start = .); *(.persistent) . = ALIGN(2); PROVIDE (__persistent_end = .); } > HIFRAM Where the HIFRAM region starts at 0x10000 which is why the large memory model was required to access the persistent variables. By changing the linker script to place the .persistent section on the ROM region, which is FRAM in the lower 64K of address space, allows persistent variables with the small memory model: /* This section contains data that is initialised during load but not on application reset. */ .persistent : { . = ALIGN(2); PROVIDE (__persistent_start = .); *(.persistent) . = ALIGN(2); PROVIDE (__persistent_end = .); } > ROM My updated example project with this change for persistent variables and a small memory model is attached. (Please visit the site to view this file) [I also changed the stack and heap to be allocated in FRAM in the first 64K of address space]

Viewing all articles
Browse latest Browse all 66738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>