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

nRF52810 SDK15.3.0 add NUS(ble_app_uart) to ble_app_buttonless_dfu can not bootup

SDK15.3.0

nRF52810

the original secure_bootloader and buttonless_dfu works fine.

nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040e_ble

and nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_buttonless_dfu\pca10040e

so I start to porting NUS and UART/FIFO module into ble_app_buttonless_dfu(leave secure bootloader untouched), but fails:

it can not boot up to ble_app_buttonless_dfu.

Here I attach my project ble_app_buttonless_dfu.7z

Mostly, I add uart related files and some functions in main.c, even have not init NUS service.

Would you share some suggestion?

Or should I add DFU into ble_app_uart example, would be easier?

Parents Reply Children
  • Hi Hung,

    I can't debug when there is a bootloader.

    on original buttonless_dfu emulated project, when I started debugging, it just goes to error after ble_dfu_buttonless_async_svci_init() was called. but it runs well if I don't debug.

    on my own project, it reports error at the same location. So I don't even know if it is the root cause.

    on my own project, you can see I just put all related source code into it, but never call them from main().

    I doubt that it's about flash memory size.

  • Hi Huang,

    And I can't set optimization level as none, it reports compiling error says ".rodata .data is too large to fit in FLASH memory segment"

  • I forget to read RTT backend debug message, now I read it from Jlink RTT viewer somehow, attach here:

    0> <info> app: Setting vector table to bootloader: 0x00028000
    0> <info> app: Setting vector table to main app: 0x00019000
    0> <warning> nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.
    0> <warning> nrf_sdh_ble: Change the RAM start location from 0x20001C18 to 0x20002390.
    0> <warning> nrf_sdh_ble: Maximum RAM size for application is 0xDC70.
    0> <error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
    0> <error> app: Fatal error

  • Now I change RAM_START from 0x20001c18 to 0x20002390. Now it is working if I don't call anything about UART/NUS.

    But after I call uart_init() in main, report error like this:

    0> <info> app: Setting vector table to bootloader: 0x00028000
    0> <info> app: Setting vector table to main app: 0x00019000
    0> <error> peer_manager_pds: Could not initialize flash storage. fds_init() returned 0xB.
    0> <error> peer_manager: pm_init failed because pds_init() returned NRF_ERROR_STORAGE_FULL.
    0> <error> app: Fatal error

  • Hi Leo, 

    It seems that the flash area for flash storage has been erased. Please check the number of FDS_VIRTUAL_PAGES (in your application) reserved for FDS storage match with NRF_DFU_APP_DATA_AREA_SIZE inside the bootloader. By default they are 3 pages. (12kB) 

    fds_init() return 0x0B meaning FDS_ERR_NO_PAGES. This happens when the header data of the FDS is erased. 

Related