Getting errors with nRF Connect sample project 'SMP Server Sample'

My environment:

nRF Connect version 2.1.0
Board: nrf52840 DK
Host: MacOS 12.6

Trying to use the Zephyr sample project called SMP Server Sample. The instructions are here:

http://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html

The project path is here:

/opt/nordic/ncs/v2.1.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr

These steps worked without error: 

  1. Build bootloader
  2. flash bootloader
  3. Build sample application

When I try to sign the sample application I get an error.

(base) √ smp_svr % west sign -t imgtool -- --key ../../../../../../bootloader/mcuboot/root-rsa-2048.pem                                  
=== image configuration:
partition offset: 49152 (0xc000)
partition size: 421888 (0x67000)
rom start offset: 0 (0x0)
=== signing binaries
unsigned bin: /opt/nordic/ncs/v2.1.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/build/zephyr/zephyr.bin
signed bin:   /opt/nordic/ncs/v2.1.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/build/zephyr/zephyr.signed.bin
Usage: imgtool sign [OPTIONS] INFILE OUTFILE

Error: Invalid value for '-H' / '--header-size': Minimum value for -H/--header-size is 32
FATAL ERROR: command exited with status 2: /opt/nordic/ncs/toolchains/v2.1.0/bin/imgtool sign --version 0.0.0+0 --align 4 --header-size 0 --slot-size 421888 --key ../../../../../../bootloader/mcuboot/root-rsa-2048.pem /opt/nordic/ncs/v2.1.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/build/zephyr/zephyr.bin /opt/nordic/ncs/v2.1.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/build/zephyr/zephyr.signed.bin
(base) ?2 smp_svr % pwd
/opt/nordic/ncs/v2.1.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr

When I read the help for imgtool I found this:

The image header size, alignment, and slot sizes are determined from
the build directory using .config and the device tree. A default
version number of 0.0.0+0 is used (which can be overridden by passing
"--version x.y.z+w" after "--key"). As shown above, extra arguments
after a '--' are passed to imgtool directly.

Not sure how to fix the problem. 

Parents
  • Getting same error with SDK v2.0.2

    (base) √ v2.0.2 % west sign -t imgtool -d build_smp_svr -- --key bootloader/mcuboot/root-rsa-2048.pem 
    === image configuration:
    partition offset: 49152 (0xc000)
    partition size: 421888 (0x67000)
    rom start offset: 0 (0x0)
    === signing binaries
    unsigned bin: /opt/nordic/ncs/v2.0.2/build_smp_svr/zephyr/zephyr.bin
    signed bin:   /opt/nordic/ncs/v2.0.2/build_smp_svr/zephyr/zephyr.signed.bin
    Usage: imgtool sign [OPTIONS] INFILE OUTFILE
    
    Error: Invalid value for '-H' / '--header-size': Minimum value for -H/--header-size is 32
    FATAL ERROR: command exited with status 2: /opt/nordic/ncs/toolchains/v2.0.2/bin/imgtool sign --version 0.0.0+0 --align 4 --header-size 0 --slot-size 421888 --key bootloader/mcuboot/root-rsa-2048.pem /opt/nordic/ncs/v2.0.2/build_smp_svr/zephyr/zephyr.bin /opt/nordic/ncs/v2.0.2/build_smp_svr/zephyr/zephyr.signed.bin
    

Reply
  • Getting same error with SDK v2.0.2

    (base) √ v2.0.2 % west sign -t imgtool -d build_smp_svr -- --key bootloader/mcuboot/root-rsa-2048.pem 
    === image configuration:
    partition offset: 49152 (0xc000)
    partition size: 421888 (0x67000)
    rom start offset: 0 (0x0)
    === signing binaries
    unsigned bin: /opt/nordic/ncs/v2.0.2/build_smp_svr/zephyr/zephyr.bin
    signed bin:   /opt/nordic/ncs/v2.0.2/build_smp_svr/zephyr/zephyr.signed.bin
    Usage: imgtool sign [OPTIONS] INFILE OUTFILE
    
    Error: Invalid value for '-H' / '--header-size': Minimum value for -H/--header-size is 32
    FATAL ERROR: command exited with status 2: /opt/nordic/ncs/toolchains/v2.0.2/bin/imgtool sign --version 0.0.0+0 --align 4 --header-size 0 --slot-size 421888 --key bootloader/mcuboot/root-rsa-2048.pem /opt/nordic/ncs/v2.0.2/build_smp_svr/zephyr/zephyr.bin /opt/nordic/ncs/v2.0.2/build_smp_svr/zephyr/zephyr.signed.bin
    

Children
No Data
Related