A proof-of-concept for a CI system meant for embedded software development
This README currently functions as a journal to track my progress and ideas.
To create a simple CI setup which will assist me when learning Embedded Rust.
The aim is to use a LattePanda 3 Delta as the CI server and connect it to a Raspberry Pi Pico and a Saleae logic analyzer.
It should be possible to:
- build embedded Rust source code
- flash it to the Raspberry Pi Pico
- use Saleae's Automation API to run tests on the Pico
Note: I initially wanted to use a Raspberry Pi 4 but Saleae's Logic does not have binaries for ARM
I am running NixOS on the LattePanda and the following dockerized applications:
- Gitea for Git repository management
- Woodpecker as a CI engine
- MinIO for artifact storage
Use Docker Compose to run the above.
Minimal security to begin with, just to get the ball rolling.
- Install NixOS and use the
configuration.nixfile from myconfigfilesrepository together with theembci.nixfile from this repository. - Clone this repository
- Configure the LattePanda's IP address in
.env. This variable is used bydocker-compose.yml. For the instructions below, replace$IP_ADDRESSwith the IP address. - Configure the debug probe serial number in
.env - Start the MinIO container
docker compose up -d minio - Access
http://$IP_ADDRESS:9001/in your browser - Log in with minioadmin/minioadmin (the default admin user)
- Create an access key and copy the results in the
MINIO_ACCESS_KEYandMINIO_SECRET_KEYvariables in.env - Start the Gitea container
docker compose up -d gitea - Access
http://$IP_ADDRESS:3000/in your browser - Log in with embci/embci (the default admin user)
- Go to
http://$IP_ADDRESS:3000/user/settings/applicationsand inManage OAuth2 Applicationschoose:Application Name: Woodpecker CIRedirect URI: http://$IP_ADDRESS:8000/authorizeMake sure that theConfidential Clientcheckbox is ticked and then clickCreate ApplicationCopy theClient IDin theWOODPECKER_GITEA_CLIENTvariable in.envCopy theClient Secretin theWOODPECKER_GITEA_SECRETvariable in.envFinally clickSave - Clone the
https://github.com/Daedrus/embci-example-reporepository by clicking the + button in the top-right and choosingNew Migration->Github - Create an agent secret
openssl rand -base64 32and add the output to theWOODPECKER_AGENT_SECRETvariable in.env - Stop MinIO and Gitea
docker compose stop - Run
probe-rs listto get the ID of your debug probe and add the output to theDEBUG_PROBE_1_SERIALvariable in.env - All of the variables in
.envshould be set (none of them should be set to CHANGEME anymore) - Start all containers
docker compose up -d - Access
http://$IP_ADDRESS:8000/in your browser - Log in with embci/embci (the default admin user)
- It should ask to confirm the authentication
- Add the
embci-example-reporepository to Woodpecker and run the pipeline - Things should work out of the box provided that your hardware setup is similar to mine or, if different, you have made the necessary changes.
- Note that the Woodpecker agent is currently running in privileged mode since I couldn't get it to work with the debug probe and the analyzer otherwise. I hope to fix this in the future.
