Using my own private keys on bootloader "ruuvi.nrf5_sdk15_bootloader.c"


#1

Hello,

I am stuck on generating bootloader signed with my own keys and compiling it with Segger. Status as follows:

  • Public/private keys are created with “nrfutil keys generate”. Files are named as “private.pem” and “public_pem.c”.

  • Project “ruuvi.nrf5_sdk15_bootloader.c” is correctly structured as in its “README.md” file, and in fact it compiles flawlessly with the key pair provided by Ruuvi.

  • The unclear topic is exactly how to integrate my own keys on the project. README indiates to “use production version”.

Questions:
a. Where exactly on “Build options” to change between debug and production version? Couldn’t find it…
b. I wonder if you did actually meant change in “Preprocessor Definitions”? There is a NDEBUG statement at Solution level, which is inherited to Project level…
c. Should the file “dfu_public_key.c” be edited to have deleted its native public key and replaced by mine?

Many thans in advance.


#2

Hello,

I don’t remember it right now, but there is a flag along the lines of “DEBUG_BOOTLOADER”. It lets the bootloader to skip various version checks. SES might have build configurations “Debug” and “Release” which have these set.

Yes

yes


#3

Thanks, I ended up managing in simplest way which is by editing dfu_public_key.c.