Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLACE_IN_FRAM Error Message #70

Open
rei-vilo opened this issue Oct 3, 2018 · 6 comments
Open

PLACE_IN_FRAM Error Message #70

rei-vilo opened this issue Oct 3, 2018 · 6 comments

Comments

@rei-vilo
Copy link
Member

rei-vilo commented Oct 3, 2018

Using PLACE_IN_FRAM against the MSP430FR5994 LaunchPad throws this error message:

/var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T//ccaCFwLd.s: Assembler messages:
/var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T//ccEVAsRJ.s:218: Warning: ignoring changed section attributes for .text

I'm using the latest release of msp430-lg-core/variants/MSP-EXP430FR5994LP/pins_energia.h

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

How to understand the error message and how to fix it?

See #49 and #31.

@rei-vilo
Copy link
Member Author

rei-vilo commented Oct 4, 2018

Same with CCS.

The code

uint8_t frameNew[4096] __attribute__((section(".text")));

returns the message

Description	Resource	Path	Location	Type
ignoring changed section attributes for .text	.ccsproject	/FRAM_EPD_Controller	line 321, external location: C:\Users\ReiVilo\AppData\Local\Temp\ccC7kneT.s	C/C++ Problem

It is not clear whether the message is a warning or an error.

@StefanSch
Copy link
Contributor

StefanSch commented Oct 8, 2018

Just made a quick test with below code but could not see an issue.
Can you check with this again?

// most launchpads have a red LED
#define LED RED_LED

int i PLACE_IN_FRAM ;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(LED, OUTPUT);     
  i = 0;
}


// the loop routine runs over and over again forever:
void loop() {
  if (i++ == 10)
  { 
    i=0;
  
    digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(1000);               // wait for a second
    digitalWrite(LED, LOW);    // turn the LED off by making the voltage LOW
    delay(1000);               // wait for a second
  }
}

@rei-vilo
Copy link
Member Author

rei-vilo commented Oct 8, 2018

The above sketch still outputs the warning / error

C:\Users\ReiVilo\AppData\Local\Temp\cc6j4iC7.s: Assembler messages:
C:\Users\ReiVilo\AppData\Local\Temp\cc6j4iC7.s:57: Warning: ignoring changed section attributes for .text

Configuration

  • Energia 1.6.8E18
  • MSP430 boards package 1.0.5
  • Windows 10 1809

@StefanSch
Copy link
Contributor

just commited a fix and opened a pull request

@rei-vilo
Copy link
Member Author

rei-vilo commented Oct 15, 2018

The FRAM space seems to be pretty limited, to 4096 bytes.

Having a look at msp430-gcc/4.6.4/msp430/lib/ldscripts/msp430fr5994/memory.x, PLACE_IN_FRAM seems to use leaRAM instead of larger rom or far_rom.

MEMORY {
  sfr              : ORIGIN = 0x0000, LENGTH = 0x0010 /* END=0x0010, size 16 */
  leaRAM (wx)      : ORIGIN = 0x2c00, LENGTH = 0x1000 /* END=0x3c00, size 4K */
  tinyram (wx)     : ORIGIN = 0x0006, LENGTH = 0x001a /* END=0x0020, size 26 */
  peripheral_8bit  : ORIGIN = 0x0010, LENGTH = 0x00f0 /* END=0x0100, size 240 */
  peripheral_16bit : ORIGIN = 0x0100, LENGTH = 0x0100 /* END=0x0200, size 256 */
  bsl              : ORIGIN = 0x1000, LENGTH = 0x0800 /* END=0x1800, size 2K as 4 512-byte segments */
  infomem          : ORIGIN = 0x1800, LENGTH = 0x0200 /* END=0x1a00, size 512 as 4 128-byte segments */
  infod            : ORIGIN = 0x1800, LENGTH = 0x0080 /* END=0x1880, size 128 */
  infoc            : ORIGIN = 0x1880, LENGTH = 0x0080 /* END=0x1900, size 128 */
  infob            : ORIGIN = 0x1900, LENGTH = 0x0080 /* END=0x1980, size 128 */
  infoa            : ORIGIN = 0x1980, LENGTH = 0x0080 /* END=0x1a00, size 128 */
  ram (wx)         : ORIGIN = 0x1c00, LENGTH = 0x1000 /* END=0x2c00, size 4K */
  rom (rx)         : ORIGIN = 0x4400, LENGTH = 0xbb80 /* END=0xff80, size 48000 */
  signature        : ORIGIN = 0xff80, LENGTH = 0x0010 /* END=0xff90, size 16 as 1 16-byte segments */
  vectors          : ORIGIN = 0xff80, LENGTH = 0x0080 /* END=0x10000, size 128 as 64 2-byte segments */
  far_rom          : ORIGIN = 0x00010000, LENGTH = 0x00034000 /* END=0x00044000, size 208K */
  /* Remaining banks are absent */
  ram2 (wx)        : ORIGIN = 0x0000, LENGTH = 0x0000
  ram_mirror (wx)  : ORIGIN = 0x0000, LENGTH = 0x0000
  usbram (wx)      : ORIGIN = 0x0000, LENGTH = 0x0000
}

So the question remains: how to get a large array in FRAM?

  • Error message if #define frameSize (uint16_t)(4097)
Linking everything together...
/Users/ReiVilo/Library/Energia15/packages/energia/tools/msp430-gcc/4.6.6/bin/msp430-gcc -w -Os -fno-rtti -fno-exceptions -Wl,--gc-sections,-u,main -mmcu=msp430fr5994 -L/Users/ReiVilo/Library/Energia15/packages/energia/tools/msp430-gcc/4.6.6/include -o /var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T/arduino_build_900645/sketch_oct15a.ino.elf /var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T/arduino_build_900645/sketch/sketch_oct15a.ino.cpp.o /var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T/arduino_build_900645/../arduino_cache_280907/core/core_energia_msp430_MSP-EXP430FR5994LP_d239225dee65edc9c234f02a76edfb50.a -L/var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T/arduino_build_900645 -lm
/Users/ReiVilo/Library/Energia15/packages/energia/tools/msp430-gcc/4.6.6/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: /var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T/arduino_build_900645/sketch_oct15a.ino.elf section `.text#' will not fit in region `leaRAM'
/Users/ReiVilo/Library/Energia15/packages/energia/tools/msp430-gcc/4.6.6/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: section .text loaded at [0000000000004400,00000000000045eb] overlaps section .text# loaded at [0000000000002c00,0000000000004bff]
/Users/ReiVilo/Library/Energia15/packages/energia/tools/msp430-gcc/4.6.6/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: region `leaRAM' overflowed by 1 bytes
collect2: ld returned 1 exit status
exit status 1
Error compiling for board MSP-EXP430FR5994LP.
  • Code
#define frameSize (uint16_t)(4097)
uint8_t frameNew[frameSize] __attribute__((section(".text#")));

void setup() {
    memset(frameNew, 0x00, frameSize);
}

void loop() {
 
}

@rei-vilo
Copy link
Member Author

See https://github.com/energia/msp430-lg-core/blob/new_compiler/extras/readme.txt for support of MSP-GCC 7.3.1.24 with large arrays in FRAM.

Tested successfully on macOS with minor adaptations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants