2.4G And BLE

This is also my Bluetooth Prj.conf

CONFIG_BT=y
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=2
CONFIG_BT_ATT_TX_COUNT=5
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="Nordic_HIDS_mouse"
CONFIG_BT_DEVICE_APPEARANCE=962

CONFIG_BT_BAS=y
CONFIG_BT_HIDS=y
CONFIG_BT_HIDS_MAX_CLIENT_COUNT=1
CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y

CONFIG_BT_GATT_UUID16_POOL_SIZE=40
CONFIG_BT_GATT_CHRC_POOL_SIZE=20

CONFIG_BT_CONN_CTX=y

CONFIG_BT_SMP=y

CONFIG_BT_DIS=y
CONFIG_BT_DIS_MANUF_NAME=y
CONFIG_BT_DIS_MANUF_NAME_STR="NordicSemiconductor"

CONFIG_BT_PERIPHERAL_PREF_MIN_INT=6
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=640
CONFIG_BT_PERIPHERAL_PREF_LATENCY=0
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400

CONFIG_BT_DIS_PNP=y
CONFIG_BT_DIS_PNP_VID_SRC=2
CONFIG_BT_DIS_PNP_VID=0x1915
CONFIG_BT_DIS_PNP_PID=0xEEEE
CONFIG_BT_DIS_PNP_VER=0x0100

CONFIG_MAIN_STACK_SIZE=2048
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

When I turn on 2.4G, there will be an error message. How can I solve it? BLE and 2.4G cannot coexist at the same time. Can I switch by restarting? Where is the Nordic restart routine

CONFIG_ESB=y

error tips

.2/nrf/subsys/esb/esb_dppi.c: In function 'esb_ppi_deinit':
C:/ncs/v3.0.2/modules/hal/nordic/nrfx/drivers/include/nrfx_dppi.h:71:33: error: 'NRFX_DPPI10_INST_IDX' undeclared (first use in this function); did you mean 'NRFX_TIMER10_INST_IDX'?
   71 |     .drv_inst_idx = NRFX_CONCAT(NRFX_DPPI, id, _INST_IDX), \
      |                                 ^~~~~~~~~

Version of NCS v3.0.2

Parents
  • Hi,

    Using BLE and ESB concurrently on the nRF54L15 is not straightforward, please see this thread for information about that. However, if you only need one at a time you can switch between them. You can see an example of that here (speicfically the esb_prx_blefallback project). This project does not support nRF54L15, but the fundamental principle works the same.

    I advice you refer to the esb_prx_blefallback (both the source code and prj.conf) for details, but the key is to configure both BLE and ESB to use dynamic interrupts, and make it so that the MPSL is also disabled upton disabling Bluetooth.

  • Thank you for your answer, but based on Prj.conf

    # CONFIG_NCS_SAMPLES_DEFAULTS=y
    # CONFIG_DK_LIBRARY=y
    
    # CONFIG_LOG=y
    # CONFIG_LOG_DEFAULT_LEVEL=3
    # CONFIG_LOG_MODE_DEFERRED=y
    
    # # ESB
    # CONFIG_ESB=y
    
    # # RADIO DEBUGGING/PERF MEASUREMENT
    # CONFIG_PPI_TRACE=y
    
    # # MULTI-ROLE
    # CONFIG_MPSL=y
    # CONFIG_BT_UNINIT_MPSL_ON_DISABLE=y
    
    # # CONFIG_MPSL_TIMESLOT_SESSION_COUNT=2
    
    # # CONFIG_SHARED_INTERRUPTS=y # this one seems no good
    # CONFIG_DYNAMIC_INTERRUPTS=y
    # CONFIG_DYNAMIC_DIRECT_INTERRUPTS=y
    
    # CONFIG_ESB_DYNAMIC_INTERRUPTS=y
    # CONFIG_MPSL_DYNAMIC_INTERRUPTS=y

    Assuming I am not compatible with 2.4G initialization,

    my 2.4G code

    char bsp_24g_init(void)
    {
    	int err;
    
    	err = clocks_start();
    	if (err) {
            BSP_DEBUG_LOG("clocks_start error \n");
    		return BSP_ERROR_CODE;
    	}
    
    	err = esb_initialize();
    	if (err) {
    		BSP_DEBUG_LOG("esb_initialize error \n");
    		return BSP_ERROR_CODE;
    	}
    
    	BSP_DEBUG_LOG("Initialization complete\n");
    	BSP_DEBUG_LOG("Sending test packet\n");
    
    	tx_payload.noack = false;
    
        esb_flush_tx();
    
        return BSP_OK_CODE;
    }

    It will cause my entire Nordic to not run until I annotated prj.conf. I spent a day searching for this issue and recreated Borad, but I want to know why this is happening

