Sample project on how to use Ceedling for a multi-target project targeting different Microchip controllers.
This is quite an advanced project in terms of tooling setup. It aims to illustrate the setup needed to run tests on host, simulator and hardware along with support for targeting different devices with differenet toolchain.
This project uses the mdb Ceedling plugin to ease the task of running tests on both simulator and hardware.
Make sure you have a working installation of Ceedling, MPLAB X and the XC compilers.
Clone this repo somewhere on your PC. e.g:
cd somewhere/in/your/pc
git clone https://github.com/deltalejo/ceedling-microchip-example.git
cd ceedling-microchip-example
Inside project's root, create a env.yml
file and set its contents accordingly.
e.g.:
---
:environment:
# MPLAB X path (for packs on MPLABX installation dir)
- :mplabx_path: /opt/microchip/mplabx/v6.15
# Device Packs path (for packs on user installation dir)
- :dfp_path: ~/.mchp_packs
# Compilers paths
- :xc8_path: /opt/microchip/xc8/v2.45
- :xc16_path: /opt/microchip/xc16/v2.10
- :xc32_path: /opt/microchip/xc32/v4.35
- :xcdsc_path: /opt/microchip/xc-dsc/v3.00
...
The project is set up to support multiple target devices each requiring potentially a different toolchain and allows for running tests on host, simulator and hardware.
Each platform has a corresponding configuration file inside platforms
dir
containing only settings specific to the platform, for example, build root dir.
The following are the supported platforms:
- Host:
host.yml
- Simulator:
simulator.yml
- Target:
target.yml
As easy as:
ceedling test:all
or specifying the target device:
ceedling target:PIC18F26K22 test:all
Give platform:simulator
as an argument when calling Ceedling.
e.g.:
ceedling platform:simulator test:all
or specifying the target device:
ceedling platform:simulator target:PIC18F26K22 test:all
Give platform:target
as an argument when calling Ceedling along with serial
port parameters.
e.g.:
ceedling platform:target mdb:serialport[/dev/ttyUSB0] test:all
or specifying the target device:
ceedling platform:target target:PIC18F26K22 mdb:serialport[/dev/ttyUSB0] test:all