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

128kByte on MSP430F5529 #21

Open
WolfgangAipperspach opened this issue May 10, 2021 · 3 comments
Open

128kByte on MSP430F5529 #21

WolfgangAipperspach opened this issue May 10, 2021 · 3 comments

Comments

@WolfgangAipperspach
Copy link

WolfgangAipperspach commented May 10, 2021

There is a flash memory section at 0x10000 extending the main memory at 0x4400. This memory is not supported by PlatformIO

@WolfgangAipperspach
Copy link
Author

WolfgangAipperspach commented May 17, 2021

@WolfgangAipperspach
Copy link
Author

can the solution be integrated into PlatformIO?

@maxgerhardt
Copy link

maxgerhardt commented May 17, 2021

For anyone reading, here's a short summary of the topic:

  • allowing firmwares to use the "high" memory starting at 0x10000 requires
    1. turning on a compiler option for "large-model addressing, 20-bit pointers" (as opposed to small-model addressing, 16-bits)
    2. 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 message unrecognized 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=either in 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

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

No branches or pull requests

2 participants