This directory contains one focused document per example under Core/Src/Examples/.
Use this folder as the quick reference for:
- what each example is for
- how to build it
- what hardware it needs
- how to validate that it is working
- what a failure usually means
List available examples:
./tools/build-example.sh --listBuild one example on a Nucleo:
./tools/build-example.sh --example adc --preset nucleo-debug --test 0Build one Ethernet example on a Nucleo:
./tools/build-example.sh --example tcpip --preset nucleo-debug-eth --extra-cxx-flags "-DTCPIP_TEST_HOST_IP=192.168.1.9"For Ethernet examples, configure the host-side board-link interface with a static IPv4 on the same subnet as the board (default examples expect 192.168.1.9 on the host and 192.168.1.7 on the board).
Flash the latest build:
STM32_Programmer_CLI -c port=SWD mode=UR -w out/build/latest.elf -v -rst- ExampleADC
- ExampleEthernet
- ExampleEXTI
- ExampleHardFault
- ExampleMPU
- ExamplePackets
- ExampleTCPIP
- LinearSensorCharacterization
Not all examples depend on the same generated packet schema.
That matters because the generated OrderPackets and DataPackets APIs are produced from the active contents of:
Core/Inc/Code_generation/JSON_ADEboards.json- the selected
BOARD_NAME
In practice, that means some examples are source-compatible only with a specific JSON_ADE branch or schema set.
These do not depend on generated OrderPackets / DataPackets symbols:
ExampleADCExampleEthernetExampleEXTIExampleHardFaultExampleMPUExampleTCPIP
You can build them as long as the normal board/preset requirements are satisfied.
ExamplePackets
ExamplePackets is designed around the current TEST packet schema active in this branch.
It expects the generated API associated with the TEST board definition and the packet/order set used by tools/example_packets_check.py.
The required JSON_ADE branch for this setup is:
fw-test-packets
LinearSensorCharacterization
LinearSensorCharacterization does not match the current TEST schema.
It expects a different JSON_ADE branch or board definition that generates the legacy characterization symbols (characterize, characterization, Value, etc.).
The required JSON_ADE branch for this setup is:
linear-sensor-char
ExamplePackets and LinearSensorCharacterization are currently not plug-and-play compatible with the same JSON_ADE checkout.
If you switch the JSON_ADE branch/schema to satisfy one of them, you can break the other.
Before building a packet-dependent example, check its document first and confirm:
- which
JSON_ADEschema it expects - which
BOARD_NAMEit must be generated with - whether the required generated symbols exist
tools/build-example.shnow handles named tests such asusage_faultasTEST_USAGE_FAULT.- If an example does not define any
TEST_*selector, the script no longer injectsTEST_0by default. out/build/latest.elfalways points to the most recent MCU build, so flash immediately after building the example you want.Core/Inc/Communications/Packets/DataPackets.hppandCore/Inc/Communications/Packets/OrderPackets.hppare generated packet headers. They are not source-of-truth files and are intentionally gitignored.