Generate and provision the device certificate

I use this code " node cli create-and-provision-device-cert"


But I am using nrf9160 ,so therefore I change this code to "node cli create-and-provision-device-cert --dk "


Now to change the default port to /dev/sdc ,I run command  "node cli create-and-provision-device-cert --dk  -p /dev/sdc" 

It showing error of "Error: Invalid argument setting custom baud rate of 115200"

                                                                      

Help me to change the port, and change all default value from thingy91 to  nrf9160

Parents
  • Hi, 

    Are you trying to program an nRF9160 DK? Can you please run --debug as well

    node cli create-and-provision-device-cert --dk --debug

    Kind regards,
    Øyvind

  • Yes I am programming nRF9160 DK 

    I have run --debug and it shows error

                     

  • Please provide full log, not screenshot, from where you called the command. 

    sachinrawat said:
    Yes I am programming nRF9160 DK 

    What version of the nRF9160 DK are you using?

    Our Asset Tracker developers are currently out of office, which means that I do not have an answer before Monday I'm afraid.

  • This is full log,Sorry I can't be able to take screenshot so I copy paste it

    sachin@Inspiron-3647:/nrf-asset-tracker/azure$ node cli create-and-provision-device-cert --dk --debug
    Flasing certificate /dev/ttyACM0
    Connecting to /dev/ttyACM0
    Inactivity timeout 10 seconds
    /dev/ttyACM0 connected
    AT Host h
    w4 4001e504 2
    w4 4001e50c 1
    sleep 100
    rx 1000
    h
    w4 4001e504 1
    loadfile /nrf-asset-tracker/azure/node_modules/@nordicsemiconductor/firmware-ci-device-helpers/at_host/91dk_at_host_increased_buf.hex
    rx 1000
    g
    exit
    AT Host SEGGER J-Link Commander V7.64b (Compiled Apr 8 2022 15:30:21)
    AT Host DLL version V7.64b, compiled Apr 8 2022 15:30:06
    AT Host J-Link Command File read successfully.
    AT Host Processing script file...
    AT Host J-Link>h
    AT Host J-Link connection not established yet but required for command.
    AT Host Connecting to J-Link via USB...
    AT Host O.K.
    AT Host Firmware: J-Link OB-K22-NordicSemi compiled Dec 3 2021 15:46:55
    AT Host Hardware version: V1.00
    AT Host S/N: 960073719
    AT Host License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    AT Host VTref=3.300V
    AT Host Target connection not established yet but required for command.
    AT Host Device "NRF9160_XXAA" selected.
    AT Host Connecting to target via SWD
    AT Host ConfigTargetSettings() start
    AT Host ---Setting ROM table---
    AT Host ConfigTargetSettings() end
    AT Host Found SW-DP with ID 0x6BA02477
    AT Host DPIDR: 0x6BA02477
    AT Host CoreSight SoC-400 or earlier
    AT Host Scanning AP map to find all available APs
    AT Host AP[7]: Stopped AP scan as end of AP map has been reached
    AT Host AP[0]: AHB-AP (IDR: 0x84770001)
    AT Host AP[1]: AHB-AP (IDR: 0x24770011)
    AT Host AP[2]: JTAG-AP (IDR: 0x12880000)
    AT Host AP[3]: APB-AP (IDR: 0x54770002)
    AT Host AP[4]: JTAG-AP (IDR: 0x12880000)
    AT Host AP[5]: JTAG-AP (IDR: 0x12880000)
    AT Host AP[6]: MEM-AP (IDR: 0x128800A1)
    AT Host Iterating through AP map to find AHB-AP to use
    AT Host AP[0]: Core found
    AT Host AP[0]: AHB-AP ROM base: 0xE00FF000
    AT Host CPUID register: 0x410FD212. Implementer code: 0x41 (ARM)
    AT Host Feature set: Mainline
    AT Host Found Cortex-M33 r0p2, Little endian.
    AT Host FPUnit: 8 code (BP) slots and 0 literal slots
    AT Host Security extension: implemented
    AT Host Secure debug: enabled
    AT Host CoreSight components:
    AT Host ROMTbl[0] @ E00FF000
    AT Host [0][0]: E000E000 CID B105900D PID 000BBD21 DEVARCH 47702A04 DEVTYPE 00 Cortex-M33
    AT Host [0][1]: E0001000 CID B105900D PID 000BBD21 DEVARCH 47701A02 DEVTYPE 00 DWT
    AT Host [0][2]: E0002000 CID B105900D PID 000BBD21 DEVARCH 47701A03 DEVTYPE 00 FPB
    AT Host [0][3]: E0000000 CID B105900D PID 000BBD21 DEVARCH 47701A01 DEVTYPE 43 ITM
    AT Host [0][5]: E0041000 CID B105900D PID 002BBD21 DEVARCH 47724A13 DEVTYPE 13 ETM
    AT Host [0][6]: E0042000 CID B105900D PID 000BBD21 DEVARCH 47701A14 DEVTYPE 14 CSS600-CTI
    AT Host Cortex-M33 identified.
    AT Host PC = 00011AB6, CycleCnt = 00107104
    AT Host R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    AT Host R4 = 20014FE0, R5 = 00000000, R6 = 00000000, R7 = 00000000
    AT Host R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    AT Host R12= 1DD1C032
    AT Host SP(R13)= 20018720, MSP= 20018F30, PSP= 20018720, R14(LR) = 00018969
    AT Host XPSR = 61000000: APSR = nZCvq, EPSR = 01000000, IPSR = 000 (NoException)
    AT Host CFBP = 02000001, CONTROL = 02, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 01
    AT Host MSPLIM = 20018730
    AT Host PSPLIM = 200185F0
    AT Host Security extension regs:
    AT Host MSP_S = 20002E38, MSP_NS = 20018F30
    AT Host MSPLIM_S = 20002638, MSPLIM_NS = 20018730
    AT Host PSP_S = 20002418, PSP_NS = 20018720
    AT Host PSPLIM_S = 200014F8, PSPLIM_NS = 200185F0
    AT Host CONTROL_S = 02, FAULTMASK_S = 00, BASEPRI_S = 00, PRIMASK_S = 00
    AT Host CONTROL_NS = 02, FAULTMASK_NS = 00, BASEPRI_NS = 00, PRIMASK_NS = 01
    AT Host FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000
    AT Host FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000
    AT Host FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000
    AT Host FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= 00000000
    AT Host FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000
    AT Host FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000
    AT Host FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000
    AT Host FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000
    AT Host FPSCR= 00000000
    AT Host J-Link>w4 4001e504 2
    AT Host Writing 00000002 -> 4001E504
    AT Host J-Link>w4 4001e50c 1
    AT Host Writing 00000001 -> 4001E50C
    AT Host J-Link>sleep 100
    AT Host Sleep(100)
    AT Host J-Link>rx 1000
    AT Host Reset delay: 1000 ms
    AT Host Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    AT Host Reset: ARMv8M core with Security Extension enabled detected.
    AT Host Reset: Halt core after reset via DEMCR.VC_CORERESET.
    AT Host Reset: Reset device via AIRCR.SYSRESETREQ.
    AT Host J-Link>h
    AT Host PC = 000022BC, CycleCnt = 00000000
    AT Host R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    AT Host R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    AT Host R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    AT Host R12= 1DD1C032
    AT Host SP(R13)= 200024F8, MSP= 200024F8, PSP= 00000000, R14(LR) = FFFFFFFF
    AT Host XPSR = F9000000: APSR = NZCVQ, EPSR = 01000000, IPSR = 000 (NoException)
    AT Host CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
    AT Host MSPLIM = 00000000
    AT Host PSPLIM = 00000000
    AT Host Security extension regs:
    AT Host MSP_S = 200024F8, MSP_NS = 00000000
    AT Host MSPLIM_S = 00000000, MSPLIM_NS = 00000000
    AT Host PSP_S = 00000000, PSP_NS = 20018720
    AT Host PSPLIM_S = 00000000, PSPLIM_NS = 00000000
    AT Host CONTROL_S = 00, FAULTMASK_S = 00, BASEPRI_S = 00, PRIMASK_S = 00
    AT Host CONTROL_NS = 00, FAULTMASK_NS = 00, BASEPRI_NS = 00, PRIMASK_NS = 00
    AT Host FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000
    AT Host FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000
    AT Host FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000
    AT Host FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= 00000000
    AT Host FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000
    AT Host FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000
    AT Host FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000
    AT Host FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000
    AT Host FPSCR= 00000000
    AT Host J-Link>w4 4001e504 1
    AT Host Writing 00000001 -> 4001E504
    AT Host J-Link>loadfile /nrf-asset-tracker/azure/node_modules/@nordicsemiconductor/firmware-ci-device-helpers/at_host/91dk_at_host_increased_buf.hex
    AT Host Downloading file [/nrf-asset-tracker/azure/node_modules/@nordicsemiconductor/firmware-ci-device-helpers/at_host/91dk_at_host_increased_buf.hex]...
    AT Host Comparing flash [000%]
    AT 050%]
    AT 050%]
    AT 100%] Done.
    AT Host J-Link: Flash download: Bank 2 @ 0x00000000: Skipped. Contents already match
    AT Host O.K.
    AT Host J-Link>rx 1000
    AT Host Reset delay: 1000 ms
    AT Host Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    AT Host Reset: ARMv8M core with Security Extension enabled detected.
    AT Host Reset: Halt core after reset via DEMCR.VC_CORERESET.
    AT Host Reset: Reset device via AIRCR.SYSRESETREQ.
    AT Host J-Link>g
    AT Host J-Link>exit
    AT Host Script processing completed.
    /dev/ttyACM0 *** Booting Zephyr OS build v2.7.0-ncs1 ***
    /dev/ttyACM0 Flash regions Domain Permissions
    /dev/ttyACM0 00 01 0x00000 0x10000 Secure rwxl
    /dev/ttyACM0 02 31 0x10000 0x100000 Non-Secure rwxl
    /dev/ttyACM0 Non-secure callable region 0 placed in flash region 1 with size 32.
    /dev/ttyACM0 SRAM region Domain Permissions
    /dev/ttyACM0 00 07 0x00000 0x10000 Secure rwxl
    /dev/ttyACM0 08 31 0x10000 0x40000 Non-Secure rwxl
    /dev/ttyACM0 Peripheral Domain Status
    /dev/ttyACM0 00 NRF_P0 Non-Secure OK
    /dev/ttyACM0 01 NRF_CLOCK Non-Secure OK
    /dev/ttyACM0 02 NRF_RTC0 Non-Secure OK
    /dev/ttyACM0 03 NRF_RTC1 Non-Secure OK
    /dev/ttyACM0 04 NRF_NVMC Non-Secure OK
    /dev/ttyACM0 05 NRF_UARTE1 Non-Secure OK
    /dev/ttyACM0 06 NRF_UARTE2 Secure SKIP
    /dev/ttyACM0 07 NRF_TWIM2 Non-Secure OK
    /dev/ttyACM0 08 NRF_SPIM3 Non-Secure OK
    /dev/ttyACM0 09 NRF_TIMER0 Non-Secure OK
    /dev/ttyACM0 10 NRF_TIMER1 Non-Secure OK
    /dev/ttyACM0 11 NRF_TIMER2 Non-Secure OK
    /dev/ttyACM0 12 NRF_SAADC Non-Secure OK
    /dev/ttyACM0 13 NRF_PWM0 Non-Secure OK
    /dev/ttyACM0 14 NRF_PWM1 Non-Secure OK
    /dev/ttyACM0 15 NRF_PWM2 Non-Secure OK
    /dev/ttyACM0 16 NRF_PWM3 Non-Secure OK
    /dev/ttyACM0 17 NRF_WDT Non-Secure OK
    /dev/ttyACM0 18 NRF_IPC Non-Secure OK
    /dev/ttyACM0 19 NRF_VMC Non-Secure OK
    /dev/ttyACM0 20 NRF_FPU Non-Secure OK
    /dev/ttyACM0 21 NRF_EGU0 Non-Secure OK
    /dev/ttyACM0 22 NRF_EGU1 Non-Secure OK
    /dev/ttyACM0 23 NRF_EGU2 Non-Secure OK
    /dev/ttyACM0 24 NRF_EGU3 Non-Secure OK
    /dev/ttyACM0 25 NRF_EGU4 Non-Secure OK
    /dev/ttyACM0 26 NRF_EGU5 Non-Secure OK
    /dev/ttyACM0 27 NRF_DPPIC Non-Secure OK
    /dev/ttyACM0 28 NRF_REGULATORS Non-Secure OK
    /dev/ttyACM0 29 NRF_PDM Non-Secure OK
    /dev/ttyACM0 30 NRF_I2S Non-Secure OK
    /dev/ttyACM0 31 NRF_GPIOTE1 Non-Secure OK
    /dev/ttyACM0 SPM: NS image at 0x10000
    /dev/ttyACM0 SPM: NS MSP at 0x200185f0
    /dev/ttyACM0 SPM: NS reset vector at 0x11ff5
    /dev/ttyACM0 SPM: prepare to jump to Non-Secure image.
    /dev/ttyACM0 *** Booting Zephyr OS build v2.7.0-ncs1 ***
    /dev/ttyACM0 The AT host sample started
    /dev/ttyACM0 AT> AT+CGSN=1
    /dev/ttyACM0 +CGSN: "352656106650834"
    /dev/ttyACM0 <AT +CGSN: "352656106650834"
    /dev/ttyACM0 OK
    /dev/ttyACM0 <AT OK
    IMEI: 352656106650834
    /dev/ttyACM0 AT> AT+CGMR
    /dev/ttyACM0 mfw_nrf9160_1.3.1
    /dev/ttyACM0 <AT mfw_nrf9160_1.3.1
    /dev/ttyACM0 OK
    /dev/ttyACM0 <AT OK
    /dev/ttyACM0 AT> AT+CGSN=1
    /dev/ttyACM0 +CGSN: "352656106650834"
    /dev/ttyACM0 <AT +CGSN: "352656106650834"
    /dev/ttyACM0 OK
    /dev/ttyACM0 <AT OK
    /dev/ttyACM0 AT> AT+CFUN=4
    /dev/ttyACM0 OK
    /dev/ttyACM0 <AT OK
    /dev/ttyACM0 AT> AT%KEYGEN=42,2,0,"CN=352656106650834","101010000"
    /dev/ttyACM0 ERROR
    /dev/ttyACM0 <AT ERROR
    ERROR create-and-provision-device-cert failed!
    ERROR AT command AT%KEYGEN=42,2,0,"CN=352656106650834","101010000" failed on /dev/ttyACM0: ERROR after write.
    sachin@Inspiron-3647:/nrf-asset-tracker/azure$

    Sorry I didn't understand what type of version are you talking about , I am using nRF9160 DK 

              

  • Our Azure expert and Asset Tracker v2 developer is currently out of office, but will try to find some answers to you.

    In the meantime can you please try with the Azure IoT Hub sample, following the steps provided in the Azure IoT Hub library

    Kind regards,
    Øyvind

Reply Children
Related