case about nRF52820 uart dfu

Hi,

1.Please help me complete example pca10100e_uart

2.I am testing the nRF52820 UART DFU example

3.The example is named pca10100e_uart based on example pca10040_uart

4.The following problems occurred in the test:

5.I suspect my memory address is set incorrectly:

6.Please give me the correct nRF52820 memory address, As shown in the figure below

https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader.html

sdk nRF5_SDK_17.1.0_ddde560

code:

Thank you for all your assistance.
Kind regards,
Peter.Min

  • Hello,

    It seems I never tried to build a bootloader for the nRF52820 (at least with Keil), because I was not able to compile your project. Do you happen to know where to get the file that it claims to be missing (It is evening, and I am sitting at home. I can reach out to some colleagues tomorrow if I don't find it). I assume that you have what you need to compile, other than the 

    However, I see that the array that you refer to is missing the nRF52820. However, the nRF52820 has different flash and RAM sizes from the other devices. As you can see here, it has 256 kB flash and 32kB RAM. This means that the flash is on the address:

    0x0000 0000 -> 0x0004 0000

    And the RAM is on the address:

    0x2000 0000 -> 0x2000 8000

    So an appropriate set of the bootloader's memory segments should be somthing like:

    Bootloader settings: 0x0003 F000 -> 0x0004 0000

    MBT parameter storage: 0x0003 E000 -> 0x0003 F000

    Bootloader: 0x0003 8000 -> 0x0003 E000

    Application area (depending on the softdevice that you use, but if you are using only MBR) : 0x0001 0000 -> however large you need, but less than 0x0003 F000. You don't need to specify the top.

    Master Boot Record (MBR) 0x0000 0000 -> 0x0000 1000

    SoftDevice -

    If you intend to have a softdevice, your softdevice will replace the MBR, and the application will start after the softdevice. E.g. if you use the S112 from SDK17.1.0:

    Softdevice: (which includes MBR) 0x0000 0000 -> 0x0002 8000

    This leaves this flash for the application: 0x0002 8000 -> 0x0003 8000 (NB: Only 64kB).

    I hope this clears things up a bit. Let me know if anything was unclear.

    BR,

    Edvin

  • Hi  Edvin,

    1. I make sure I set up the correct addresses

    2. During the debug process, it is found that the program does not run to the main entrance of the bootloader

    3. I used nRF52820 module for testing

    4. Is there anything else that needs to be changed?

    5. Other s112 + MBR = 100 KB

    6.Calculate the application available space

    settings = 4kb

    mbr data = 4kb

    bootloader =24kb

    application = ?

    softdevice = 96kb

    mbr = 4kb

    Application free space: 256-4-4-24-96-4= 124KB

    7.The address before the error was reported is as follows:

    Thank you for all your assistance.
    Kind regards,
    Peter.Min

  • Hi  Edvin,

    1. I make sure I set up the correct addresses

    2. During the debug process, it is found that the program does not run to the main entrance of the bootloader

    3. I used nRF52820 module for testing

    4. Is there anything else that needs to be changed?

    5. Other s112 + MBR = 100 KB

    6.Calculate the application available space

    settings = 4kb

    mbr data = 4kb

    bootloader =24kb

    application = ?

    softdevice = 96kb

    mbr = 4kb

    Application free space: 256-4-4-24-96-4= 124KB

    7.The address before the error was reported is as follows:

    Thank you for all your assistance.
    Kind regards,
    Peter.Min

  • I believe you should set your RAM settings:

    start: 0x20000008

    size: 0x7FF8.

    After programming the bootloader and MBR, can you please run the following command:

    nrfjprog --memrd 0x10001014

    and

    nrfjprog --memrd 0x10001018

    What do they output?

    BR,

    Edvin

  • Hi Edvin,

    1. I modified the following macro definition, and the bootloader did not report any more errors

    FLOAT_ABI_SOFT   xNRF52  xNRF52_PAN_74 

    2. Read data as follows

    C:\Windows\system32>nrfjprog --memrd 0x10001014
    0x10001014: 00038000 |....|

    C:\Windows\system32>nrfjprog --memrd 0x10001018
    0x10001018: 0003E000 |....|

    3. I failed to execute the DFU command again

    4.www.dreamsourcelab.com/.../

    https://www.dreamsourcelab.com/download/

    5.We can see that the last instruction nrFUtil sent was 0x04 0xC0

    6.Why cannot the DFU command continue

    7.The configuration is as follows:

    @echo off
    echo "==================================================================================================================="
    echo "The following parameters need to be reset as needed"
    echo "set the dfu tools path"
    SET KEIL_UVISION5_PATH="C:\Program Files (x86)\Keil_v5\UV4\UV4.exe"
    SET NRFUTIL_PATH="..\external\micro-ecc\nrfutil.exe"
    SET MERGEHEX_PATH="C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin\mergehex.exe"
    SET NRFJPROG_PATH="C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin\nrfjprog.exe"
    
    echo "set the dfu project path"
    SET DFU_PROJECT_PATH_BOOTLOADER_BLE="..\examples\dfu\secure_bootloader\pca10100e_s112_ble\arm5_no_packs\secure_bootloader_ble_s112_pca10100e.uvprojx"
    SET DFU_PROJECT_PATH_BOOTLOADER_UART="..\examples\dfu\secure_bootloader\pca10100e_uart\arm5_no_packs\secure_bootloader_uart_mbr_pca10100e.uvprojx"
    SET DFU_PROJECT_PATH_BOOTLOADER_USB="..\examples\dfu\secure_bootloader\pca10100e_usb\arm5_no_packs\secure_bootloader_usb_mbr_pca10100e.uvprojx"
    SET DFU_PROJECT_PATH_APPLICATION="..\examples\ble_peripheral\ble_app_buttonless_dfu\pca10100e\s112\arm5_no_packs\ble_app_buttonless_dfu_pca10100e_s112.uvprojx"
    rem SET DFU_PROJECT_PATH_APPLICATION="..\examples\ble_peripheral\ble_app_uart\pca10100e\s112\arm5_no_packs\ble_app_uart_pca10100_s112.uvprojx"
    
    echo "set the dfu hex path"
    SET DFU_HEX_PATH_SD="..\components\softdevice\s112\hex\s112_nrf52_7.2.0_softdevice.hex"
    SET DFU_HEX_PATH_BL_BLE="..\examples\dfu\secure_bootloader\pca10100e_s112_ble\arm5_no_packs\_build\nrf52820_xxaa_s112.hex"
    SET DFU_HEX_PATH_BL_UART="..\examples\dfu\secure_bootloader\pca10100e_uart\arm5_no_packs\_build\nrf52820_xxaa_mbr.hex"
    SET DFU_HEX_PATH_BL_USB="..\examples\dfu\secure_bootloader\pca10100e_usb\arm5_no_packs\_build\nrf52820_xxaa.hex"
    SET DFU_HEX_PATH_APP="..\examples\ble_peripheral\ble_app_buttonless_dfu\pca10100e\s112\arm5_no_packs\_build\nrf52820_xxaa.hex"
    rem SET DFU_HEX_PATH_APP="..\examples\ble_peripheral\ble_app_uart\pca10100e\s112\arm5_no_packs\_build\nrf52820_xxaa.hex"
    
    echo "set the dfu hex version"
    SET DFU_IC_FAMILY="NRF52"
    SET DFU_HEX_HW_FAMILY="NRF52QFAB"
    SET DFU_HEX_VERSION_APP="3"
    SET DFU_HEX_VERSION_BL="2"
    SET DFU_HEX_VERSION_ST="2"
    
    echo "set the dfu packaged version"
    SET DFU_PKG_HW_FAMILY="52"
    SET DFU_PKG_VERSION_SD_ID="0x0103"
    SET DFU_PKG_VERSION_SD_REQ="0x0103"
    SET DFU_PKG_VERSION_APP="0xFF"
    SET DFU_PKG_VERSION_BL="0xFF"
    
    echo "if you have more then one jlink you can use this parameters to specify one of a jlink"
    SET DFU_JLINK_SNR="683054148"
    
    echo "if use dfu from com or usb com you must set this com port and baudrate"
    SET DFU_COM_BAUD="115200"
    SET DFU_COM_PORT="COM14"
    SET DFU_USB_COM_PORT="COM38"
    
    echo "if use dfu from ble base ble name you must set this name"
    SET DFU_IC_NAME="Nordic_Buttonless"
    
    echo "if use dfu from ble base ble mac you must set this mac"
    SET DFU_IC_MAC="D3:F1:96:04:74:0A"
    
    echo "==================================================================================================================="
    echo "The following parameters retain the default Settings"
    set CRLF=^& echo.
    SET DFU_KEY_BACKUP_TIME=%date:~0,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%-%time:~9,2%
    SET MICRO_ECC_FOLDER_SOURCE_PATH=".\micro-ecc"
    SET MICRO_ECC_FOLDER_TARGET_PATH="..\external\micro-ecc"
    SET MICRO_ECC_LIB_PATH="..\external\micro-ecc\nrf52hf_keil\armgcc\micro_ecc_lib_nrf52.lib"
    
    SET DFU_PUBLIC_KEY_NAME="dfu_public_key.c"
    SET DFU_PUBLIC_KEY_PATH="..\examples\dfu\"
    SET DFU_PRIVATE_KEY_NAME="private.pem"
    SET DFU_KEY_BACKUP_DIRECTORY_NAME="backup"
    SET DFU_KEY_BACKUP_DIRECTORY_PATH=".\backup\"
    
    SET DFU_HEX_NAME_SD="SD.hex"
    SET DFU_HEX_NAME_BL="BL.hex"
    SET DFU_HEX_NAME_APP="APP.hex"
    SET DFU_HEX_NAME_APP_NEW="APP_NEW.hex"
    
    SET DFU_HEX_NAME_ST="ST.hex"
    SET DFU_HEX_NAME_SD_APP="SD_APP.hex"
    SET DFU_HEX_NAME_SD_APP_BL="SD_APP_BL.hex"
    SET DFU_HEX_NAME_MERGED="MERGED.hex"
    
    SET DFU_PKG_NAME_BL="BL.zip"
    SET DFU_PKG_NAME_SOFTDEVICE="SD.zip"
    SET DFU_PKG_NAME_APP="APP.zip"
    
    SET DFU_PKG_NAME_BL_SD="BL_SD.zip"
    SET DFU_PKG_NAME_BL_SD_APP="BL_SD_APP.zip"
    SET DFU_PKG_NAME_SD_APP="SD_APP.zip"
    
    echo "==================================================================================================================="
    @echo off & setlocal EnableDelayedExpansion
    SET CRLF=^& echo.
    echo "==================================================================================================================="
    echo "dfu packaged from uart"
    CALL "%~dp0\0_env.cmd"
    echo "dfu app from uart"
    %NRFUTIL_PATH% dfu serial -pkg %DFU_PKG_NAME_APP% -p %DFU_COM_PORT% -b %DFU_COM_BAUD%
    
    echo "==================================================================================================================="
    pause
    

    8. The test code is as follows

    9.The configuration is as follows:

    #define RX_PIN_NUMBER 28
    #define TX_PIN_NUMBER 6

    #define NRF_DFU_SERIAL_UART_USES_HWFC 0

    #define NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN 20

    Thank you for all your assistance.
    Kind regards,
    Peter.Min

Related