I am trying to add DFU to my project, so I merged in the code from the example in the SDK as follows:
- I included the same .c files as the example project
- I copied over the flash_placement.xml file
- I merged the preprocessor defines
- I copied over the linker_section_placement_segments from the example project into my project
- I copied over the linker_section_placement_macros from the example project into my project
- I carefully merged the sdk_config.h files
When I build the compile process happens as expected, but I get some linker errors that I cannot figure out!
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10b/gcc/arm-none-eabi/bin/ld: Output/Release/Exe/Dynojet_PV4.elf section `.dfu_trans' will not fit in region `UNPLACED_SECTIONS' 1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10b/gcc/arm-none-eabi/bin/ld: region `UNPLACED_SECTIONS' overflowed by 8200 bytes 1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10b/gcc/arm-none-eabi/bin/ld: Output/Release/Obj/Dynojet_PV4/nrf_dfu_transport.o: in function `nrf_dfu_transports_init': 1> D:\Projects\Dynojet PV4\SDK\components\libraries\bootloader\dfu/nrf_dfu_transport.c:57: undefined reference to `__start_dfu_trans' 1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10b/gcc/arm-none-eabi/bin/ld: D:\Projects\Dynojet PV4\SDK\components\libraries\bootloader\dfu/nrf_dfu_transport.c:57: undefined reference to `__stop_dfu_trans' 1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10b/gcc/arm-none-eabi/bin/ld: Output/Release/Obj/Dynojet_PV4/nrf_dfu_transport.o: in function `nrf_dfu_transports_close': 1> D:\Projects\Dynojet PV4\SDK\components\libraries\bootloader\dfu/nrf_dfu_transport.c:79: undefined reference to `__start_dfu_trans' 1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10b/gcc/arm-none-eabi/bin/ld: D:\Projects\Dynojet PV4\SDK\components\libraries\bootloader\dfu/nrf_dfu_transport.c:79: undefined reference to `__stop_dfu_trans' 1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10b/gcc/arm-none-eabi/bin/ld: Output/Release/Obj/Dynojet_PV4/nrf_svc_handler.o: in function `nrf_svc_handler_c': 1> D:\Projects\Dynojet PV4\SDK\components\libraries\svc/nrf_svc_handler.c:83: undefined reference to `__start_svc_data' 1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10b/gcc/arm-none-eabi/bin/ld: D:\Projects\Dynojet PV4\SDK\components\libraries\svc/nrf_svc_handler.c:83: undefined reference to `__stop_svc_data' Build failed
The __start_dfu_trans is defined in a macro, and that macro appears to be active. I also noticed that the .ld file that is generated on build has omitted this section (as well as the stop and the start/stop for the svc_data section)
I notice that in SES, the example the nrf_dfu_transport.c compiles with 228 bytes of code and 159 Data+RO. On my project it is merely 96 bytes and no Data+RO.