Combining DTM and dfu-next samples

I am trying to get the nrf/sampoles/bluetooth/direct_test_mode working together with the code from zephyr/samples/subsys/usb/dfu-next. 
I have the DTM mode running correctly, but can't integrate the dfu mode to this sample. 
I started with the dtm sample, added the dfu logic in to dfu.h/dfu.c and added dfu_init to the dtm main.c. 
Unfortunately I've hit two stumble blocks: 
- the remote_shell part of the multi image build seems to be somehow hardcoced to the samples directory - whatever I try the build system always searches for remote_shell in the nrf/samples/nrf5340/remote_shell directory. I would however like to alter the code "locally", not in the SDK folder. You can overwrite settings for remote_shell (see below), but I can't figure out how to overwrite source files (e.g. main.c) with custom code. 
- When enabling DFU mode in the project sysbuild/remote_shell/prj.conf overwrite. There seems to be a logic problem: the direct_test_mode sample needs to be compiled for cpunet core (see readme of the sample). However, dfu mode needs to be enabled for the app core. alter the (SDK sample directory) code to be able to set the same code changes I'm hit with 
errors like: 
: error: 'PM_MCUBOOT_SECONDARY_ID' undeclared (first use in this function)
   65 | #define PM__mcuboot_secondary_ID PM_MCUBOOT_SECONDARY_ID
After investigating, I think the problem is that PM expects the app-core application to be the parent image, but in this configuration it is the child image and thus downstream settings get confused and  the image does not compile.

Could you please assist me in creating a DTM project, that is updatable via dfu mode?

Thank you very much, 
simeg
Parents
  • Hello,

    Is there a reason why you need DFU on the direct_test_mode application? What kind of DFU are you trying to add? Bluetooth or serial?

    Can you please zip and upload the application that you are trying to build, and let me know what NCS version you are using, and what board target you are building for. If it is a custom board, please upload the board files as well, so that I can replicate the build issue that you are seeing.

    Best regards,

    Edvin

Reply
  • Hello,

    Is there a reason why you need DFU on the direct_test_mode application? What kind of DFU are you trying to add? Bluetooth or serial?

    Can you please zip and upload the application that you are trying to build, and let me know what NCS version you are using, and what board target you are building for. If it is a custom board, please upload the board files as well, so that I can replicate the build issue that you are seeing.

    Best regards,

    Edvin

Children
No Data
Related