the original secure_bootloader and buttonless_dfu works fine.
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?
If you see your device not booting up, you would need to debug it. Basically it's to find which assertion you have. You can follow this guide on debugging.
I can see in your code (sdk_config.h) you have NRF_SDH_BLE_VS_UUID_COUNT = 1 when it should be 2 as you have 2 vendor specific model.
It doesn't matter if you integrate NUS into DFU buttonless or the other way around, it's the same process.
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
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.
Hi Hung, thank you for reminding.
I don't think I touched FDS related configurations during merge NUS/UART into buttonless.
app(same as the original buttonless):
#define FDS_VIRTUAL_PAGES 3
#define FDS_VIRTUAL_PAGE_SIZE 1024
secure bootloader(same as original secureboot):
#define NRF_DFU_APP_DATA_AREA_SIZE 8192
I tried to modify NRF_DFU_APP_DATA_AREA_SIZE to 12288(3 * 1024 * 4). it still can not boot up. and this time there is not RTT backend log.
Does this mean there is no flash space for my application and bootloader on nRF52810?