Fox Red Labs / Builds / Tools and languages
Run Arduino's own 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
Parts and steps
Your board
You need
- LP-EM-CC2340R5 LaunchPad development kit Buy the board
- LP-XDS110ET debugger Buy the debugger that programs the board
- A Mac to build and flash from builds and flashes
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 the Mac 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
Then flash the
_crc32image, which carries the boot checksums, and reset the board.Replace <build folder> and <your-probe-serial> before you run this.
$DSLITE flash -c cc2340r5/CC2340R5.ccxml -e -f -u <build folder>/zephyr/zephyr_crc32.hex xds110reset -s <your-probe-serial>You 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.
You need
- LP-MSPM0G3519 LaunchPad development kit the board
- A Mac to build and flash from builds and flashes
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.Flash the image.TERMINAL
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.Replace <repository folder> and <build folder> before you run this.
<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).
Or hand it to a coding assistant
Paste this in a terminal. It hands off to an AI assistant.
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 claudeIt runs the steps above and reports what it saw.
Not Claude Code? Copy this prompt instead.
Or hand it to a coding assistant
Paste this in a terminal. It hands off to an AI assistant.
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 claudeIt runs the steps above and reports what it saw.
Not Claude Code? Copy this prompt instead.
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.
What to build next
Every build. The code for all of them is in the GitHub repository.
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. Ran on 2 boards. 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) | |
| 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.
- AnalogReadSerial ran at 9600 baud and printed 10-bit values 295 to 400 on a floating A0 (with the Serial patch).
- 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
- F2800137
- MSPM0G3519ran another way
- MSPM0L1306Not for this chip no software for it
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 | |
| Image, AnalogReadSerial | 22.8 kB of flash, 4.8 kB of RAM |
Evidence
- Blink (22.8 kB flash, 4.8 kB RAM) built unchanged and ran: PB27 toggled and
blink.pyprinted PASS. - AnalogReadSerial ran at 9600 baud and printed 10-bit values 72 to 400 on a floating A0 (PA25).
- 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.
Other boards
- MSPM0G3507Could work ran in part
- CC2340R5ran another way
- F2800137
- MSPM0L1306Not for this chip no software for it
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 runWorks 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 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.
Get the code and tell us how it wentThe clone command, the board folder with its AGENTS.md, reports from others, and the three report forms.
Get the code
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.