Question about NCS DTM and BLE stack option.

I would like to develop DTM and normal BLE stack operation in single firmware by NCS. Basically i will check a GPIO, go DTM test mode if GPIO short to High, go normal BLE stack if GPIO short to GND.

However, it seems no way to achieve that.

If i set CONFIG_BT=y, then start DTM, it get crash or HARDWARE FAULT.

If i set CONFIG_BT=n, then ok for DTM, but no way to initialixe the BLE Stack manually in code.

Am i correct?

So is it possible to enable CONFIG_BT=y manually in codes? Or disable BLE Stack completely so that i can switch to DTM mode properly?

Already search but still seems no feasible solution.

Thanks.

Parents
  • Hello,

    I guess there are different ways of doing this, and simplest should be as you suggest, is to select whether to run DTM or BLE after a reset. For instance you can have test pin on the board, e.g. with pull-up, such that when it's low on reset the application run DTM, else it will run BLE.

    So in start of main() you would simply do something like (example is outdated, check direct_test_mode.zip file instead):

    // Edit: Updated code.
    // in prj.conf
    // DYNAMIC_DIRECT_INTERRUPTS=y
    // MPSL_DYNAMIC_INTERRUPTS=y
    
       void main(void) {
           // read pin to find if application should run DTM or BLE
    
           if (dtm_mode) {
               printk("Booting into DTM mode\n");
               err = mpsl_lib_uninit();
               dtm_init();
               // Enter DTM mode loop
               while (1) {
                   dtm_cmd_process();
               }
           } else {
               printk("Booting into BLE mode\n");
               int err = bt_enable(NULL);
               // Normal BLE application logic here
           }
       }

    Or are you saying you have tried this but it doesn't work?

    Kenneth

  • Hi Kenneth,

    We have tried and done something like what you suggested but it doesn't work.

    But the problem is how should we set CONFIG_BT in proj.conf?

    If we set CONFIG_BT=y, and the firmware boots int DTM mode. It doesn't work to get "HARD FAULT" error.

    If we set CONFIG_BT=n (or no CONFIG_BT), and the firmware boots int BLE mode. It doesn't work as the BLE stack is not loaded in the firmware after build.

    What i am struggling now is how should we set to the proj.conf for CONFIG_BT.
    So we can really make the DTM and BLE mode combined in one firmware.

    Any further idea for that?

    Thank  you very much.

  • Kenneth said:

    After a bit of searching I could find this thread which I think solve your problem:
    Radio Test and BT exlusive coexistense in same firmware image 

    Kenneth

    Did you see this reply?

    Kenneth

Reply Children
Related