energia / msp430-lg-core

15 stars 12 forks source link

Add FRAM attribute to Energia #31

Closed rei-vilo closed 6 years ago

rei-vilo commented 7 years ago

FRAM is an exclusive technology, but how to leverage it for large arrays?

Please document how to use FRAM as RAM with Energia.

spirilis commented 7 years ago

I had a thread on 43oh for Wolverine FRAM tips & tricks that might still apply...

rei-vilo commented 7 years ago

@spirilis Thank you for the pointer.

I've already saw and used the trick but I want it included and fully supported in Energia.

#define PERSIST __attribute__((section(".text")))
uint8_t DisplayBuffer[LCD_MAXIMUM_Y][LCD_MAXIMUM_X] PERSIST;
spirilis commented 7 years ago

Gotcha... Guess that would just mean Energia including the #define in its Energia.h file? (or something like it, like #define FRAM or #define FRAM_MEMORY as that attribute)

rei-vilo commented 7 years ago

Yes, plus some doc!

...and a more catchy name, like FRAM or FRAM_MEMORY.

#define FRAM __attribute__((section(".text")))

and to use it

uint8_t DisplayBuffer[LCD_MAXIMUM_Y][LCD_MAXIMUM_X] FRAM;
rei-vilo commented 7 years ago

Add FRAM attribute to Energia in the pins_energia.h related to FRAM-based LaunchPads.

#define FRAM __attribute__((section(".text")))
rei-vilo commented 7 years ago

See pull-request #32

StefanSch commented 7 years ago

I am a little bit burned child with short names esp. in defines and that they got reused. May we can find a better / unique name, e.g. STORE_IN_FRAM PLACE_IN_FRAM ALLOCATE_IN_FRAM IN_FRAM ...

rei-vilo commented 7 years ago

PLACE_IN_FRAMseems fine, unless @robertinant has a better suggestion.

rei-vilo commented 7 years ago

See https://github.com/energia/msp430-lg-core/pull/32#issuecomment-275451946

rei-vilo commented 6 years ago

The FRAM is write protected on the MSP430FR2433. See #47.