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
  • Hi Edvin, 

    thank you for looking in to this. 
    The nrf5340 will be part of another product and enable new features for our users. 
    We want to have various apps that the user can cycle through on our products: the user will select an "app" and it will be pushed to the nrf5340 in the background via USB dfe from a linux host.
    The DTM mode will be one such application, which will only be available for a select view users (mainly internal testing, production chain, certification labs, etc.). 
    We have this workflow working for other applications, but the DTM applications does not yet work.

    We use the Ublox Nora B - I've included the boards directory for this board. 
    I've also included the modified sample code.
    Please do not hesitate to contact me, if you have any further questions. 
    If you send me a DM I can also give you my company contact informations. 

     dtm_and_dfe_together.tar.gz

  • Just to be clear, it is the direct_test_mode, and not the sample_code_remote_shell we are trying to build?

    What is your build command? "west build -b ubc_evknorab10_nrf5340/nrf5340/cpuapp" ? or some additional build flags?

    Best regards,

    Edvin

Reply Children
Related