GitHub

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

Set up your computer once: 1 step. Done already? Start at step 2.
  1. 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.sh

    You should see: The script ends with NO_FLASH set. Built, not flashed.

  1. 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 Serial wait 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 only

    You should see: The core folder holds zephyr/blobs/ArduinoCore-API/api, and git status shows the patched file.

  2. Build Blink.TERMINAL

    The script takes the variables the README lists (AM for the core, ZP, TC and VENV for 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 Blink

    You should see: About 80 s later the build folder holds zephyr/zephyr.hex and zephyr/zephyr_crc32.hex. Blink is about 32 kB of flash and 6.1 kB of RAM.

  3. 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 -e prints its serial number.

  4. 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 _crc32 image, 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.

  5. 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 baud

    You 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.

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 claude

It runs the steps above and reports what it saw.

Not Claude Code? Copy this prompt instead.
Clone https://github.com/Fox-Red-Labs/fox-red-labs and read AGENTS.md first. Then run Run Arduino's own sketches on a TI chip on my LP-EM-CC2340R5, following docs/builds/arduino.md. Tell me when to plug in a board and what you saw at each step.

If something goes wrong

A download failsRerun the script; it keeps what it already fetched.
The build later cannot find Arduino's API headerszephyr/blobs/ArduinoCore-API/api is missing.
It stops naming a variableSet it: AM is the core folder of step 2.
xdsdfu -e lists nothingCheck the clip-on connection and use a data cable.
The flash failsClose CCStudio or any other program that holds the probe, and rerun it.
More troubleshooting
Bytes are dropped or the numbers run togetherThe Serial patch of step 2 is missing.

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 .ino as 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 Serial drops 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

CoreArduinoCore-zephyr af5b8610f9be (Apache-2.0), ArduinoCore-API 1.5.2README notes
Zephyr4.4.2, Zephyr SDK 0.17.4 GCC 12.2.0 as a cross compilerREADME notes
Image, Blink32.0 kB of flash and 6.1 kB of RAM, built from a copy of the take-it-with-you filesREADME notes
Image, AnalogReadSerial27.8 kB of flash, 5.2 kB of RAM (before the overlay gained PWM, SPI and I2C)
SketchesArduino's unchanged examples from arduino/arduino-examples 50b66a3README 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

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

CoreArduinoCore-zephyr af5b8610f9be, ArduinoCore-API 1.5.2README notes
Zephyrmain 4.5.0-dev (1405adc9a, 2026-10-20), Zephyr SDK 0.17.4 GCC 12.2.0README notes
Image, Blink22.8 kB of flash, 4.8 kB of RAM
Image, AnalogReadSerial22.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.py printed 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

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

Project
LP-MSPM0G3507MSPM0G3507 chip
LP-MSPM0L1306MSPM0L1306 chip
LP-EM-CC2340R5CC2340R52 chip
LAUNCHXL-F2800137TMS320F2800137 chip
Run Arduino's own sketches on a TI chip
LP-MSPM0G3507Could workFour Arduino programs built and two ran on a 649-line Arduino API layer written here;
DetailsArduino_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 board
Arduino libraries on a TI LP-MSPM0G3507: what ran
LP-MSPM0L1306Not for this chipNo MSPM0 core found for either (checked 2026-10-06)
LP-EM-CC2340R5WorksBlink and AnalogReadSerial run unchanged through the Zephyr-based Arduino core;
DetailsattachInterrupt, analogWrite, SPI and Wire also run
Zephyr notes
LAUNCHXL-F2800137

Works 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

Code brought from elsewhere

This project uses code that was written for other chips or tools. Each links to how to get it running.

Start with your code, and the prompt to port your own

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

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.