Jump to content
Sign in to follow this  
tranduythai

Writing to MSP430 Flash

Recommended Posts

I was able to reproduce it with the example Sketch. Something was missed when making this work fort the F5529 and it broke the library for G2553. Will look into it later this week and report back here.

Share this post


Link to post
Share on other sites

Thurns out that MspFlash.h in Energia/hardware/msp430/libraries/MspFlash/ was missing the #include <Energia.h>. Because of the missing header, the mcu header was not picked up and thus the #ifdef's where not selecting the right piece of code.

 

I checked in a fix: https://github.com/energia/Energia/commit/7883fb0dfa6ddd961a1befd4274ecc9785d11a6e

 

If you would like to fix this in your Energia installation then open the file <energia installation direcory>/hardware/msp430/libraries/MspFlash/MspFlash.h

Add #include <Energia.h> just above the line  #ifndef MSP_FLASH_h. It should look something like this:

  Flash segments:     |...SEGMENT-0...|...SEGMENT-1...|...SEGMENT-2...|...SEGMENT-3...|...SEGMENT-4...|...SEGMENT-5...|
  Program output:     |Program code.......|flash[3*512***********************************]|Other data.................|
  Available segments: |-------------------------------|+++++++++++++++|+++++++++++++++|-------------------------------|  
  
  
*/

#include <Energia.h>

#ifndef MSP_FLASH_h
#define MSP_FLASH_h

#define SEGMENT_SIZE 512 // main segment size (smallest flasheable area)
#ifdef __MSP430_HAS_FLASH2__

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×