platform-timsp430
platform-timsp430 copied to clipboard
128kByte on MSP430F5529
There is a flash memory section at 0x10000 extending the main memory at 0x4400. This memory is not supported by PlatformIO
here is the solution: https://community.platformio.org/t/msp430-use-all-128kb-not-just-47kb/21326 special thanks to @maxgerhardt
can the solution be integrated into PlatformIO?
For anyone reading, here's a short summary of the topic:
- allowing firmwares to use the "high" memory starting at 0x10000 requires
- turning on a compiler option for "large-model addressing, 20-bit pointers" (as opposed to small-model addressing, 16-bits)
- either manually placing variables and/or code in high memory or letting the compiler decide
- The GCC docs say this option is
-mlarge(together with-mcode-region=..,-mdata-region=..), but the compiler version used by PlatformIO (toolchain-timsp430, version 4.6.4, based on https://sourceforge.net/projects/mspgcc/) does not support this flag (gives error messageunrecognized command line option ‘-mlarge’) - I could not get large-model addressing to work with the toolchain PlatformIO uses
- the above linked compiler says it's been superseed by Texas Instrument's GCC version, with this manual, based on GCC 9.3.1
- with a modified platform-timsp430 (which respects the new compiler executable filenames and adds
-mlarge -mcode-region=either -mdata-region=eitherin build and linker flags) and a re-upload of the TI GCC version (https://github.com/maxgerhardt/pio-toolchaintimsp430-new), fully using the full 128 kByte of the microcontroller's flash finally works in a fully automatic way (compiler puts const. variables and functions in higher memory areas as needed, or when explicitly requested) - Example of that is at https://github.com/maxgerhardt/pio-timsp430-new-toolchain-example
- It's unknown to me whether the other SDKs (Arduino etc) like the newer compiler, might be better to stay at the old one for non-baremetal projects