Reply
  • Thank you for your answer, but based on Prj.conf

    # CONFIG_NCS_SAMPLES_DEFAULTS=y
    # CONFIG_DK_LIBRARY=y
    
    # CONFIG_LOG=y
    # CONFIG_LOG_DEFAULT_LEVEL=3
    # CONFIG_LOG_MODE_DEFERRED=y
    
    # # ESB
    # CONFIG_ESB=y
    
    # # RADIO DEBUGGING/PERF MEASUREMENT
    # CONFIG_PPI_TRACE=y
    
    # # MULTI-ROLE
    # CONFIG_MPSL=y
    # CONFIG_BT_UNINIT_MPSL_ON_DISABLE=y
    
    # # CONFIG_MPSL_TIMESLOT_SESSION_COUNT=2
    
    # # CONFIG_SHARED_INTERRUPTS=y # this one seems no good
    # CONFIG_DYNAMIC_INTERRUPTS=y
    # CONFIG_DYNAMIC_DIRECT_INTERRUPTS=y
    
    # CONFIG_ESB_DYNAMIC_INTERRUPTS=y
    # CONFIG_MPSL_DYNAMIC_INTERRUPTS=y

    Assuming I am not compatible with 2.4G initialization,

    my 2.4G code

    char bsp_24g_init(void)
    {
    	int err;
    
    	err = clocks_start();
    	if (err) {
            BSP_DEBUG_LOG("clocks_start error \n");
    		return BSP_ERROR_CODE;
    	}
    
    	err = esb_initialize();
    	if (err) {
    		BSP_DEBUG_LOG("esb_initialize error \n");
    		return BSP_ERROR_CODE;
    	}
    
    	BSP_DEBUG_LOG("Initialization complete\n");
    	BSP_DEBUG_LOG("Sending test packet\n");
    
    	tx_payload.noack = false;
    
        esb_flush_tx();
    
        return BSP_OK_CODE;
    }

    It will cause my entire Nordic to not run until I annotated prj.conf. I spent a day searching for this issue and recreated Borad, but I want to know why this is happening

