Nitrokeypro2 build failure

I am attempting to build and flash release fw v0.14.
Can someone please provide steps to fix this build error?

I have a STLink programmer if it is required. The doc’s on github seem very vague. It goes back and forth between using OpenOCD and the “Official STM32” software suite.

It is also unclear to me, weather the STLink programmer USB will be used in the steps related to “make devloop-release” ?

In my /nitrokey-pro-firmware/build directory, there is only one folder: gcc . This folder gcc contains 9 files (some C files , and this one text file )

I tried asking for some help on matrix/nitrokey chat, but was asked to start a thread here with the build logs posted.

Terminal-Output

nitrokey-pro-firmware.buildinfo

Thanks for help!!! :slight_smile:

Hey!
Your GCC seems to be too old (4.9.3 20141119) to handle one of the helper switch (unrecognized option '--print-memory-usage'). Either remove it from makefile or update the GCC (or use the Dockerfile included to the repository AFAIR). We do not support as old compilers, so I can’t answer further questions for this specific GCC version. Please use 6.3.0 or newer.
Excerpts from the logs:

../../src/hw_config_rev4.o     --output nitrokey-pro-firmware.elf -nostartfiles -Wl,-Map=nitrokey-pro-firmware.map,--cref  -lm    -Wl,--print-memory-usage -Wl,-nostdlib -Tstm32.ld -TSTM32_SEC_FLASH.ld
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: unrecognized option '--print-memory-usage'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
Sun Mar 20 03:02:48 PM UTC 2022
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20141119 (release) [ARM/embedded-4_9-branch revision 218278]
Copyright (C) 2014 Free Software Foundation, Inc.

Edit: Dockerfile is not there yet.

Thanks for the fast reply.
I originally ran into issue(s) as described in issue #49

So I went out of my way to install gcc-arm-none-eabi v4.9

used this information-
https://github.com/Nitrokey/nitrokey-pro-firmware/travis.yml

I have only two questions:
1- Is there a tested distro used (aka Fedora34/Ubuntu LTS 20.04 / etc ) that will build the fw correctly ? If so, which distro?

2- Is there any additional documentation on how to utilize a STLink programmer to over-write the existing firmware with a fresh build?
2a - Assuming I cannot build the fw, but decide to use the release .hex fw file ; How does one simply use CLI / command line to flash the files?

I understand you have to first unlock the controller, to enable write mode? How do I unlock it, then overwrite with the v0.14 release?

Thanks for the help. Much appreciated.

I see now. We do not use Travis CI anymore, but its configuration was left and makes confusion (sorry!) - to be removed. Indeed, readme lacks update about the minimum compiler - will keep in mind to correct that. Looking at the tag’s (1) release files (2), it was built with (excerpt from .buildinfo) :

arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)

  1. Indeed the firmware repository does not contain ready to use Dockerfile to test that. Certainly worth adding. We download toolchain directly from ARM, but perhaps Debian would be alright. I remember Ubuntu had some misconfiguration in its package sometime ago (I cannot recall if this was resolved).
  2. Have you seen these already?