# Final firmware build

**URL:** <https://forum.hardwario.com/t/final-firmware-build/783>\
**Category:** TOWER\
**Created:** [January 12, 2024, 2:52pm UTC](https://forum.hardwario.com/t/final-firmware-build/783 "2024-01-12T14:52:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mixi](https://forum.hardwario.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mixi](https://forum.hardwario.com/u/mixi)\
**Post date:** [January 12, 2024, 2:52pm UTC](https://forum.hardwario.com/t/final-firmware-build/783/1 "2024-01-12T14:52:58Z")

</div>

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? ⚔ 😉

Official [documentation](https://docs.hardwario.com/tower/firmware-development/development-cli-tools/) 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). 😃

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:

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

```

Thanks in advance.  
Mixi

---

<div class="post-metadata">

**Author:** ![smejkalJakub](https://forum.hardwario.com/user_avatar/forum.hardwario.com/smejkaljakub/32/643_2.png) [@smejkalJakub](https://forum.hardwario.com/u/smejkalJakub)\
**Post date:** [January 14, 2024, 4:33pm UTC](https://forum.hardwario.com/t/final-firmware-build/783/2 "2024-01-14T16:33:55Z")

</div>

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.

> <https://github.com/hardwario/twr-radio-flood-detector/blob/main/.github/workflows/main.yml>

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.

---

<div class="post-metadata">

**Author:** ![mixi](https://forum.hardwario.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mixi](https://forum.hardwario.com/u/mixi)\
**Post date:** [January 17, 2024, 5:54pm UTC](https://forum.hardwario.com/t/final-firmware-build/783/3 "2024-01-17T17:54:54Z")

</div>

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

It was not working though, I did following changes:

1. fixed typo in variable name `REPORSIORY` → `REPOSITORY` (well, this was not _necessary_). 😉
2. github complained about `${GITHUB_REPOSITORY##*/}`, which I replaced with `${{ github.event.repository.name }}`[[source](https://stackoverflow.com/a/62805013/8560070)],
3. added section with specifying write permissions as workflow refused to upload firmware artifact to release[[source](https://github.com/softprops/action-gh-release/issues/236#issuecomment-1150530128)]:

```yaml
permissions:
  contents: write

```

See [https://github.com/mixicz/water-cooling-controller/blob/main/.github/workflows/main.yml](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

---

<div class="post-metadata">

**Author:** ![smejkalJakub](https://forum.hardwario.com/user_avatar/forum.hardwario.com/smejkaljakub/32/643_2.png) [@smejkalJakub](https://forum.hardwario.com/u/smejkalJakub)\
**Post date:** [January 21, 2024, 9:50pm UTC](https://forum.hardwario.com/t/final-firmware-build/783/4 "2024-01-21T21:50:44Z")

</div>

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.
