Jump to content

Search the Community

Showing results for tags 'elf-gcc'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 1 result

  1. Hi folks! I am working on a project using an MSP430FR5994 through Energia 1.8.11E23 on Linux. As part of that project I would like to persist some variables, i.e. they are set once when the code is flashed and then if updated will retain the updated value upon power cycle, reset, etc. A simple counter example code I am using to test this is shown below. The desired behaviour is that the counter starts at 5 and then continues, and does not reset back to five even if the MSP is power cycled or reset. I have tried the existing undocumented PLACE_IN_FRAM (a macro for __attribute__((section(".text;")))), with both the original and the elf-GCC compilers. This sets the variable, but does not seem to allow it to be altered. I note that the section that this places the variable in, .text, is defined as read only in the linker scripts for both compilers. The original places the .text section it in the rom (rx) region while the elf compiler places it in the text (rx) region. This confuses me, as existing forum threads (e.g. https://forum.43oh.com/topic/13099-mspflash-do-not-work-on-msp4305969/?do=findComment&comment=80848) seemed to imply that this would create a persitent, read/writeable variable. The comment accompanying the macro in pins_energia.h also implies the same. I then tried using __attribute__((persistent)) with the new elf-GCC compiler during my variable declaraion. Upon compile, this gave the following warning "variable 'FRAM_count' was declared persistent and should be explicitly initialized [-Wattributes]". I was unable to resolve this, despite (by my understanding) explictly declaring the variable in a variety of ways. Unlike the previous approach, this did allow the variable to be written, with the count incrementing. However, upon power cycling the count reset to five and did not persist the variable. The code I used to test the above (and other) approaches is shown below: //uint8_t FRAM_count PLACE_IN_FRAM = 5; // Doesn't increment, seems to be read only after init unsigned long int FRAM_count __attribute__((persistent)) = { 5 }; // Doesn't persist, // Gives compiler warning: variable 'FRAM_count' was declared persistent and should be explicitly initialized [-Wattributes] //uint8_t FRAM_count __attribute__((section(".persistent"))) = { 5 }; // Doesn't increment void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial.print("Initial value of FRAM_count is: "); Serial.println(FRAM_count, DEC); Serial.println("Setup Completed"); } void loop() { // put your main code here, to run repeatedly: Serial.println(FRAM_count, DEC); FRAM_count++; delay(1000); } Any suggestions or support that those of you more familiar with the Energia/MSP framework could give would be greatly appreciated! I have spent a few days on this now and have checked these and other forums but have thus far had no success.
×
×
  • Create New...