본문으로 바로가기

: nrfjprog 프로그램 사용법을 예제를 통해 익히기. 

   --version ,  --chiperase , --reset , --eraseall, --memrd , --log, --ids, --program, --erasepage,

    --verify, --readcode, --readregs

 

목차

     1> 이미지 쓰기

       : softdevice + bootloader + application + settings 만드는 방법은 생략합니다. (mergehex)

    nrfjprog -f nrf52 --chiperase --reset --program sd_bl_app_settings.hex
    Parsing image file.
    Erasing user available code and UICR flash areas.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Applying system reset.
    Run.

       ▶ --chiperase 옵션은 기존에 지워져 있는 상태라면  생략 가능합니다.

     

     erase 에러 메시지는 다음과 같습니다.

    Parsing image file.
    Reading flash area to program to guarantee it is erased.
    ERROR: The area to write is not erased.

     2> -v   or  --version

    D:\Project\SES\nrfutil>nrfjprog --version
    nrfjprog version: 10.12.2
    JLinkARM.dll version: 7.58b

     

     3> --eraseall 

       : flash 영역 전부지우기

    D:\Project\SES\nrfutil>nrfjprog -f nrf52 --eraseall
    Erasing user available code and UICR flash areas.
    Applying system reset.

     

     4> --memrd 

        :  주어진 addr 로 부터 n bytes 를 읽는데 사용합니다.

           width 옵션은 8,16,32 사용가능합니다.

     Syntax:

      --memrd <addr> [--w <width>] [--n <n>]

    더보기
    D:\Project\SES\nrfutil>nrfjprog  -f nrf52 --memrd 0x0007F000 --n 0x400
    0x0007F000: EC90B1C4 00000002 00000002 00000002   |................|
    0x0007F010: 00000000 00000000 000125E0 135F0916   |.........%...._.|
    0x0007F020: 00000001 00000000 00000000 00000000   |................|
    0x0007F030: 00000000 00000000 00000000 00000000   |................|
    0x0007F040: 00000000 00000000 00000000 00000000   |................|
    0x0007F050: 00000000 00000000 00000000 FFFFFFFF   |................|
    0x0007F060: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F070: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F080: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F090: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0A0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0B0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0C0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0D0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0E0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F100: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F110: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F120: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F130: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F140: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F150: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F160: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F170: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F180: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F190: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F1A0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F1B0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F1C0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F1D0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F1E0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F1F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F200: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F210: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F220: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F230: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F240: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F250: FFFFFFFF FFFFFFFF FFFFFFFF 45630936   |............6.cE|
    0x0007F260: FFFFFF00 FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F270: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F280: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F290: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F2A0: 091601FF FFFF135F FFFFFFFF FFFFFFFF   |...._...........|
    0x0007F2B0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F2C0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F2D0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F2E0: FF00FFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F2F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F300: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F310: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F320: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F330: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F340: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F350: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F360: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F370: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F380: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F390: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F3A0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F3B0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F3C0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F3D0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F3E0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F3F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    
    
    --w 옵션 테스트
    D:\Project\SES\nrfutil>nrfjprog -f nrf52 --memrd 0xff0 --n 0x20 --w 0x8
    0x00000FF0: FF FF FF FF FF FF FF FF 00 80 07 00 00 E0 07 00   |................|
    0x00001000: B8 13 00 20 19 53 02 00 19 C1 00 00 7F 52 02 00   |... .S.......R..|
    
    D:\Project\SES\nrfutil>nrfjprog -f nrf52 --memrd 0xff0 --n 0x20 --w 0x10
    0x00000FF0: FFFF FFFF FFFF FFFF 8000 0007 E000 0007   |................|
    0x00001000: 13B8 2000 5319 0002 C119 0000 527F 0002   |... .S.......R..|
    
    D:\Project\SES\nrfutil>nrfjprog -f nrf52 --memrd 0xff0 --n 0x20 --w 32
    0x00000FF0: FFFFFFFF FFFFFFFF 00078000 0007E000   |................|
    0x00001000: 200013B8 00025319 0000C119 0002527F   |... .S.......R..|
    
    >> Device identifier
    D:\Project\SES\nrfuti>nrfjprog -f nrf52 --memrd 0x10000060
    0x10000060: B00F6B3E                              |>k..|

     

     

       >> 참조 코드

    더보기
    typedef struct
    {
        uint32_t                image_size;         /**< Size of the image in the bank. */
        uint32_t                image_crc;          /**< CRC of the image. If set to 0, the CRC is ignored. */
        uint32_t                bank_code;          /**< Identifier code for the bank. */
    } nrf_dfu_bank_t;
    
    typedef struct
    {
        uint32_t command_size;              /**< The size of the current init command stored in the DFU settings. */
        uint32_t command_offset;            /**< The offset of the currently received init command data. The offset will increase as the init command is received. */
        uint32_t command_crc;               /**< The calculated CRC of the init command (calculated after the transfer is completed). */
        uint32_t data_object_size;          /**< The size of the last object created. Note that this size is not the size of the whole firmware image.*/
        union
        {
            struct
            {
                uint32_t firmware_image_crc;        /**< CRC value of the current firmware (continuously calculated as data is received). */
                uint32_t firmware_image_crc_last;   /**< The CRC of the last executed object. */
                uint32_t firmware_image_offset;     /**< The offset of the current firmware image being transferred. Note that this offset is the offset in the entire firmware image and not only the current object. */
                uint32_t firmware_image_offset_last;/**< The offset of the last executed object from the start of the firmware image. */
            };
            struct
            {
                uint32_t update_start_address;      /**< Value indicating the start address of the new firmware (before copy). It's always used, but it's most important for an SD/SD+BL update where the SD changes size or if the DFU process had a power loss when updating a SD with changed size. */
            };
        };
    } dfu_progress_t;
    
    typedef enum
    {
        NO_VALIDATION,
        VALIDATE_CRC,
        VALIDATE_SHA256,
        VALIDATE_ECDSA_P256_SHA256,
    } boot_validation_type_t;
    
    typedef struct
    {
        boot_validation_type_t type;
        uint8_t                bytes[SETTINGS_BOOT_VALIDATION_SIZE];
    } boot_validation_t;
    
    typedef struct
    {
        uint32_t            crc;                                    /**< CRC of the rest of the parameters in this struct. */
        ble_gap_id_key_t    ble_id;                                 /**< BLE GAP identity key of the device that initiated the DFU process. */
        ble_gap_enc_key_t   enc_key;                                /**< Encryption key structure containing encrypted diversifier and LTK for reestablishing the bond. */
        uint8_t             sys_serv_attr[SYSTEM_SERVICE_ATT_SIZE]; /**< System service attributes for restoring of Service Changed Indication setting in DFU mode. */
    } nrf_dfu_peer_data_t;
    
    typedef struct
    {
        uint32_t    crc;                            /**< CRC of the rest of the parameters in this struct. Calculated by the bootloader. */
        uint8_t     name[20];                       /**< New advertisement name to set. */
        uint32_t    len;                            /**< Length of the advertisement name. */
    } nrf_dfu_adv_name_t;
    
    typedef struct
    {
        uint32_t            crc;                /**< CRC for the stored DFU settings, not including the CRC itself. If 0xFFFFFFF, the CRC has never been calculated. */
        uint32_t            settings_version;   /**< Version of the current DFU settings struct layout. */
        uint32_t            app_version;        /**< Version of the last stored application. */
        uint32_t            bootloader_version; /**< Version of the last stored bootloader. */
    
        uint32_t            bank_layout;        /**< Bank layout: single bank or dual bank. This value can change. */
        uint32_t            bank_current;       /**< The bank that is currently used. */
    
        nrf_dfu_bank_t      bank_0;             /**< Bank 0. */
        nrf_dfu_bank_t      bank_1;             /**< Bank 1. */
    
        uint32_t            write_offset;       /**< Write offset for the current operation. */
        uint32_t            sd_size;            /**< Size of the SoftDevice. */
    
        dfu_progress_t      progress;           /**< Current DFU progress. */
    
        uint32_t            enter_buttonless_dfu;
        uint8_t             init_command[INIT_COMMAND_MAX_SIZE];  /**< Buffer for storing the init command. */
    
        uint32_t            boot_validation_crc;
        boot_validation_t   boot_validation_softdevice;
        boot_validation_t   boot_validation_app;
        boot_validation_t   boot_validation_bootloader;
    
        nrf_dfu_peer_data_t peer_data;          /**< Not included in calculated CRC. */
        nrf_dfu_adv_name_t  adv_name;           /**< Not included in calculated CRC. */
    } nrf_dfu_settings_t;

     

     5> --log

      a.log 파일에 log 남기기

    D:\Project\SES\nrfutil>nrfjprog -f nrf52 --memrd 0x7f000 --n 0x100 --log a.log
    0x0007F000: DEADC0DE F11E01FE FFFFFFFF FFFFFFFF   |................|
    0x0007F010: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F020: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F030: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F040: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F050: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F060: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F070: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F080: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F090: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0A0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0B0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0C0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0D0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0E0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|

     

     >> a.log 파일 내용은 아래와 같습니다.

    더보기
    [2022-Apr-26 17:30:30] [ info] --------------------------------------------------------------------------------
    [2022-Apr-26 17:30:30] [ info] nrfjprog -f nrf52 --memrd 0x7f000 --n 0x100 --log a.log 
    [2022-Apr-26 17:30:30] [ info] nrfjprog version 10.12.2 
    [2022-Apr-26 17:30:30] [ info] --------------------------------------------------------------------------------
    [2022-Apr-26 17:30:30] [debug] [ nRF0x0] - open_dll
    [2022-Apr-26 17:30:30] [ info] [ nRF0x0] - Load library at C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\JLINKARM_NRF52_NRFJPROG.dll.
    [2022-Apr-26 17:30:30] [ info] [ nRF0x0] - Library loaded, loading member functions.
    [2022-Apr-26 17:30:30] [ info] [ nRF0x0] - Member functions succesfully loaded.
    [2022-Apr-26 17:30:30] [ info] [Backend] - Logger callback at 0x7ff78ecf56f0 registered in Segger backend logger.
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Logger callback at 0x7ff78ecf56f0 registered in JLink logger.
    [2022-Apr-26 17:30:30] [debug] [nRF520x0] - open
    [2022-Apr-26 17:30:30] [debug] [Backend] - open_dll
    [2022-Apr-26 17:30:30] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
    [2022-Apr-26 17:30:30] [ info] [Backend] - Load library at C:\Program Files (x86)\SEGGER\JLink\JLink_x64.dll.
    [2022-Apr-26 17:30:30] [ info] [Backend] - Library loaded, loading member functions.
    [2022-Apr-26 17:30:30] [ info] [Backend] - Member functions succesfully loaded.
    [2022-Apr-26 17:30:30] [debug] [Backend] - dll_version
    [2022-Apr-26 17:30:30] [ info] [Backend] - Segger dll version 7.58.b loaded.
    [2022-Apr-26 17:30:30] [debug] [ nRF0x0] - enum_emu_snr
    [2022-Apr-26 17:30:30] [debug] [nRF520x0] - enum_emu_snr
    [2022-Apr-26 17:30:30] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-26 17:30:30] [debug] [Backend] - enum_emu_snr
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_enum_emu_snr
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_get_num_emus
    [2022-Apr-26 17:30:30] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-26 17:30:30] [debug] [ nRF0x0] - connect_to_emu_with_snr
    [2022-Apr-26 17:30:30] [debug] [nRF520x0] - connect_to_emu_with_snr
    [2022-Apr-26 17:30:30] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-26 17:30:30] [debug] [Backend] - connect_to_emu_with_snr
    [2022-Apr-26 17:30:30] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_enum_emu_snr
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_get_num_emus
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_connect_to_emu_with_snr
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_connect_to_emu_without_snr
    [2022-Apr-26 17:30:30] [ info] [Backend] - Segger logging enabled.
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Feb  2 2021 16:47:20
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Feb  2 2021 16:47:20
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Hardware: V1.00
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] S/N: 682577309
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] OEM: SEGGER
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] TELNET listener socket opened on port 19021
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] WEBSRV WEBSRV_Init(): Starting webserver thread(s)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] WEBSRV Failed to put socket into listener state (port 19080)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] WEBSRV Webserver running on local port 19081
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 20.677ms returns "O.K."  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_GetHWStatus(...)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.249ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("SetRestartOnClose = 0", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.008ms returns 0x01  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("DisableFlashDL", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.006ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.006ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetHookUnsecureDialog  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetHookUnsecureDialog(...)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.024ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_TIF_Select(JLINKARM_TIF_SWD)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.755ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetSpeed(2000)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.108ms  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_GetSN()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.011ms returns 682577309  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_load_core_data
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.006ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("device = nRF52", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] XML file found at: C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml 
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml evaluated successfully. 
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Device "NRF52" selected.
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Device "NRF52" selected.
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 70.767ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_debug_port_idr
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_debug_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - coresight_configure
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_Configure()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 1.228ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.371ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x00)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x2BA01477
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.446ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.009ms  
    [2022-Apr-26 17:30:30] [debug] [ nRF0x0] - read_device_version
    [2022-Apr-26 17:30:30] [debug] [nRF520x0] - read_device_info
    [2022-Apr-26 17:30:30] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.009ms returns 0x01  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-26 17:30:30] [debug] [nRF520x0] - Just_read_device_version
    [2022-Apr-26 17:30:30] [debug] [nRF520x0] - Just_readback_status
    [2022-Apr-26 17:30:30] [debug] [nRF520x0] - Just_is_ctrl_ap_available
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 5.375ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0xF0000040
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.506ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - Select AP 1, DP Bank 0, AP Bank 15
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x010000F0)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.412ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x02880000
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.414ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x02880000
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.450ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x02880000
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.436ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x02880000
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.407ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - Select AP 1, DP Bank 0, AP Bank 0
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x01000000)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.284ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000001
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.338ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000001
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.335ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000001
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.370ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000001
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.334ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [nRF520x0] - Protection status read as NONE
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_u32
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_connect_to_device
    [2022-Apr-26 17:30:30] [debug] [Backend] - is_connected_to_device
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsConnected()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.009ms returns FALSE  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_load_core_data
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.003ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("device = nRF52", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Device "NRF52" selected.
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Device "NRF52" selected.
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 1.075ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Connect()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] InitTarget() start
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] InitTarget() start
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ]  J-Link Script File: Executing InitTarget() 
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] InitTarget() end
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] InitTarget() end
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Found SW-DP with ID 0x2BA01477
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Found SW-DP with ID 0x2BA01477
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] DPIDR: 0x2BA01477
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] DPIDR: 0x2BA01477
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CoreSight SoC-400 or earlier
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CoreSight SoC-400 or earlier
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] AP map detection skipped. Manually configured AP map found.
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] AP map detection skipped. Manually configured AP map found.
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: AHB-AP (IDR: Not set)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: AHB-AP (IDR: Not set)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: Core found
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: Core found
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: AHB-AP ROM base: 0xE00FF000
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: AHB-AP ROM base: 0xE00FF000
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Found Cortex-M4 r0p1, Little endian.
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Found Cortex-M4 r0p1, Little endian.
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] -- Max. mem block: 0x000037B0
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE000EDF0)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE000EDF0)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE0002000)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] FPUnit: 6 code (BP) slots and 2 literal slots
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] FPUnit: 6 code (BP) slots and 2 literal slots
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE000EDFC)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE000EDFC)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE0001000)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE0001000)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE000ED88)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE000ED88)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE000ED88)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE000ED88)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CoreSight components:
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CoreSight components:
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] ROMTbl[0] @ E00FF000
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] ROMTbl[0] @ E00FF000
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(64 bytes @ 0xE00FF000)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE000EFE0)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE0001FE0)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE0002FE0)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE0000FE0)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE0040FE0)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE0041FE0)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][5]: E0041000 CID B105900D PID 000BB925 ETM
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] [0][5]: E0041000 CID B105900D PID 000BB925 ETM
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 131.685ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORE_GetFound()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.023ms returns 0xE0000FF  
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_u32
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_invalidate_cache
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("InvalidateCache", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.030ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ReadMemU32(0x10000130, 0x1 Items)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0x10000130)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Data:  06 00 00 00
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.728ms returns 1 (0x1)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_u32
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_connect_to_device
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_u32
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_invalidate_cache
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("InvalidateCache", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.016ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ReadMemU32(0x10000134, 0x1 Items)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0x10000134)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Data:  06 00 00 00
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.766ms returns 1 (0x1)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [nRF520x0] - Just_decode_device_version
    [2022-Apr-26 17:30:30] [debug] [Backend] - read_u32
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_connect_to_device
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_u32
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_invalidate_cache
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("InvalidateCache", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.015ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ReadMemU32(0x10000110, 0x1 Items)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0x10000110)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Data:  00 02 00 00
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.756ms returns 1 (0x1)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.022ms  
    [2022-Apr-26 17:30:30] [debug] [ nRF0x0] - read
    [2022-Apr-26 17:30:30] [debug] [nRF520x0] - read
    [2022-Apr-26 17:30:30] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.026ms returns 0x01  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-26 17:30:30] [debug] [nRF520x0] - Just_read
    [2022-Apr-26 17:30:30] [debug] [Backend] - read
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_connect_to_device
    [2022-Apr-26 17:30:30] [debug] [Backend] - is_connected_to_device
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsConnected()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.026ms returns TRUE  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-26 17:30:30] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.878ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Value=0xF0000040
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.450ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_halt
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Halt()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 6.744ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_read
    [2022-Apr-26 17:30:30] [debug] [Backend] - ---just_invalidate_cache
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("InvalidateCache", ...).   
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.017ms returns 0x00  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ReadMem(0x0007F000, 0x100 Bytes, ...)  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(256 bytes @ 0x0007F000)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ]  -- Updating C cache (256 bytes @ 0x0007F000)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ]  -- Read from C cache (256 bytes @ 0x0007F000)
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] Data:  DE C0 AD DE FE 01 1E F1 FF FF FF FF FF FF FF FF ...
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 4.174ms returns 0  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:30] [ info] [  JLink] - [Info    ] [JLink     ] - 0.023ms  
    [2022-Apr-26 17:30:31] [debug] [ nRF0x0] - close_dll
    [2022-Apr-26 17:30:31] [debug] [nRF520x0] - close
    [2022-Apr-26 17:30:31] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] - 0.022ms returns 0x01  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-26 17:30:31] [debug] [Backend] - close
    [2022-Apr-26 17:30:31] [debug] [Backend] - disconnect_from_emu
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_disconnect_from_emu
    [2022-Apr-26 17:30:31] [debug] [Backend] - is_connected_to_device
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsConnected()  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] - 0.013ms returns TRUE  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-26 17:30:31] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] - 0.391ms returns 0  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] Value=0xF0000040
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] - 0.277ms returns 0  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:31] [ info] [Backend] - Disable trace before closing connection.
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_write_u32
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_WriteU32_64(0xE000EDFC, 0x00000000)  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] Debug reg: DEMCR
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE000EDFC)
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] - 1.356ms returns 0 (0x00000000)  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-26 17:30:31] [ info] [Backend] - Shortcut, lock is on and debug region is powered.
    [2022-Apr-26 17:30:31] [debug] [Backend] - unpower_debug_and_system_regions
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_write_debug_port_register
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-26 17:30:31] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] - 0.252ms returns 0  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x01, 0x00000000)  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] - 0.244ms returns 0  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-26 17:30:31] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000040
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] - 0.411ms returns 0  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] - 0.015ms  
    [2022-Apr-26 17:30:31] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Close()  
    [2022-Apr-26 17:30:31] [debug] [Backend] - Segger Backend closed.
    [2022-Apr-26 17:30:31] [debug] [nRF520x0] - nRF family DLL closed

     

     6>  -i or --ids

       : 연결된 장치들의 시리얼넘버 표시

    D:\Project\SES\nrfutil>nrfjprog --ids
    682577309
    682329113

    >> 아래사진 참고하세요.

     

     7> --program

      7-1> application 쓰기

    D:\Project\SES\nrfutil>nrfjprog -f nrf52 --chiperase --reset --program app_v068.hex
    Parsing image file.
    Erasing user available code and UICR flash areas.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Applying system reset.
    Run.

     

      7-2> SoftDevice 쓰기

        : MBR 이 포함되어 있습니다.

    $>nrfjprog -f nrf52 --chiperase --reset --program s132_nrf52_7.2.0_softdevice.hex
    Parsing image file.
    Erasing user available code and UICR flash areas.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Applying system reset.
    Run.

     

     

     

      7-3> softdevice + application 쓰기

        : 2번에 나눠어 program 을 해야 합니다. chiperase 는 처음에만 넣어줍니다.

    $>nrfjprog -f nrf52 --chiperase --reset --program s132_nrf52_7.2.0_softdevice.hex
    Parsing image file.
    Erasing user available code and UICR flash areas.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Applying system reset.
    Run.
    
    ----> --chiperase 옵션 생략
    $>nrfjprog -f nrf52  --reset --program app_v068.hex
    Parsing image file.
    Reading flash area to program to guarantee it is erased.
    Checking that the area to write is not protected.
    Programming device.
    Applying system reset.
    Run.

     

     

      7-4> softdevice + application + bootloader 쓰기

       : 한개씩 이미지 쓰기는 동작 안함. mergehex 를 통해 이미지 병합후 사용해야함.

      ==> 1번 항목 참조

     

     

     8> --erasepage

     

        --erasepage <start[-end]>                      Erases the flash pages
                                starting at the flash page containing the start
                                address and ending at the page containing the end
                                address (not included in the erase). If end
                                address is not given, only one flash page will be
                                erased. If your device is equipped with a QSPI
                                peripheral, the pages to erase belong to the XIP
                                region of the device, and an external memory
                                device is present, this command erases 4 kB pages
                                from the external memory device. The first address
                                of the region is considered as address 0 of the
                                external memory device. To determine if an
                                external memory device is present, nrfjprog checks
                                the MemSize parameter from the QspiDefault.ini
                                file or from the QSPI configuration ini file given
                                with the --qspiini option.
                                Limitations:
                                For nRF51 devices, the page will not be erased if
                                it belongs to region 0.

     

      < 예제>

     

    위와 같은 메모리 영역 지우기 

      $> nrfjprog --erasepage 0x26000-0x3A000

     

     9> --verify

      :  이미지 파일 내용과 디바이스 안의 flash/RAM/UICR 안의 내용 비교시 사용합니다.

    >> verify 성공시 
    $>nrfjprog --verify sd_bl_app_settings.hex
    Parsing image file.
    Verifying programming.
    Verified OK.
    
    >> verify 실패시
    $>nrfjprog --verify sd_bl_app_settings_1.hex
    Parsing image file.
    Verifying programming.
    ERROR: Write verify failed.

       이미지 파일이 Softdevice && bootloader && app 으로 나눠지면 별도로 verify 를 진행할수 있습니다.

     

    >> Softdevice 비교
    $>nrfjprog --verify s132_nrf52_7.2.0_softdevice.hex
    Parsing image file.
    Verifying programming.
    Verified OK.
    
    >> bootloader 비교
    $>nrfjprog --verify bootloader.hex
    Parsing image file.
    Verifying programming.
    Verified OK.

     

     

     10> --readcode 

        : flash 의 내용을 읽어서 file 로 저장합니다.

    $>nrfjprog --readcode flash.hex
    Reading flash.
    Storing data in 'flash.hex'.
    
    $>nrfjprog --readcode flash.BIN
    Reading flash.
    Storing data in 'flash.BIN'.
    
    >> 저장할 이름의 확장자를 안적으면 에러가 발생합니다.
    $>nrfjprog --readcode flash
    Reading flash.
    Storing data in 'flash'.
     was not recognized as supported.
    ERROR: Command executed requires write permission in the current directory.
    
    >> 확장자도 잘못적으면 에러
    $>nrfjprog --readcode flash.TXT
    Reading flash.
    Storing data in 'flash.TXT'.
    .txt was not recognized as supported.
    ERROR: Command executed requires write permission in the current directory.

     

    11> --readregs

    D:\>nrfjprog -f nrf52 --readregs
              R0: 0x0000000000
              R1: 0x0000000000
              R2: 0x0000000000
              R3: 0x0000000000
              R4: 0x0000000000
              R5: 0x0000000000
              R6: 0x0000000000
              R7: 0x0000000000
              R8: 0x0000000000
              R9: 0x0000000000
             R10: 0x0000000000
             R11: 0x0000000000
             R12: 0x0000000000
              SP: 0x00FFFFFFFC
              LR: 0x00FFFFFFFF
              PC: 0x00FFFFFFFE
            xPSR: 0x0001000000
             MSP: 0x00FFFFFFFC
             PSP: 0x0000000000
             RAZ: 0x0000000000
            CFBP: 0x0000000000
            APSR: 0x0000000000
            EPSR: 0x0001000000
            IPSR: 0x0000000000

     

    <기타>

      A> help

    D:\Project\SES\nrfutil> nrfjprog
    
    Usage:
    -------------------------------------------------------------------------------
    
     -q  --quiet                 Reduces the stdout info. Must be combined with
                                 another command.
    
     -h  --help                  Displays this help.
    
     -v  --version               Displays the nrfjprog and dll versions.
    
         --log [<path>]          Enable logging.
                                 Default output file is "log.log".
                                 Set the <path> option to modify log file
                                 location and/or name.
                                 If the parent folder of <path> does not
                                 yet exist, nrfjprog will attempt to create it.
                                 Logger output is always appended
                                 to the file.
                                 Must be combined with another command.
    
         --jdll <file>           Uses the Segger's JLinkARM dll specified in the
                                 given file path instead of searching for the
                                 latest version of Segger's JLinkARM dll. Must be
                                 combined with another command.
                                 Limitations:
                                 Unicode paths are not supported
    
         --ini <file>            Uses the nrfjprog settings file specified in the
                                 given file path instead of searching for the
                                 default nrfjprog.ini file in the installation
                                 folder. Must be combined with another command.
    
         --qspiini <file>        Uses the QSPI settings file specified in the given
                                 file path instead of searching for the default
                                 QspiDefault.ini file in the installation folder.
                                 Must be combined with either --erasepage, --memrd,
                                 --memwr, --program, --verify, --readqspi or
                                 --qspieraseall commands.
                                 Limitations:
                                 For nRF51 devices, the operation is not available.
                                 For nRF52 devices, the operation is not available
                                 for devices without a QSPI peripheral.
                                 For nRF91 devices, the operation is not available
    
         --qspicustominit        Deprecated, this operation does nothing.
    
     -i  --ids                   Displays the serial numbers of all the debuggers
                                 connected to the PC.
    
         --com                   Displays a list of the serial port associated
                                 with all connected debuggers. If combined with
                                 --snr, it will display all comports associated
                                 with this debugger
    
         --deviceversion         Displays the type of device connected.
                                 If combined with --snr, it will display the device
                                 associated with this debugger
    
     -f  --family <family>       Selects the device family for the operation. Valid
                                 argument options are NRF51, NRF52, NRF53, NRF91,
                                 and UNKNOWN.
                                 If UNKNOWN family is given, an automatic family
                                 detection of the device is performed. Note that
                                 providing the actual family is faster than
                                 performing the automatic family detection. If
                                 --family option is not given, the default is taken
                                 from nrfjprog.ini. Must be combined with another
                                 command.
    
     -s  --snr <serial_number>   Selects the debugger with the given serial number
                                 among all those connected to the PC for the
                                 operation. Must be combined with another command.
    
     -c  --clockspeed <speed>    Sets the debugger SWD clock speed in kHz
                                 resolution for the operation. The valid clockspeed
                                 arguments go from 125 kHz to 50000 kHz. If given
                                 clockspeed is above the maxiumum clockspeed
                                 supported by the emulator, its maximum will be
                                 used instead. If --clockspeed option is not given,
                                 the default is taken from nrfjprog.ini. Must be
                                 combined with another command.
    
         --recover               Erases all user available non-volatile memory and
                                 disables the read back protection mechanism if
                                 enabled.
    
         --rbp <level>           Enables the readback protection mechanism. Valid
                                 argument options are CR0 and ALL.
                                 Limitations:
                                 For nRF52 devices, the CR0 argument option is
                                 invalid.
                                 Side effects:
                                 After an --rbp operation is performed, the
                                 available operations are reduced.
                                 For nRF51 devices, and if argument option ALL is
                                 used, --pinreset will not work on certain older
                                 devices.
                                 For nRF52 devices, only --pinreset, --debugreset
                                 or --recover operations are available after --rbp.
    
         --pinresetenable        Enables the pin reset by the use of UICR PSELRESET
                                 registers.
                                 Limitations:
                                 For nRF51 devices, the command is not available.
                                 For nRF53 devices, the command is not available.
                                 For nRF91 devices, the command is not available.
    
     -p  --pinreset              Performs a pin reset. Core will run after the
                                 operation.
    
     -r  --reset                 Performs a soft reset by setting the SysResetReq
                                 bit of the AIRCR register of the core. The core
                                 will run after the operation. Can be combined with
                                 the --program operation. If combined with the
                                 --program operation, the reset will occur after
                                 the flashing has occurred to start execution.
    
     -d  --debugreset            Performs a soft reset by the use of the CTRL-AP.
                                 The core will run after the operation. Can be
                                 combined with the --program operation. If combined
                                 with the --program operation, the debug reset will
                                 occur after the flashing has occurred to start
                                 execution.
                                 Limitations:
                                 For nRF51 devices, the --debugreset operation is
                                 not available.
                                 For nRF52 devices, the --debugreset operation is
                                 not available for nRF52832_xxAA_ENGA devices.
    
     -e  --eraseall              Erases all user available program flash memory and
                                 the UICR page. Can be combined with the
                                 --qspieraseall operation.
                                 Limitations:
                                 For nRF51 devices, if the device came from Nordic
                                 with a pre-programmed SoftDevice, only the user
                                 available code flash and UICR will be erased.
    
         --qspieraseall          Erases all the flash of the external memory device
                                 with the help of the QSPI peripheral. Note that
                                 depending on the external memory device's erase
                                 speed the operation might take minutes. Can be
                                 combined with the --eraseall operation.
                                 Limitations:
                                 For nRF51 devices, the operation is not available.
                                 For nRF52 devices, the operation is not available
                                 for devices without a QSPI peripheral.
                                 For nRF52 devices, the operation is only available
                                 for devices connected to an external memory
                                 device. To determine if an external memory device
                                 is connected, nrfjprog checks MemSize parameter
                                 from the QspiDefault.ini file or the QSPI
                                 configuration ini file that is given with the
                                 --qspiini option.
                                 For nRF91 devices, the operation is not available
    
         --eraseuicr             Erases the UICR page.
                                 Limitations:
                                 For nRF51 devices, the operation is available only
                                 if the device came from Nordic with a
                                 pre-programmed SoftDevice.
                                 For nRF91 devices, the operation is not available
                                 to erase uicr, please use --eraseall
    
         --erasepage <start[-end]>                      Erases the flash pages
                                 starting at the flash page containing the start
                                 address and ending at the page containing the end
                                 address (not included in the erase). If end
                                 address is not given, only one flash page will be
                                 erased. If your device is equipped with a QSPI
                                 peripheral, the pages to erase belong to the XIP
                                 region of the device, and an external memory
                                 device is present, this command erases 4 kB pages
                                 from the external memory device. The first address
                                 of the region is considered as address 0 of the
                                 external memory device. To determine if an
                                 external memory device is present, nrfjprog checks
                                 the MemSize parameter from the QspiDefault.ini
                                 file or from the QSPI configuration ini file given
                                 with the --qspiini option.
                                 Limitations:
                                 For nRF51 devices, the page will not be erased if
                                 it belongs to region 0.
    
         --program <hex_file> [--sectorerase | --chiperase | --sectoranduicrerase |
                                  --recover] [--qspisectorerase | --qspichiperase]
                                 Programs the specified image_file into the device.
                                 If the target area to program is not erased, the
                                 --program operation will fail unless an erase
                                 option is given. Valid erase operations for
                                 the internal flash memory are --recover,
                                  --sectorerase, --sectoranduicrerase and
                                  --chiperase. If --chiperase is given, all the
                                 available user non-volatile memory, including
                                 UICR, will be erased before programming. If
                                 --recover is given, all the available user
                                 non-volatile memory, including UICR, will
                                 be erased before programming, even if the
                                 device is readback protected.
                                 If --sectorerase is given, only the targeted
                                 non-volatile memory pages excluding UICR will
                                 be erased. If --sectoranduicrerase is given,
                                 only the targeted non-volatile memory pages
                                 including UICR will be erased. Note that the
                                 --sectoranduicrerase and --sectorerase
                                 operations normally take significantly longer time
                                 compared to --chiperase operation so use them with
                                 caution. If your device is equipped witha QSPI
                                 peripheral and an external memory device is
                                 present, data targeting the XIP region will be
                                 written to the external memory device.
                                 The first address of the XIP region
                                 is considered as address 0 of the external memory
                                 device. To determine if an external memory device
                                 is present, nrfjprog checks the MemSize paramter
                                 from QspiDefault.ini file or from the QSPI
                                 configuration ini file given with the --qspiini
                                 option. If the target area to program is not
                                 erased, the --program operation will fail unless
                                 an erase option is given. Valid erase operations
                                 for the external memory device are --qspichiperase
                                 and --qspisectorerase. If --qspichiperase is
                                 given, the external memory device will be erased.
                                 If the --qspisectorerase is given, only 4kB pages
                                 pages from the targeted external memory device
                                 will be erased. Note that --qspichiperase
                                 operation may take several minutes. The --program
                                 command can be combined with the --verify
                                 operation. It can also be combined with either the
                                 --reset or the --debugreset operations. the reset
                                 will occur after the flash operation in order to
                                 start the execution.
                                 Limitations:
                                 For nRF51 devices, the --sectoranduicrerase
                                 operation is not available.
                                 For nRF51 devices, if the image_file provided
                                 contains sectors belonging to region 0, the
                                 --program operation will fail.
                                 For nRF51 devices, the --qspisectorerase and
                                 --qspichiperase operations are not available.
                                 For nRF52 devices, the --qspisectorerase and
                                 --qspichiperase operations are not available
                                 unless the device is equipped with a QSPI
                                 peripheral and an external memory is connected. To
                                 determine if an external memory is present, the
                                 MemSize parameter from QspiDefault.ini file or
                                 from the QSPI configuration ini file given with
                                 the --qspiini option is evaluated.
                                 For nRF91 devices, the --qspisectorerase and
                                 --qspichiperase operations are not available.
    
         --memwr <addr> --val <val>                     Writes to the provided
                                 address in memory with the help of the NVM
                                 Controller or, if your device is equipped with a
                                 QSPI peripheral and the address to write belongs
                                 to the XIP region, with the help of the QSPI
                                 peripheral to an external memory device. To
                                 determine if an external memory device is present,
                                 nrfjprog checks the MemSize parameter from
                                 QspiDefault.ini file or the QSPI configuration ini
                                 file that is given with the --qspiini option.
                                 The first address of the region is considered as
                                 address 0 of the external memory device. If the
                                 target address is flash (either internal or in the
                                 external memory device) and not erased, the
                                 operation will fail. This command can be combined
                                 with the --verify operation.
    
         --ramwr <addr> --val <val>                     Writes to memory without
                                 the help of the NVM Controller to the provided
                                 address. If the target address is in non-volatile
                                 memory, --ramwr will have no effect unless the
                                 non-volatile memory controller (NVMC) has been
                                 previously configured by the user for a write
                                 operation. Can be combined with the --verify
                                 operation.
    
         --verify [<image_file>] [--fast]                 The provided image_file
                                 contents are compared with the contents in the
                                 device code flash, RAM, UICR and XIP regions for
                                 devices equipped with a QSPI peripheral connected
                                 to an external memory device, and fail if there is
                                 a mismatch. To determine if an external memory
                                 device is present, nrfjprog checks MemSize
                                 parameter from QspiDefault.ini file or from the
                                 QSPI configuration ini file given with the
                                 --qspiini option. If the optional --fast parameter
                                 is given, nrfjprog will calculate a hash of the
                                 flash target area using a sha256 algorithm and
                                 compare it to the expected hash instead of
                                 reading back the actual contents of the device's
                                 flash in order to speed the operation. It can be
                                 combined with the --program, --memwr and --ramwr
                                 operations if provided without the image_file
                                 parameter.
                                 Limitations:
                                 For nRF51 devices, the --fast verifying option
                                 is not available
                                 For nRF91 devices, the --fast verifying option
                                 is not available.
    
         --memrd <addr> [--w <width>] [--n <n>]         Reads n bytes from the
                                 provided address. If width is not given, 32-bit
                                 words will be read if addr is word aligned,
                                 16-bit words if addr is half word aligned, and
                                 8-bit words otherwise. If n is not given, one
                                 word of size width will be read. The address and
                                 n must be aligned to the width parameter. The
                                 maximum number of bytes that can be read is 1 MB.
                                 The width must be 8, 16 or 32. If your device is
                                 equipped with a QSPI peripheral, and the addresses
                                 to read belong to the XIP region, the QSPI
                                 peripheral is used to read from the external
                                 memory device if present. To determine if an
                                 external memory device is present, mrfjprog checks
                                 the MemSize parameter from QspiDefault.ini file or
                                 the QSPI configuration ini file that is given with
                                 the --qspiini option. The first address of the
                                 region is considered as address 0 of the external
                                 memory device.
                                 Limitations:
                                 A single --memrd instruction cannot be used to
                                 read addresses from both the external memory
                                 device and the nRF device.
    
         --halt                  Halts the CPU core.
    
         --run [--pc <pc_addr> --sp <sp_addr>]          Starts the CPU. If --pc and
                                 --sp options are given, the pc_addr and sp_addr
                                 are used as initial PC and stack pointer. For
                                 pc_addr to be valid its last bit must be one. For
                                 sp_addr to be valid it must be word aligned.
    
         --readuicr <file>       Reads the device UICR and stores it in the given
                                 file name. Can be combined with --readram,
                                 --readcode and --readqspi. If combined, only one
                                 instruction can provide a file name.
    
         --readcode <file>       Reads the device flash and stores it in the given
                                 file name. Can be combined with --readuicr,
                                 --readram and --readqspi. If combined, only one
                                 instruction can provide a file name.
    
         --readram <file>        Reads the device ram and stores it in the given
                                 file name. Can be combined with --readuicr,
                                 --readcode and --readqspi. If combined, only one
                                 instruction can provide a file name.
    
         --readqspi <file>       Reads the QSPI-connected external memory and
                                 stores it in the given file name. Can be combined
                                 with --readuicr, --readcode and --readram. If
                                 combined, only one instruction can provide a file
                                 name.
    
         --readregs              Reads the cpu registers.
    
         --coprocessor <coprocessor>                    Connects the device to the
                                 selected coprocessor. Valid arguments are
                                 CP_APPLICATION, CP_MODEM and CP_NETWORK.
                                 If --coprocessor option is not used,
                                 CP_APPLICATION will be the target of the other
                                 operation. Must be combined with another command.
                                 Limitations:
                                 For NRF51 devices, the -- coprocessor operation is
                                 not available.
                                 For NRF52 devices, the -- coprocessor operation is
                                 not available.

     

      B> Document

     

    nRF5x_Command_Line_Tools_v1.0.pdf
    0.17MB

     

     

     C> 에러 처리

     ▶  Failed while erasing device.  Access protection is  enabled

    C:\>nrfjprog -f nrf52 --chiperase --reset --program .\sd_bl_app_settings.hex
    [error] [ Client] - Encountered error -90: Command read_device_info executed for 15 milliseconds with result -90
    [error] [ Worker] - Access protection is enabled, can't read device version.
    [error] [ Client] - Encountered error -90: Command read_memory_descriptors executed for 12 milliseconds with result -90
    [error] [ Worker] - Can't read memory descriptors, ap-protection is enabled.
    [error] [ Client] - Encountered error -90: Command erase_file executed for 74 milliseconds with result -90
    [error] [  nRF52] - Failed while erasing device. -90: Access protection is enabled, can't read device version.
    [error] [ Worker] - Access protection is enabled, can't read device version.
    ERROR: The operation attempted is unavailable due to readback protection in
    ERROR: your device. Please use --recover to unlock the device.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    
    
    
    PS C:\> nrfjprog -f nrf52 --recover
    Recovering device. This operation might take 30s.
    Erasing user code and UICR flash areas.
    Writing image to disable ap protect.

      ==> --recover 명령이후 정상 동작하네요.

     

     

    오늘도 행복한 하루 보내세요.

    반응형