charliebruce / nrf5-docker-build

Docker environment for building nRF5 firmware.
MIT License
4 stars 2 forks source link

Consider to add nRF Command Line Tools #2

Closed stsdc closed 3 years ago

stsdc commented 3 years ago

nRF Command Line Tools

stsdc commented 3 years ago
wget --no-check-certificate -qO cmd_tools https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-11-1/nRFCommandLineTools10111Linuxamd64tar.gz && \
    tar zxf cmd_tools

They now provide a deb package so it is only apt install routine.

charliebruce commented 3 years ago

Hi - thanks for the suggestion. Do you want this specifically for nrfjprog? If so, this is a bit of a pain, as you also have to map the JLink USB device in to the Docker container. Not sure how well this works, I haven't tested - will give it a go if you want though.

If you want to use mergehex, the same functionality can be achieved with srec_cat which is already installed in the Docker images. Eg:

srec_cat $(SOFTDEVICE) -intel $(BOOTLOADER) -intel $(APPLICATION) -intel -o complete-firmware.hex -intel -address-length=4
stsdc commented 3 years ago

If you want to be able to use the combined hex file with nRF Connect you should use Nordic's mergehex tool, that's why :c I'm not going to use it with real device. Only to build on CI.

charliebruce commented 3 years ago

I believe that: srec_cat $(SOFTDEVICE) -intel $(BOOTLOADER) -intel $(APPLICATION) -intel -o complete-firmware.hex -intel -address-length=4 should produce identical results to mergehex -m $(SOFTDEVICE) $(BOOTLOADER) $(APPLICATION) -o complete-firmware.hex

The reason I used srec_cat instead of including mergehex was that Nordic's tool has a limitation of 3 hex files. Additionally, srecord has some more advanced outputs, including converting binary files to C arrays.

Have you tried using srecord and had issues with nRF Connect as a result? If so, would be happy to take a look.

stsdc commented 3 years ago

I'll check this out. Thanks.

stsdc commented 3 years ago

Hello, @charliebruce ! Please look at the discussion on https://github.com/OpenSource-EBike-firmware/TSDZ2_wireless/pull/22

charliebruce commented 3 years ago

We got this working without needing mergehex - no need to add this tool in the end.