GitHub

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

  1. 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 -e

    You should see: A line Serial Num: <your serial> for the LaunchPad. Use it as PROBE in steps 4 to 6.

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

  3. 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 blink

    You should see: build-blink/sizes.txt reads FLASH used 3,784 bytes of 65,528 and SRAM used 1,008 bytes of 4,096; 3,088 bytes left. On a lightly loaded Mac each image takes under a minute.

  4. 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-blink

    You should see: LED1 (red) is on half a second and off half a second. check.py prints ok magic 0xB1E00001, ok ticks = 500 x (toggles - 1): the tick runs at 1,000 per second, and ALL OK. The blink task never used 23 of its 48 stack words.

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

    You should see: check.py prints made 11 alive 11, ok every minimal task ran in the last second and ALL OK.

  6. 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-bench

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

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 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 mspm0l1306/AGENTS.md first. Then run Run the FreeRTOS real-time operating system on my LP-MSPM0L1306, following docs/builds/run-freertos.md. Tell me when to plug in a board and what you saw at each step.

If something goes wrong

Nothing is listedReplug the board with a data cable and run it again; close any serial window open on the board.
A script later says Probe ... missingThe serial number in step 1 does not match a connected board.
The compiler is not foundChange 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 ... missingCheck the serial from step 1.
OpenOCD says it cannot reset the target or find the MEM-APSee the L1306 FAQ entry on that error (mspm0l1306/FAQ.md).
More troubleshooting
A twelfth task does not linkThe 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 OKIt names the check that failed; magic 0xBE4C0001 means every test finished.

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

KernelFreeRTOS 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, -O2README notes
ToolchainTI Arm Clang 5.1.1.LTS from CCStudio 21.0.1; xPack OpenOCD 0.12.0-7; Intel Mac, macOS 15.7.9README notes
Clock32 MHz SYSOSC, 1,000 Hz tick; cycle counter is TIMG0 at the CPU clockREADME notes
Blink image3.7 kB of flash, 1 kB of RAM (3,088 left)
Task count, static11 tasks plus checker and idle; 3.9 kB of RAM used, 140 left; 12 does not linkREADME notes
Task switch round trip499 / 640 / 502.9 cycles best / worst / average with asserts and stack check on; 397 / 537 / 400.6 with them off (bench-lean); 1k samplesREADME notes
Interrupt to taskpend to the first line of the task woken by vTaskNotifyGiveFromISR: 583 / 724 / 585.7 cycles; by a semaphore from an ISR: 645 / 789 / 651.2README notes
TI's settings file.bss of 0x15a4 (5.4 kB) on 4 kB of RAM: does not linkREADME notes

Evidence

  • Built 2026-10-06 and run on an MSPM0 L1306: the blink, the timing bench and both task-count images ran; check.py printed 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

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

ExampleSimpleLink 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, FreeRTOS11.7 kB flash, 13 kB RAM used, 23 kB RAM free
Memory, no RTOS5.6 kB flash, 9.9 kB RAM used, 26.1 kB RAM free
Timebuild 22 s, flash 7 s; first run about 9 minutes of machine time, 3 hands-on
ToolsUniFlash 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/empty example 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

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 the FreeRTOS real-time operating system
LP-MSPM0G3507Should workThe 48 MSPM0 FreeRTOS example makefiles fail with TI Arm Clang from a terminal as shipped;
Detailsthe 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 run
One app, three software layers, on the MSPM0G3507 and MSPM0L1306
LP-MSPM0L1306Works11 tasks fit in 4 kB; a task switch takes 12 to 16 µs; TI's own settings file for the board needs 5.4 kB LP-MSPM0L1306 FreeRTOS notes
LP-EM-CC2340R5WorksTI's examples run on FreeRTOS by default; the empty project uses 13 kB of RAM
LAUNCHXL-F2800137Not for this chipNo FreeRTOS for this chip in public C2000Ware

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

Experiments (2)

StatusWhat was triedResult
WorksCan 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.
WorksCan 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

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.