Children
  • Hi,

    I am not able to get the full understanding here. Can you please elaborate more on what you are doing, how you are testing and in what way it is not working?

  • /*  Code1  */

    Firstly, I did not add Bluetooth Prj.conf

    # log
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    CONFIG_LOG_PRINTK=y
    CONFIG_USE_SEGGER_RTT=y
    
    # bluetooth
    
    CONFIG_DK_LIBRARY=y
    
    CONFIG_BT=y
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=2
    CONFIG_BT_ATT_TX_COUNT=5
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="Nordic_HIDS_mouse"
    CONFIG_BT_DEVICE_APPEARANCE=962
    
    CONFIG_BT_BAS=y
    CONFIG_BT_HIDS=y
    CONFIG_BT_HIDS_MAX_CLIENT_COUNT=1
    CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y
    
    CONFIG_BT_GATT_UUID16_POOL_SIZE=40
    CONFIG_BT_GATT_CHRC_POOL_SIZE=20
    
    CONFIG_BT_CONN_CTX=y
    
    CONFIG_BT_SMP=y
    
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_MANUF_NAME=y
    CONFIG_BT_DIS_MANUF_NAME_STR="NordicSemiconductor"
    
    CONFIG_BT_DIS_PNP=y
    CONFIG_BT_DIS_PNP_VID_SRC=2
    CONFIG_BT_DIS_PNP_VID=0x1915
    CONFIG_BT_DIS_PNP_PID=0xEEEE
    CONFIG_BT_DIS_PNP_VER=0x0100
    
    CONFIG_MAIN_STACK_SIZE=2048
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

    my main code

    #include <zephyr/kernel.h>
    #include <zephyr/sys/printk.h>
    
    
    
    
    int main()
    {
      
        while(1)
        {
            printk("dasdsadsa");
        }
    }
    

    /*  Code2 */

    This is my Prj.conf with 2.4G and BLE added

    # log
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    CONFIG_LOG_PRINTK=y
    CONFIG_USE_SEGGER_RTT=y
    
    # bluetooth
    
    CONFIG_DK_LIBRARY=y
    
    CONFIG_BT=y
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=2
    CONFIG_BT_ATT_TX_COUNT=5
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="Nordic_HIDS_mouse"
    CONFIG_BT_DEVICE_APPEARANCE=962
    
    CONFIG_BT_BAS=y
    CONFIG_BT_HIDS=y
    CONFIG_BT_HIDS_MAX_CLIENT_COUNT=1
    CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y
    
    CONFIG_BT_GATT_UUID16_POOL_SIZE=40
    CONFIG_BT_GATT_CHRC_POOL_SIZE=20
    
    CONFIG_BT_CONN_CTX=y
    
    CONFIG_BT_SMP=y
    
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_MANUF_NAME=y
    CONFIG_BT_DIS_MANUF_NAME_STR="NordicSemiconductor"
    
    CONFIG_BT_DIS_PNP=y
    CONFIG_BT_DIS_PNP_VID_SRC=2
    CONFIG_BT_DIS_PNP_VID=0x1915
    CONFIG_BT_DIS_PNP_PID=0xEEEE
    CONFIG_BT_DIS_PNP_VER=0x0100
    
    CONFIG_MAIN_STACK_SIZE=2048
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # 2.4G 
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    CONFIG_DK_LIBRARY=y
    CONFIG_LOG=y
    CONFIG_LOG_DEFAULT_LEVEL=3
    CONFIG_LOG_MODE_DEFERRED=y
    
    CONFIG_ESB=y
    
    CONFIG_PPI_TRACE=y
    
    CONFIG_MPSL=y
    CONFIG_BT_UNINIT_MPSL_ON_DISABLE=y
    
    CONFIG_DYNAMIC_INTERRUPTS=y
    CONFIG_DYNAMIC_DIRECT_INTERRUPTS=y
    
    CONFIG_ESB_DYNAMIC_INTERRUPTS=y
    CONFIG_MPSL_DYNAMIC_INTERRUPTS=y

    my main code

    #include <zephyr/kernel.h>
    #include <zephyr/sys/printk.h>
    
    
    
    
    int main()
    {
     
        while(1)
        {
            printk("dasdsadsa");
        }
    }
    




    In summary, I don't understand why adding 2.4G Prj.conf doesn't run my entire system and Printk doesn't output or print, but it works when I don't add 2.4G. I don't understand what this is.

     

  • Hi,

    The problem here is related to logging only.  You have deferred logging enabled with CONFIG_LOG_MODE_DEFERRED=y, which means that logs are processed with low priority. But at the same time you are logging from the main loop without any sleep, so there is no CPU time available for processing the logs.

    To  get the logs you can either disable deferred logging, or add a sleep in your main loop by for instance making it look like this instead:

        while(1)
        {
            printk("dasdsadsa");
    	    k_sleep(K_MSEC(100));
        }

    PS: Note that ESB and BLE cannot run concurrently (though in principle you can use ESB within MPSL timeslots, but the ESB protocol itself was not designed to be used in this manner so it will not be optimal).

Related