Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

[![Build Status](https://github.com/platformio/platform-timsp430/workflows/Examples/badge.svg)](https://github.com/platformio/platform-timsp430/actions)

NOTE: the default toolchain for MSP430 platformIO is still on GCC version 4.6.3, which means C++0x. This github fork uses the radically more modern GCC compiler: https://github.com/maxgerhardt/pio-toolchaintimsp430-new.git
(i'm not sure, but i believe all/most-of-what maxgethardt did was just add a package.json file to the opensource GCC toolchain from TI: https://www.ti.com/tool/MSP430-GCC-OPENSOURCE ).
I have almost no idea what i'm doing when it comes to compilers, so when i got a few linker errors, i just googled and found '-fno-rtti' as an extra argument to fix things. It does at least compile for me now, actual hardware testing still TBD.

MSP430 microcontrollers (MCUs) from Texas Instruments (TI) are 16-bit, RISC-based, mixed-signal processors designed for ultra-low power. These MCUs offer the lowest power consumption and the perfect mix of integrated peripherals for thousands of applications.

* [Home](https://registry.platformio.org/platforms/platformio/timsp430) (home page in the PlatformIO Registry)
Expand All @@ -18,6 +22,8 @@ MSP430 microcontrollers (MCUs) from Texas Instruments (TI) are 16-bit, RISC-base
[env:stable]
platform = timsp430
board = ...
platform_packages = toolchain-timsp430@https://github.com/maxgerhardt/pio-toolchaintimsp430-new.git ; uses a newer GCC version from TI (old toolchain was C++0x)
build_flags = '-fno-rtti' ; not sure what it does or why it helps, but it does. google: https://en.wikipedia.org/wiki/Run-time_type_information
...
```

Expand All @@ -27,6 +33,8 @@ board = ...
[env:development]
platform = https://github.com/platformio/platform-timsp430.git
board = ...
platform_packages = toolchain-timsp430@https://github.com/maxgerhardt/pio-toolchaintimsp430-new.git ; uses a newer GCC version from TI (old toolchain was C++0x)
build_flags = '-fno-rtti' ; not sure what it does or why it helps, but it does. google: https://en.wikipedia.org/wiki/Run-time_type_information
...
```

Expand Down
2 changes: 1 addition & 1 deletion builder/frameworks/energia.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")),
join(variants_dir, board.get("build.variant")),
join(platform.get_package_dir(
"toolchain-timsp430"), "msp430", "include")
"toolchain-timsp430"), "msp430-elf", "include")
],

LIBSOURCE_DIRS=[
Expand Down
24 changes: 15 additions & 9 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
env = DefaultEnvironment()

env.Replace(
AR="msp430-ar",
AS="msp430-as",
CC="msp430-gcc",
CXX="msp430-g++",
GDB="msp430-gdb",
OBJCOPY="msp430-objcopy",
RANLIB="msp430-ranlib",
SIZETOOL="msp430-size",
AR="msp430-elf-ar",
AS="msp430-elf-as",
CC="msp430-elf-gcc",
CXX="msp430-elf-g++",
GDB="msp430-elf-gdb",
OBJCOPY="msp430-elf-objcopy",
RANLIB="msp430-elf-ranlib",
SIZETOOL="msp430-elf-size",
LINK="$CC",

ARFLAGS=["rc"],
Expand Down Expand Up @@ -64,6 +64,9 @@
"-Os",
"-ffunction-sections", # place each function in its own section
"-fdata-sections",
"-mlarge", # use large memory-model automatically.
"-mcode-region=either", # https://github.com/maxgerhardt/platform-timsp430
"-mdata-region=either" # github user maxgerhardt added this fix
],

CXXFLAGS=[
Expand All @@ -77,7 +80,10 @@

LINKFLAGS=machine_flags + [
"-Os",
"-Wl,-gc-sections,-u,main"
"-Wl,-gc-sections,-u,main",
"-mlarge", # use large memory-model also at the linker stage
"-mcode-region=either", # https://github.com/maxgerhardt/platform-timsp430
"-mdata-region=either" # github user maxgerhardt added this fix
],

LIBS=["m"],
Expand Down
2 changes: 1 addition & 1 deletion platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/platformio/platform-timsp430.git"
"url": "https://github.com/thijses/platform-timsp430-newGCC.git"
},
"version": "2.4.0",
"frameworks": {
Expand Down