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.
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.
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