Chir31 0 Posted January 23, 2014 Share Posted January 23, 2014 the ir library included in energia when compiled gives the following errors : c:/users/chirag/downloads/compressed/energia-0101e0011-windows/energia-0101e0011/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe: IRtest.cpp.elf section `.bss' will not fit in region `ram' c:/users/chirag/downloads/compressed/energia-0101e0011-windows/energia-0101e0011/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe: region `ram' overflowed by 62 bytes collect2: ld returned 1 exit status i have updated energia tried changes in the cpp files as well Still the same error occurs >please help me resolve this error its urgent Quote Link to post Share on other sites
cde 334 Posted January 24, 2014 Share Posted January 24, 2014 First, which msp430 are you targeting? If you have the wrong one selected... And remember, that warning is not just about the IR library, but your code + ir library + other libraries. And it's only overflowing by 62 bytes. Try reusing variables if you can, and turn non-changing variables into consts or hard coded values, so they get added to Data, not Ram. Quote Link to post Share on other sites
roadrunner84 466 Posted January 24, 2014 Share Posted January 24, 2014 The easiest way to run out of RAM is to have large arrays. Do you have arrays defined in your code? An easy way to reduce RAM size (as @@cde already told) is to change non-changing variables (arrays in particular) to constants. For example: char IRcodes[20][6] = {{0x00, 0x00 0x01, 0x00, 0x00, 0x00}, // '0' {0x00, 0x00 0x02, 0x00, 0x00, 0x00}, // '1' {0x00, 0x00 0x03, 0x00, 0x00, 0x00}, // '2' {0x00, 0x00 0x04, 0x00, 0x00, 0x00}, // '3' {0x00, 0x00 0x05, 0x00, 0x00, 0x00}, // '4' {0x00, 0x00 0x06, 0x00, 0x00, 0x00}, // '5' {0x00, 0x00 0x07, 0x00, 0x00, 0x00}, // '6' {0x00, 0x00 0x09, 0x00, 0x00, 0x00}, // '7' {0x00, 0x00 0x0A, 0x00, 0x00, 0x00}, // '8' {0x00, 0x00 0x0B, 0x00, 0x00, 0x00}, // '9' {0x00, 0x00 0x01, 0x00, 0x03, 0x00}, // 'Up' {0x00, 0x00 0x02, 0x00, 0x03, 0x00}, // 'Down' {0x00, 0x00 0x03, 0x00, 0x03, 0x00}, // 'Left' {0x00, 0x00 0x04, 0x00, 0x03, 0x00}, // 'Right' {0x00, 0x00 0x05, 0x00, 0x06, 0x00}, // 'Enter' {0x00, 0x00 0x06, 0x00, 0x06, 0x00}, // 'Back' {0xFF, 0x00 0x07, 0x00, 0x00, 0x00}, // 'Power' {0x00, 0x00 0x09, 0x00, 0x01, 0x00}, // 'Vol+' {0x00, 0x00 0x0A, 0x00, 0x01, 0x00}, // 'Vol-' {0x00, 0x00 0x0B, 0x00, 0x05, 0x00}}; // 'AV' If you have some array like this, it will consume 20*6 = 120 bytes of RAM!, by prefixing it with the const keyword you replace 120 bytes of RAM by 120 bytes of Flash: const char IRcodes[20][6] = {{0x00 /* and here is the other lot of garbage */ }; // 'AV' Note that these codes are totally fictional, it's just to illustrate how you might up ending hogging your RAM. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.