Fox Red Labs / Builds / Tools and languages
Run Arduino sketches on a TI chip
Arduino's Blink and AnalogReadSerial build unchanged through the Zephyr-based Arduino core and run on the CC2340R5 and the MSPM0 G3519. PlatformIO was not run.
HardNo wiring
The CC2340R5 this build runs on, drawn from its user guide. Drag to turn it.
The MSPM0 G3519 this build runs on, drawn from its user guide. Drag to turn it.
What you need
LP-EM-CC2340R5On Linux or WindowsThe steps were recorded on a Mac; paths and port names in them are the Mac ones.
macOS (recorded)
- TI's tools
/Applications/ti, or~/ti- Serial port
/dev/cu.usbmodem<serial>1- Probe access
- nothing to do
Linux
- TI's tools
~/ti(also searched:/opt/ti)- Serial port
/dev/ttyACM0(by name:/dev/serial/by-id/*<serial>*-if00*)- Probe access
- one udev rule, how
Windows
- TI's tools
C:\ti(also searched:%USERPROFILE%\ti)- Serial port
COM<n>, named "XDS110 Class Application/User UART" in Device Manager- Probe access
- the XDS110 USB driver from UniFlash or CCStudio
Your probe's serial on any system: python3 tools/frl/frl.py detect. Not run on a board under Linux or Windows. Everything else that differs: the full table.
LP-MSPM0G3519On Linux or WindowsThe steps were recorded on a Mac; paths and port names in them are the Mac ones.
macOS (recorded)
- TI's tools
/Applications/ti, or~/ti- Serial port
/dev/cu.usbmodem<serial>1- Probe access
- nothing to do
Linux
- TI's tools
~/ti(also searched:/opt/ti)- Serial port
/dev/ttyACM0(by name:/dev/serial/by-id/*<serial>*-if00*)- Probe access
- one udev rule, how
Windows
- TI's tools
C:\ti(also searched:%USERPROFILE%\ti)- Serial port
COM<n>, named "XDS110 Class Application/User UART" in Device Manager- Probe access
- the XDS110 USB driver from UniFlash or CCStudio
Your probe's serial on any system: python3 tools/frl/frl.py detect. Not run on a board under Linux or Windows. Everything else that differs: the full table.
Steps
Set up your computer once: 1 step. Done already? Start at step 2.
Install the Zephyr 4.4.2 workspace, the compiler and the west environment with the script that builds Zephyr's blinky; NO_FLASH=1 stops it after the build so it does not touch a board.TERMINAL
Replace <repository folder> before you run this.
NO_FLASH=1 <repository folder>/cc2340r5/zephyr/setup-intel-mac.shYou should see: The script ends with
NO_FLASH set. Built, not flashed.
Check out the Arduino core at the pinned commit and put Arduino's API library beside it.TERMINAL
The last line is a six-line patch that makes
Serialwait for room instead of dropping bytes at 9600 baud; skip it if you only run Blink.Replace <ArduinoCore-zephyr folder> and <repository folder> before you run this.
git init <ArduinoCore-zephyr folder> && cd <ArduinoCore-zephyr folder> && git remote add origin https://github.com/zephyrproject-rtos/ArduinoCore-zephyr.git git fetch --depth 1 origin af5b8610f9be6d7b962e2ba6dd8e6859697c44ff && git checkout FETCH_HEAD mkdir -p zephyr/blobs && cp -R <repository folder>/third-party/arduino/ArduinoCore-API/api zephyr/blobs/ArduinoCore-API git apply <repository folder>/portability/arduino/zephyr/serial-blocking-write.patch # CC2340R5 onlyYou should see: The core folder holds
zephyr/blobs/ArduinoCore-API/api, andgit statusshows the patched file.Build Blink.TERMINAL
The script takes the variables the README lists (
AMfor the core,ZP,TCandVENVfor the workspace) and stops with one line naming a missing path. Neither Zephyr tree nor the sketch is edited.Replace <repository folder> before you run this.
<repository folder>/portability/arduino/zephyr/build-cc2340r5.sh BlinkYou should see: About 80 s later the build folder holds
zephyr/zephyr.hexandzephyr/zephyr_crc32.hex. Blink is about 32 kB of flash and 6.1 kB of RAM.Clip the LP-XDS110ET onto the board and plug it into your computer with its USB-C cable; the board has no USB port of its own (cc2340r5/AGENTS.md).BENCH
Read the probe serial with
/Applications/ti/ccs2101/ccs/ccs_base/common/uscif/xds110/xdsdfu -e.You should see: The probe shows up as an XDS110 and
xdsdfu -eprints its serial number.Back up first: read the main flash and the CCFG with DSLite before the first write; the exact backup and restore commands are in ports/micropython/zephyr-cc2340r5/README.md, Flash and run.TERMINAL
Run it from the repository folder; the DSLite path in the first line is the Mac form. Then flash the
_crc32image, which carries the boot checksums, and reset the board.Replace <UniFlash folder>, <build folder> and <your-probe-serial> before you run this.
DSLITE=<UniFlash folder>/deskdb/content/TICloudAgent/osx/ccs_base/DebugServer/bin/DSLite $DSLITE flash -c cc2340r5/CC2340R5.ccxml -e -f -u <build folder>/zephyr/zephyr_crc32.hex xds110reset -s <your-probe-serial> # xds110reset sits beside xdsdfuYou should see: DSLite writes and verifies the image, then the reset starts Blink. The green LED pin (DIO15) is the one Blink toggles; the check read its output register through the probe and saw bit 15 clear, then set. The LED itself was not watched.
To see serial output, build AnalogReadSerial the same way (build-cc2340r5.sh AnalogReadSerial), flash it as in step 5, and open the probe's serial port at 9600 baud in any serial terminal.TERMINAL
Replace <repository folder> and <your-probe-serial> before you run this.
<repository folder>/portability/arduino/zephyr/build-cc2340r5.sh AnalogReadSerial # serial port: /dev/cu.usbmodem<your-probe-serial>1 at 9600 baudYou should see: A line of a number per read: 10-bit values between about 295 and 400 on a floating A0. The first line may be garbled; ignore it.
Read the serial output
Open the board's USB serial port in any terminal program at 9600 baud. The lines the program prints appear there.
Set up the Zephyr main workspace, its modules and the compiler as portability/zephyr-mspm0/README.md describes under Set up once, and check out the Arduino core as in the CC2340R5 version, step 2 (skip the Serial patch).TERMINAL
You should see: The workspace folder and the core folder exist.
Build Blink for the LP-MSPM0G3519 on Zephyr main.TERMINAL
Neither the Zephyr tree nor the sketch is edited.
Replace <repository folder> before you run this.
<repository folder>/portability/arduino/zephyr/build-g3519.sh BlinkYou should see: About 80 s later the build folder holds
zephyr/zephyr.hex; Blink is 22.8 kB of flash and 4.8 kB of RAM.Make the connection file for your probe: copy mspm0g3519/MSPM0G3519_MG000001.ccxml to mspm0g3519/MSPM0G3519_<your-probe-serial>.ccxml and change MG000001 to your probe's serial in both places inside it.TERMINAL
Then flash the image.
PROBEis your probe's serial andZWis the Zephyr workspace from step 1. The script pulses nRST, flashes from a.binpadded to a multiple of 8 bytes, and pulses nRST again; without the second pulse the image stops in the NMI handler. Run it from the repository folder.Replace <your-probe-serial>, <Zephyr workspace>, <xPack OpenOCD folder>, <repository folder> and <build folder> before you run this.
export PROBE=<your-probe-serial> export ZW=<Zephyr workspace> export OCD=<xPack OpenOCD folder> <repository folder>/portability/zephyr-mspm0/flash.sh <build folder>/zephyr/zephyr.hexYou should see: The script reports the flash and the board restarts into Blink.
Check that the Blink pin toggles.TERMINAL
Replace <repository folder> and <your-probe-serial> before you run this.
python3 <repository folder>/tools/check/blink.py --board mspm0g3519 --probe <your-probe-serial>You should see: The checker prints PASS while PB27 toggles.
To see serial output, build AnalogReadSerial the same way, flash it as in step 3, and open the probe's serial port at 9600 baud.TERMINAL
Replace <repository folder> and <your-probe-serial> before you run this.
<repository folder>/portability/arduino/zephyr/build-g3519.sh AnalogReadSerial # serial port: /dev/cu.usbmodem<your-probe-serial>1 at 9600 baudYou should see: A number per read: 10-bit values between about 72 and 400 on a floating A0 (PA25).
Read the serial output
Open the board's USB serial port in any terminal program at 9600 baud. The lines the program prints appear there.
What to build next
If something goes wrong
| A download fails | Rerun the script; it keeps what it already fetched. |
| The build later cannot find Arduino's API headers | zephyr/blobs/ArduinoCore-API/api is missing. |
| It stops naming a variable | Set it: AM is the core folder of step 2. |
xdsdfu -e lists nothing | Check the clip-on connection and use a data cable. |
| The flash fails | Close CCStudio or any other program that holds the probe, and rerun it. |
More troubleshooting
| Bytes are dropped or the numbers run together | The Serial patch of step 2 is missing. |
Every fix for this board: the FAQ.
| A path is missing | The script stops with one line naming the variable (AM, ZM, HALTI, CMSIS6); set it. |
| It stops naming a variable | Set it; AM is the core folder of step 1. |
| The board stops in the NMI handler | Pulse nRST again (flash.sh does it after the flash). |
| It prints FAIL while PB27 toggles | It read the output-enable bit right after its own reset, inside the 0.4 s start-up; read the bit over DSLite without a reset. |
| The port stays silent | Pulse nRST: the G3519 image only starts after one (flash.sh does it after the flash). |
Every fix for this board: the FAQ.
Get the code
Ran here, with steps. Blink and AnalogReadSerial run unchanged through the Zephyr-based Arduino core; attachInterrupt, analogWrite, SPI and Wire also run How it ran on this board.
Start it
Paste this in a terminal. It hands off to an AI assistant with this board's notes.
git clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs
./start.sh cc2340r5 arduino --assistant claudegit clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs
py start.py cc2340r5 arduino --assistant claudeNot Claude Code? Copy this prompt instead.
Only the code for this board
git clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git
cd fox-red-labs
git sparse-checkout set portability/arduino third-party/arduino cc2340r5/zephyr ports/micropython/zephyr-cc2340r5Everything for this build
Adds the board's own folder (its notebook, fixes and assistant notes) and the shared code this build draws on. Notes for an AI assistant: cc2340r5/AGENTS.md.
git clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git
cd fox-red-labs
git sparse-checkout set portability/arduino third-party/arduino ports/micropython/zephyr-cc2340r5 cc2340r5Ran here, with steps. Arduino's stock Blink and AnalogReadSerial run unchanged through the Zephyr-based core; Wire reads the touch controller 100 of 100 times and SPI loopback returns 256 of 256 bytes. How it ran on this board.
Start it
Paste this in a terminal. It hands off to an AI assistant with this board's notes.
git clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs
./start.sh mspm0g3519 arduino --assistant claudegit clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs
py start.py mspm0g3519 arduino --assistant claudeNot Claude Code? Copy this prompt instead.
Only the code for this board
git clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git
cd fox-red-labs
git sparse-checkout set portability/arduino portability/zephyr-mspm0 third-party/arduino tools mspm0g3519Everything for this build
Adds the board's own folder (its notebook, fixes and assistant notes) and the shared code this build draws on. Notes for an AI assistant: mspm0g3519/AGENTS.md.
git clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git
cd fox-red-labs
git sparse-checkout set portability/arduino portability/zephyr-mspm0 third-party/arduino tools mspm0g3519 cc2340r5/zephyr ports/micropython/zephyr-cc2340r5Ran in part. Four Arduino programs built and two ran on a 649-line Arduino API layer written here; Arduino_GFX drew on an ST7796S screen. How it ran on this board.
Start it
Paste this in a terminal. It hands off to an AI assistant with this board's notes. There are no written steps for this board yet.
git clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs
./start.sh mspm0g3507 arduino --assistant claudegit clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs
py start.py mspm0g3507 arduino --assistant claudeNot Claude Code? Copy this prompt instead.
Only the code for this board
git clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git
cd fox-red-labs
git sparse-checkout set mspm0g3507/zephyr portability/boosterpacks/zephyr ports/arduino-core-ti/logs ports/arduino-core-ti/tests/energia-sweep portability/arduinoEverything for this build
Adds the board's own folder (its notebook, fixes and assistant notes) and the shared code this build draws on. Notes for an AI assistant: mspm0g3507/AGENTS.md.
git clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git
cd fox-red-labs
git sparse-checkout set portability/boosterpacks/zephyr ports/arduino-core-ti/logs ports/arduino-core-ti/tests/energia-sweep portability/arduino mspm0g3507 third-party/arduino ports/micropython/zephyr-cc2340r5Ran here. Blink runs unchanged on the lab's Arduino core layer (2.8 kB of flash), and a board-check sketch prints millis and micros once a second on the console; analogRead is not in the layer yet, so AnalogReadSerial does not compile How it ran on this board.
Start it
Paste this in a terminal. It hands off to an AI assistant with this board's notes. There are no written steps for this board yet.
git clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs
./start.sh mspm0g5187 arduino --assistant claudegit clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs
py start.py mspm0g5187 arduino --assistant claudeNot Claude Code? Copy this prompt instead.
Only the code for this board
git clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git
cd fox-red-labs
git sparse-checkout set mspm0g5187/bench/arduino portability/arduinoEverything for this build
Adds the board's own folder (its notebook, fixes and assistant notes) and the shared code this build draws on. Notes for an AI assistant: mspm0g5187/AGENTS.md.
git clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git
cd fox-red-labs
git sparse-checkout set portability/arduino mspm0g5187 third-party/arduino ports/micropython/zephyr-cc2340r5Or take the whole repository
git clone https://github.com/Fox-Red-Labs/fox-red-labs.gitReports from others, and the report forms
Clone the repository and open the board's folder below. AGENTS.md is a plain text file of notes for AI coding assistants, and llms.txt at the root indexes the site for one.
git clone https://github.com/Fox-Red-Labs/fox-red-labs.git
- LP-MSPM0G3507: folder
mspm0g3507/.- README: the board's lab notebook (what was run, in order)
- Notes for an AI coding assistant working in this repository: notes for an AI assistant; copy it into your own project if you use one
- FAQ: errors and fixes
The other 2 board folders
- LP-EM-CC2340R5: folder
cc2340r5/.- README: the board's lab notebook (what was run, in order)
- Notes for an AI coding assistant working in this repository: notes for an AI assistant; copy it into your own project if you use one
- FAQ: errors and fixes
- LP-MSPM0G3519: folder
mspm0g3519/.- README: the board's lab notebook (what was run, in order)
- Notes for an AI coding assistant working in this repository: notes for an AI assistant; copy it into your own project if you use one
- FAQ: errors and fixes
- LP-EM-CC2340R5: folder
Code is BSD-3-Clause, writing is CC BY 4.0; third-party folders keep their own licenses.
Built it? Tell us
Built this, or got stuck? Report it on GitHub with a few short answers. Your report shows here in your words, marked as yours. A failure that repeats on the bench gets its fix here.
Evidence and limitsArduino's own Blink and AnalogReadSerial run unchanged on the CC2340R5 and the MSPM0 G3519 through the Zephyr-based Arduino core. On the MSPM0 G3507 four Arduino programs built and two ran on a 649-line Arduino API layer written here. Results, sources, timing and limits.
Arduino Blink and AnalogReadSerial on the LP-EM-CC2340R5
Expected result: Arduino's own Blink sketch, unchanged, runs on the CC2340R5 through the Zephyr-based core, and AnalogReadSerial prints readings at 9600 baud on the probe's serial port.
What this shows
- Arduino's two stock examples, Blink and AnalogReadSerial from
arduino/arduino-examples, build byte-for-byte unchanged for this chip and run. - The port is one devicetree overlay of about 40 lines for the pin map, a CMake file that includes the
.inoas it is, and an optional six-line Serial patch. - attachInterrupt, analogWrite, SPI and Wire also ran from short test sketches.
What this does not establish, and limits
What this does not establish
- That the LED blinked to the eye: the check read the pin's output register and the LED was not watched.
- That ADC readings are accurate: the values come from a floating pin and show only that the call works.
- That PlatformIO works: it was not run, so this page gives no PlatformIO steps.
- That it works on Windows or Linux: only an Intel Mac was used.
Limits to keep in mind
- The core's
Serialdrops bytes at 9600 baud on this chip unless the six-line patch is applied. - The CC2340R5 board file maps the red PWM LED to a timer channel that does not reach the pin; see the board page.
Sources
Versions, sizes and timing
| Core | ArduinoCore-zephyr af5b8610f9be (Apache-2.0), ArduinoCore-API 1.5.2 | README notes |
|---|---|---|
| Zephyr | 4.4.2, Zephyr SDK 0.17.4 GCC 12.2.0 as a cross compiler | README notes |
| Image, Blink | 32.0 kB of flash and 6.1 kB of RAM, built from a copy of the take-it-with-you files | README notes |
| Image, AnalogReadSerial | 27.8 kB of flash, 5.2 kB of RAM (before the overlay gained PWM, SPI and I2C) | README notes |
| Sketches | Arduino's unchanged examples from arduino/arduino-examples 50b66a3 | README notes |
Evidence
- 2026-10-24: Blink (27.7 kB flash, 5.2 kB RAM) built unchanged and ran: the GPIO output register bit for DIO15 was clear on one read and set on the next three. The LED itself was not watched. README notes
- AnalogReadSerial ran at 9600 baud and printed 10-bit values 295 to 400 on a floating A0 (with the Serial patch). README notes
- 2026-10-25: built from a copy of only the take-it-with-you files outside the repository, zero errors: 32.0 kB of flash and 6.1 kB of RAM for Blink. README notes
- attachInterrupt, analogWrite, SPI.transfer and Wire also ran from short test sketches.
Other boards
- MSPM0G3507Could work ran in part
- AM2434Should work Works on the LP-EM-CC2340R5
- MSPM0G3519, MSPM0G5187ran another way
- MSPM0L1306, CC1354P10, CC35X1, IWRL6432, TDA4VM, AM62L32Not for this chip no software for it
- F2800137Not for this chip can't run it
- MSPM0C1104Not for this chip not enough RAM
What the status words mean
Works ran here and did what it shouldCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why
Arduino Blink and AnalogReadSerial on the LP-MSPM0G3519
Expected result: Arduino's own Blink sketch, unchanged, toggles PB27 on the MSPM0 G3519 through the Zephyr-based core, and AnalogReadSerial prints readings at 9600 baud.
What this shows
- Arduino's two stock examples build unchanged for the MSPM0G3519 and run.
- With the MSPM0 I2C pull request applied to Zephyr main, Wire, SPI, analogWrite and attachInterrupt also ran from short test sketches.
What this does not establish, and limits
What this does not establish
- That the LED blinked to the eye: the check read the pin and the LED was not watched.
- That ADC readings are accurate: the values come from a floating pin.
- That PlatformIO works: it was not run, so this page gives no PlatformIO steps.
- That it works on Zephyr 4.4.2: that release has no MSPM0 ADC or I2C driver.
Limits to keep in mind
- Zephyr sees 64 kB of the chip's 128 kB of RAM.
- The G3519 Wire, SPI, PWM and interrupt sketches need a Zephyr main workspace with the MSPM0 I2C pull request applied.
- The take-it-with-you copy of the files was built for the CC2340R5 only; the G3519 copy was not built from a copy.
Sources
Versions, sizes and timing
| Core | ArduinoCore-zephyr af5b8610f9be, ArduinoCore-API 1.5.2 | README notes |
|---|---|---|
| Zephyr | main 4.5.0-dev (1405adc9a, 2026-10-20), Zephyr SDK 0.17.4 GCC 12.2.0 | README notes |
| Image, Blink | 22.8 kB of flash, 4.8 kB of RAM | README notes |
| Image, AnalogReadSerial | 22.8 kB of flash, 4.8 kB of RAM | README notes |
Evidence
- Blink (22.8 kB flash, 4.8 kB RAM) built unchanged and ran: PB27 toggled and
blink.pyprinted PASS. README notes - AnalogReadSerial ran at 9600 baud and printed 10-bit values 72 to 400 on a floating A0 (PA25). README notes
- With the MSPM0 I2C pull request applied, Wire read the touch controller at 0x38 100 of 100 times and SPI loopback returned 256 of 256 bytes. README notes
Other boards
- MSPM0G3507Could work ran in part
- AM2434Should work Works on the LP-EM-CC2340R5
- CC2340R5, MSPM0G5187ran another way
- MSPM0L1306, CC1354P10, CC35X1, IWRL6432, TDA4VM, AM62L32Not for this chip no software for it
- F2800137Not for this chip can't run it
- MSPM0C1104Not for this chip not enough RAM
What the status words mean
Works ran here and did what it shouldCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why
Result grid
Details
Arduino_GFX drew on an ST7796S screen. No Arduino core for MSPM0 was found (checked 2026-10-06), so this is a layer and not an Arduino IDE boardDetails
attachInterrupt, analogWrite, SPI and Wire also runDetails
the Arduino core API's String and Common headers need C++11 (rvalue references, trailing return types) and do not compileWorks ran here and did what it shouldShould work it builds; only naming, packaging or build glue is in the way; hover for whichCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why
Source files
- Arduino libraries on a TI LP-MSPM0G3507: what ran (MSPM0 G3507)
- Zephyr notes (CC2340R5)
Code brought from elsewhere
This project uses code that was written for other chips or tools. Each links to how to get it running.
- Arduino display libraries on the LP-MSPM0G3507, and the core layer on the LP-MSPM0G5187 Works Arduino_GFX's graphics test draws on an ST7796S screen on the MSPM0 G3507, through a 649-line Arduino API layer under the unmodified libraries.
- Arduino sketches on the LP-EM-CC2340R5 and LP-MSPM0G3519 through the Zephyr-based core: Blink and AnalogReadSerial Works Arduino's stock Blink and AnalogReadSerial run unchanged on the CC2340R5 and MSPM0 G3519 through the Zephyr-based core.