platform-timsp430 icon indicating copy to clipboard operation
platform-timsp430 copied to clipboard

made ready for newer GCC compiler

Open thijses opened this issue 3 years ago • 2 comments

a while back, a user by the name of @maxgerhardt made a fork for using a newer toolchain (provided by TI's website). https://github.com/maxgerhardt/pio-toolchaintimsp430-new I know next-to-nothing about compilers, but it seems to make that toolchain work you only need to specify it in platformio.ini and fix 2 files in this repository. The official platformIO MSP430 toolchain uses GCC4.6.3, which means C++0x. I happen to strongly prefer C++11 (for the record, i did not know there were significant differences in C++ versions over recent years). Could someone please explain to me why TI's opensource (modern) toolchain is not used? Sincerely, Thijs

thijses avatar Oct 21 '22 13:10 thijses

For completeness: The new toolchain version was indeed meant to be used with a modified platform (here), but I also provided that with https://github.com/maxgerhardt/pio-timsp430-new-toolchain-example. It contains critical

    -mlarge
    -mcode-region=either
    -mdata-region=either

compiler switches with which the entire flash and ram of a MCU can be used, as discussed in https://community.platformio.org/t/msp430-use-all-128kb-not-just-47kb/21326. I don't see these additions in this PR.

maxgerhardt avatar Oct 21 '22 13:10 maxgerhardt

you are absolutely right, sorry for not mentioning it. I added that as well. It spits out a lot more compiler warnings now, but they seem harmless. for example:

"c:/users/thijs/.platformio/packages/toolchain-timsp430/bin/../lib/gcc/msp430-elf/9.3.1/../../../../msp430-elf/bin/ld.exe: warning: no section named .upper.text in linker script, required to shuffle .either.text.memset between regions"

I'm using the MSP430FR2355, which only has 32KB anyways, but it's good to have if this fork actually gets merger and whatnot. Thank you (again), @maxgerhardt

thijses avatar Oct 21 '22 15:10 thijses