This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU device_page_generator fails on Mesh SDK 2.0.1 when adding public key.

I'm adding key protection to DFU, a batch script is creating the bootloader_config_default.json. I'm using mesh SDK 2.0.1, but started developing using Mesh SDK 2.0.0. When I added public_key to my bootloader_config_default.json file device page generation fails. While testing with the device_page_generator.py from SDK 2.0.0 this was no issue. The only difference I can find are these: 

#LINE 69 of device_page_generator.py
#From Mesh SDK 2.0.0
            raise TypeError("Invalid type %r" % (type(data)))
#From Mesh SDK 2.0.1
            raise TypeError
#Line 99
#From Mesh SDK 2.0.0
        public_key = bytearray.fromhex(bootloader_config["public_key"]) \
#From Mesh SDK 2.0.1
        public_key = bootloader_config["public_key"] \

As I am not very "fluent" in Python I'm not sure if I can use the device page generator from the Mesh SDK 2.0.0. so please advise.

The error I get is as follows:

SDKROOT\Mesh\tools\dfu>python device_page_generator.py -d nrf52832_xxAA -sd "s132_6.0.0"
Traceback (most recent call last):
  File "device_page_generator.py", line 241, in <module>
    main()
  File "device_page_generator.py", line 235, in main
    write_specific_page(platforms, softdevices, args)
  File "device_page_generator.py", line 178, in write_specific_page
    device_page = DevicePage(platform, softdevice, bootloader_config)
  File "device_page_generator.py", line 94, in __init__
    self.generate_entries(platform, softdevice, bootloader_config)
  File "device_page_generator.py", line 103, in generate_entries
    DevicePageEntry(BLInfoType.ECDSA_PUBLIC_KEY, public_key))
  File "device_page_generator.py", line 69, in __init__
    raise TypeError
TypeError

Related