Fox Red Labs / Builds / Tools and languages
Run FreeRTOS tasks on a LaunchPad kit
Build FreeRTOS from TI's SDK files, flash it, and watch counted tasks run: on the 4 kB-RAM MSPM0 L1306, or with TI's example on the CC2340R5.
HardNo wiring1 evening
Parts and steps
Your board
You need
- LP-MSPM0L1306 LaunchPad development kit Buy the board
- Micro-USB data cable power and programming
Find your board's debug probe serial number with TI's xdsdfu tool from CCStudio.TERMINAL
The scripts talk to one probe only and refuse to run without it.
/Applications/ti/ccs2101/ccs/ccs_base/common/uscif/xds110/xdsdfu -eYou should see: A line
Serial Num: <your serial>for the LaunchPad. Use it as PROBE in steps 4 to 6.Plug the LP-MSPM0L1306 into the Mac with the micro-USB cable.BENCH
No wires and no jumpers move for this build.
You should see: The board powers up and shows its out-of-box demo.
Build the one-task blink. build.sh compiles the five kernel files from the SDK straight into the image and stops if any part falls outside main flash or the 4 kB of SRAM.TERMINAL
cd mspm0l1306/freertos ./build.sh blinkYou should see:
build-blink/sizes.txtreadsFLASH used 3,784 bytes of 65,528andSRAM used 1,008 bytes of 4,096; 3,088 bytes left. On a lightly loaded Mac each image takes under a minute.Flash the blink, paint the chip's RAM with a pattern before any code runs, let it run 5 seconds, read the results, then decode and check them.TERMINAL
Replace <serial> with your probe.
Replace <serial> before you run this.
PROBE=<serial> ../tools/paintrun.sh build-blink/blink.out build-blink/blink.map fr_blink 6 5000 python3 check.py build-blinkYou should see: LED1 (red) is on half a second and off half a second.
check.pyprintsok magic 0xB1E00001,ok ticks = 500 x (toggles - 1): the tick runs at 1,000 per second, andALL OK. The blink task never used 23 of its 48 stack words.Now see how many tasks fit.TERMINAL
This image makes 11 minimal tasks with 192-byte stacks and all memory static, one checker task and the idle task.
Replace <serial> before you run this.
./build.sh edge-static PROBE=<serial> ../tools/paintrun.sh build-edge-static/edge-static.out build-edge-static/edge-static.map fr_edge 12 5000 python3 check.py build-edge-staticYou should see:
check.pyprintsmade 11 alive 11,ok every minimal task ran in the last secondandALL OK.Optional: time what a task costs.TERMINAL
This image times a task switch, a semaphore, a notification, a queue round trip and an interrupt waking a task, 1k samples each.
Replace <serial> before you run this.
./build.sh bench PROBE=<serial> ../tools/paintrun.sh build-bench/bench.out build-bench/bench.map fr_bench 43 3000 python3 check.py build-benchYou should see: A table of cycle counts per test and
ALL OK. A task switch round trip is 499 cycles best case at 32 MHz in this run, about 16 microseconds.
You need
- LP-EM-CC2340R5 LaunchPad development kit Buy the board
- LP-XDS110ET debugger Buy the debug probe
Clip the LP-XDS110ET onto the LP-EM-CC2340R5's 20-pin edge, set the TGT VDD jumper to XDS, and plug the probe into the Mac with its USB-C cable.BENCH
You should see: The Mac sees the probe and two serial ports; no driver install was needed.
Build TI's example.TERMINAL
Change the three paths if your installers put the tools somewhere else. The SDK's own build settings point at folders that do not exist, so pass the paths on the command line.
cd cc2340r5/src/freertos/ticlang make SIMPLELINK_LOWPOWER_F3_SDK_INSTALL_DIR=/Applications/ti/simplelink_lowpower_f3_sdk_9_21_00_36_LTS \ SYSCONFIG_TOOL=/Applications/ti/sysconfig_1.26.3/sysconfig_cli.sh \ TICLANG_ARMCOMPILER=/Applications/ti/ccs2101/ccs/tools/compiler/ti-cgt-armllvm_5.1.1.LTSYou should see: About 22 seconds later,
empty.outandempty.hexare in that folder.Use the connection file in cc2340r5/ after putting your probe serial number in it.TERMINAL
Do not write one by hand: a hand-written one left SWD off and the errors did not say so. If you need a new one, let CCStudio write it by importing the example, then take it from
targetConfigs/CC2340R5.ccxmlin the imported project.Replace <any empty folder> and <SDK> before you run this.
/Applications/ti/ccs2101/ccs/ccs-server.app/Contents/MacOS/ccs-server-cli.sh -noSplash -workspace <any empty folder> -application com.ti.ccs.apps.importProject -ccs.location <SDK>/examples/rtos/LP_EM_CC2340R5/drivers/empty/freertos/ticlang/empty_LP_EM_CC2340R5_freertos_ticlang.projectspecYou should see: Four seconds later the file
targetConfigs/CC2340R5.ccxmlexists inside the imported project. Replace <any empty folder> with a new empty folder and <SDK> with the SDK folder.From cc2340r5/ flash the hex file and run it.TERMINAL
Leave
-v(verify) off: it reports one mismatch at 0x4E020750 in the boot configuration area and ends with a failure although the program was written and runs.cd ../../.. /Applications/ti/uniflash_9.6.0/dslite.sh --mode flash -c CC2340R5.ccxml -e -f -u src/freertos/ticlang/empty.hexYou should see: About 7 seconds later the flash finishes.
-ehere is--verbose: it prints progress and does not erase.Look at the board's red LED.BENCH
You should see: The red LED (DIO14) is on for one second and off for one second.
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 mspm0l1306 run-freertos --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 mspm0l1306 run-freertos --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 cc2340r5 run-freertos --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 run-freertos --assistant claudeIt runs the steps above and reports what it saw.
Not Claude Code? Copy this prompt instead.
If something goes wrong
| Nothing is listed | Replug the board with a data cable and run it again; close any serial window open on the board. |
A script later says Probe ... missing | The serial number in step 1 does not match a connected board. |
| The compiler is not found | Change the SDK and CC lines at the top of build.sh to where your installers put them. |
The flash step prints flash failed or Probe ... missing | Check the serial from step 1. |
| OpenOCD says it cannot reset the target or find the MEM-AP | See the L1306 FAQ entry on that error (mspm0l1306/FAQ.md). |
More troubleshooting
| A twelfth task does not link | The linker stops with program will not fit into available memory (see build-edge-static/search.txt). That is the answer. It is not a fault. |
check.py does not print ALL OK | It names the check that failed; magic 0xBE4C0001 means every test finished. |
Every fix for this board: the FAQ.
The next flash fails with The target failed to see a correctly formatted SWD header (error -615) | Unplug the USB cable, pull the probe off the board, press it back on firmly and plug in again. That cleared it here. The likely cause is the seating, but that is not proven. |
| The build cannot find a tool | One of the three paths is wrong. |
Flashing later says Unable to access the DAP or invalid processor ID | The file has SWD switched off: use CCStudio's file. |
| Two probes are plugged in | The tool does not say which it used: put the serial number of the one you mean in the connection file. |
| It does not blink | A previous owner's program may still be running; flash again and check that step 4 finished without an error. |
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 limits11 FreeRTOS tasks fit in the L1306's 4 kB of RAM. Ran on 2 boards. Results, sources, timing and limits.
FreeRTOS tasks on a 4 kB chip (LP-MSPM0L1306)
Expected result: The red LED blinks from one FreeRTOS task using 1 kB of RAM. With 11 minimal tasks the chip's 4 kB of RAM are almost used: 3.9 kB, with 140 left. Every task runs. A task switch round trip takes 397 to 499 cycles, which is 12 to 16 microseconds at 32 MHz.
What this shows
- FreeRTOS fits and runs on the MSPM0L1306 with static allocation, using TI's own kernel V11.2.0 and Cortex-M0+ port files unchanged. The one-task blink takes 3.7 kB of flash and 1 kB of RAM.
- 11 minimal tasks fit with static allocation, and a twelfth does not link. With a heap the figure is 10, as predicted: the 11th task creation failed for lack of heap on the board.
- TI's own FreeRTOS settings file for this board needs 5.4 kB of zero-filled RAM plus the stack and does not link on a 4 kB chip.
What this does not establish, and limits
What this does not establish
- That a useful application fits. 11 tasks is 11 loops that sleep one tick; a real sensor-and-UART task set was not run.
- Low-power behavior: tickless idle is off in these settings and sleep current was not measured.
- That the timing numbers compare with other RTOS runs one-to-one. The Zephyr thread-yield figure of 431 to 491 cycles used a different timer and build.
- Anything about TI's FreeRTOS example makefiles: they were not used. They link a kernel library from a CCStudio workspace, and the SDK's 48 FreeRTOS example makefiles fail from a terminal as shipped.
Limits to keep in mind
- Task stacks of 48 words come from a stack analysis: the worst case is 44 words for a task that sleeps. High-water marks on the board confirmed it. A task that calls deeper code needs more.
- Part of the 256-byte interrupt stack is never given back. The Cortex-M0+ port does not reset the main stack pointer when the scheduler starts, so 100 to 132 bytes stay used.
- The settings file changes TI's: static allocation only, 3 priority levels, 4-character task names, no software timers, no tickless idle.
Sources
Versions, sizes and timing
| Kernel | FreeRTOS V11.2.0 from MSPM0 SDK 2.11.00.07 (tasks.c, list.c, queue.c, the TI_ARM_CLANG ARM_CM0 port), compiled unchanged, -O2 | README notes |
|---|---|---|
| Toolchain | TI Arm Clang 5.1.1.LTS from CCStudio 21.0.1; xPack OpenOCD 0.12.0-7; Intel Mac, macOS 15.7.9 | README notes |
| Clock | 32 MHz SYSOSC, 1,000 Hz tick; cycle counter is TIMG0 at the CPU clock | README notes |
| Blink image | 3.7 kB of flash, 1 kB of RAM (3,088 left) | |
| Task count, static | 11 tasks plus checker and idle; 3.9 kB of RAM used, 140 left; 12 does not link | README notes |
| Task switch round trip | 499 / 640 / 502.9 cycles best / worst / average with asserts and stack check on; 397 / 537 / 400.6 with them off (bench-lean); 1k samples | README notes |
| Interrupt to task | pend to the first line of the task woken by vTaskNotifyGiveFromISR: 583 / 724 / 585.7 cycles; by a semaphore from an ISR: 645 / 789 / 651.2 | README notes |
| TI's settings file | .bss of 0x15a4 (5.4 kB) on 4 kB of RAM: does not link | README notes |
Evidence
- Built 2026-10-06 and run on an MSPM0 L1306: the blink, the timing bench and both task-count images ran;
check.pyprinted ALL OK for all five images, with no fault recorded. README notes - Write-up of the experiment, with TI's own settings file failing to link. MSPM0L1306 FreeRTOS 4kb notes
Other boards
- MSPM0G3507, CC2340R5could work
- F2800137Not 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
TI's FreeRTOS example on the LP-EM-CC2340R5
Expected result: The red LED on the CC2340R5 blinks once every two seconds (one second on, one off), running TI's SDK example on its default RTOS, FreeRTOS. The empty FreeRTOS example leaves 23 kB of the chip's 36 kB of RAM free.
What this shows
- On this chip TI's examples run on FreeRTOS by default; the example's folder is
freertos/and it builds from a terminal with make. - The FreeRTOS example uses 11.7 kB of flash and 13 kB of RAM, about 6.2 kB of flash and 3.1 kB of RAM more than the same example with no RTOS.
What this does not establish, and limits
What this does not establish
- How many tasks fit, or any task timing: this build only blinks an LED. The task-count and task-switch measurements were made on the MSPM0 L1306, and none was made here.
- That it works with the probe-less setup: the board needs the separate XDS110 probe.
- Other systems than an Intel Mac on macOS 15.7.
Limits to keep in mind
- Verify (
-v) reports a mismatch at 0x4E020750 on every image flashed on this board; the program area verified and the program ran each time. - The first run took about 9 minutes of machine time and 3 hands-on, nearly all of it a connection problem that cleared when the probe was reseated.
Sources
Versions, sizes and timing
| Example | SimpleLink Low Power F3 SDK 9.21.00.36 LTS, CCStudio 21.0.1 for TI Arm Clang 5.1.1 LTS, SysConfig 1.26.3 and UniFlash 9.6.0, in /Applications/ti/. SysConfig 1.26.3 came with the SimpleLink Wi-Fi SDK installer. CCStudio 21.0.1 carries its own 1.28.1. This repo's scripts do not point at it. | README notes |
|---|---|---|
| Memory, FreeRTOS | 11.7 kB flash, 13 kB RAM used, 23 kB RAM free | |
| Memory, no RTOS | 5.6 kB flash, 9.9 kB RAM used, 26.1 kB RAM free | |
| Time | build 22 s, flash 7 s; first run about 9 minutes of machine time, 3 hands-on | |
| Tools | UniFlash 9.6.0, SysConfig 1.26.3, CCStudio 21.0.1; chip CC2340R52 (Cortex-M0+, 48 MHz, 512 KB flash, 36 KB RAM) | README notes |
Evidence
- 2026-10-05 and 06: TI's SDK
drivers/emptyexample on FreeRTOS was built (22 s) and flashed (7 s) from the command line; the red LED blinking was confirmed by eye. README notes - The same example's memory use was read from its linker map: 11.7 kB of flash and 13 kB of RAM, against 5,741 and 10,129 for the example with no RTOS.
Other boards
- MSPM0G3507ran another way
- MSPM0L1306could work
- F2800137Not 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
the cause is the build flow, not the chip. A build script in this repo builds TI Drivers on FreeRTOS for this board (20.5 kB of flash, 6.9 kB of RAM); it was not 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
Experiments (2)
| Status | What was tried | Result |
|---|---|---|
| Works | Can FreeRTOS run on the TI LP-MSPM0L1306, with only 4 kB of RAM and no TI example? MSPM0 L1306, 2026-10-06 | Runs with static allocation and smaller stacks: blink uses 1 kB of 4 kB of RAM and 11 small tasks fit; TI's own settings file for this board needs 5.4 kB and does not link. |
| Works | Can the LP-AM263P run four cores at once, with different operating systems, including Zephyr? AM263P, 2026-10-11 | All four Cortex-R5F cores of the AM263P ran CoreMark at once at 1,462 to 1,464 per second each (5,854 together), within 0.1% of each core alone. A message between cores takes 3.36 to 3.87 µs round trip with TI's... |
Source files
- One app, three software layers, on the MSPM0G3507 and MSPM0L1306 (MSPM0 G3507)
- LP-MSPM0L1306 FreeRTOS notes (MSPM0 L1306)
Code brought from elsewhere
This project uses code that was written for other chips or tools. Each links to how to get it running.
- FreeRTOS in 4 kB of RAM on the LP-MSPM0L1306 Works FreeRTOS runs on the MSPM0 L1306 in 4 kB of RAM: the blink uses 1 kB.
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-MSPM0L1306: folder
mspm0l1306/.- 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
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-MSPM0L1306: 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.
