Final firmware build

Hi,
I want to proclaim my firmware being a finished one, thus creating a non-debug build and even reward it with some real version number. But I got lost on my journey to do so with my trustful command line.

Can someone please enlighten me and guide me through this quest for final firmware? :crossed_swords: :wink:

Official documentation ends with “Repeat these steps until you have the final firmware that you want”, missing the important “then do this to create final build” part, which probably means you don’t expect us to ever reach this point (and rightly so, this is the first time after many years I decided to make this step forward). :smiley:

My expectation is to not have DEBUG defined, FW_VERSION to contain real version instead of "vdev" and to have built firmware binary in some dedicated directory like out/1.0.0/. My naïve attempt to do so using following command did not work:

cmake -B obj/1.0.0 . -G Ninja -DFW_VERSION=1.0.0 -DCMAKE_TOOLCHAIN_FILE=sdk/toolchain/toolchain.cmake

Thanks in advance.
Mixi

Hello,

I apologise for the missing steps in the documentation.

If you are hosting your project on GitHub, you can use the GitHub CI to build the project on tag creation. It is a bit more comfortable since you just push the code, create a tag and have your build ready.

Othervise, you can follow the steps that are in the workflow.
You were on the right track. You have to create the env variables, run cmake and then run ninja.

Here is a link to one of our firmware CI file. You can go through it and try to replicate it, or if you have the GitHub repository, feel free to copy and paste it is mostly universal.

If you would have any aditional questions or problems with the build, feel free to reply and we will hopefully figure it out.

Best Regards

Jakub

HARDWARIO a.s.

Thanks for help. I feel bit ashamed, as I just found out I already had github pipeline ready, as it was part of your firmware skeleton project. :roll_eyes:

It was not working though, I did following changes:

  1. fixed typo in variable name REPORSIORYREPOSITORY (well, this was not necessary). :wink:
  2. github complained about ${GITHUB_REPOSITORY##*/}, which I replaced with ${{ github.event.repository.name }}[source],
  3. added section with specifying write permissions as workflow refused to upload firmware artifact to release[source]:
permissions:
  contents: write

See https://github.com/mixicz/water-cooling-controller/blob/main/.github/workflows/main.yml for final working workflow.

As for local build, I expect I just need to set FW_VERSION and BUILD_TYPE env variables and rerun cmake and ninja? I will try this later as I just reinstalled my PC and did not set up tower dev environment yet.

Thanks for pointing me in right direction.
Mixi

Hello again,

no worries, the important thing is that you made it work.

I will look into the issues and try to fix them in our repositories. Thanks for the report and the link.

As for the local build, you are correct, it should work just by setting the variables and running cmake and ninja with the correct flags.

Have a great day and good luck with your project moving forward.

Best Regards

Jakub

HARDWARIO a.s.