Secure Provisioning Tool v3 fails to write image

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Secure Provisioning Tool v3 fails to write image

952 Views
kanimozhi_t
Contributor V

Hi,

I recently downloaded the latest MCUXpresso Secure Provisioning Tool version 3[b210414] for Ubuntu 20.04 and it fails while writing the secure image to the connected i.MX RT 1060 (GENERAL ERROR:unpack_from requires a buffer of at least 4 bytes for unpacking 4 bytes at offset 0 (actual buffer size is 2)blhost failed).

I've been using the version 2 without any problem for some time now. So my question is there a known bug in the latest version on Linux?

Error log is attached for your kind reference.

    ### Parse input arguments ###
    ### Check presence of FlashLoader ###
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk /opt/nxp/MCUX_Provi_v3/bin
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk/blhost -u 0x15A2,0x0073 -j -- get-property 1 0
    /opt/nxp/MCUX_Provi_v3/bin
    {
       "command": "get-property",
       "response": [
          1258422528
       ],
       "status": {
          "description": "0 (0x0) Success.",
          "value": 0
       }
    }
    blhost succeeded
    ### Configure target memory using options on address 0x2000 ###
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk /opt/nxp/MCUX_Provi_v3/bin
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk/blhost -u 0x15A2,0x0073 -j -- fill-memory 0x2000 4 0xC0000007 word
    /opt/nxp/MCUX_Provi_v3/bin
    {
       "command": "fill-memory",
       "response": [],
       "status": {
          "description": "0 (0x0) Success.",
          "value": 0
       }
    }
    blhost succeeded
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk /opt/nxp/MCUX_Provi_v3/bin
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk/blhost -u 0x15A2,0x0073 -j -- fill-memory 0x2004 4 0x00000000 word
    /opt/nxp/MCUX_Provi_v3/bin
    {
       "command": "fill-memory",
       "response": [],
       "status": {
          "description": "0 (0x0) Success.",
          "value": 0
       }
    }
    blhost succeeded
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk /opt/nxp/MCUX_Provi_v3/bin
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk/blhost -u 0x15A2,0x0073 -j -- configure-memory 9 0x2000
    /opt/nxp/MCUX_Provi_v3/bin
    {
       "command": "configure-memory",
       "response": [],
       "status": {
          "description": "0 (0x0) Success.",
          "value": 0
       }
    }
    blhost succeeded
    ### Erase memory before writing image ###
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk /opt/nxp/MCUX_Provi_v3/bin
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk/blhost -u 0x15A2,0x0073 -j -- flash-erase-region 0x60000000 32768 9
    /opt/nxp/MCUX_Provi_v3/bin
    {
       "command": "flash-erase-region",
       "response": [],
       "status": {
          "description": "0 (0x0) Success.",
          "value": 0
       }
    }
    blhost succeeded
    ### Use tag 0xF000000F to notify FlashLoader to program FlexSPI NOR config block to the start of device ###
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk /opt/nxp/MCUX_Provi_v3/bin
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk/blhost -u 0x15A2,0x0073 -j -- fill-memory 0x3000 4 0xF000000F word
    /opt/nxp/MCUX_Provi_v3/bin
    {
       "command": "fill-memory",
       "response": [],
       "status": {
          "description": "0 (0x0) Success.",
          "value": 0
       }
    }
    blhost succeeded
    ### Program configuration block ###
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk /opt/nxp/MCUX_Provi_v3/bin
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk/blhost -u 0x15A2,0x0073 -j -- configure-memory 9 0x3000
    /opt/nxp/MCUX_Provi_v3/bin
    {
       "command": "configure-memory",
       "response": [],
       "status": {
          "description": "0 (0x0) Success.",
          "value": 0
       }
    }
    blhost succeeded
    ### Write image ###
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk /opt/nxp/MCUX_Provi_v3/bin
    /opt/nxp/MCUX_Provi_v3/bin/tools/spsdk/blhost -u 0x15A2,0x0073 -j -- write-memory 0x60001000 /home/ux/secure_provisioning_1060/bootable_images/evkmimxrt1060_hello_world_nopadding.bin 9
    /opt/nxp/MCUX_Provi_v3/bin
    GENERAL ERROR:unpack_from requires a buffer of at least 4 bytes for unpacking 4 bytes at offset 0 (actual buffer size is 2)
    blhost failed

 

Labels (1)
0 Kudos
Reply
2 Replies

944 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello kanimozhi_t,

Allow me to check if we have reports of this being a known issue. I will let you know as soon as I have more information.

Regards,
Gustavo

0 Kudos
Reply

940 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello kanimozhi_t,,

The suggestion from the SPT team is to replace the spsdk blhost tool by legacy tool and check if the issue is still reproducible.

This can be done by editing the file MCUX_Provi_v3/bin/data/targets/MIMXRT1060/MIMXRT1060.json in a text editor and at the end of the file change:

        "blhost": {

            "type": "spsdk",

To:

        "blhost": {

            "type": "legacy",

then restart the SPT tool.

Even if this workaround help, would you please post your issue on the SPT Tool Support Community (link below) and include your application binary is possible? This would allow the SPT team to try to replicate this issue so that they can fix it natively (without having to use the legacy workaround).

https://community.nxp.com/t5/MCUXpresso-Secure-Provisioning/bd-p/mcux-secure-tool

I hope that this helps and thank you for pointing this out!

Regards,
Gustavo

0 Kudos
Reply