integrating radio test example with my project

Hi @JONATHAN LL 

Hope you are doing well! Thank you for the support!

I want to integrate the two NCS projects . The first one is as mentioned below which is regarding the nrf21540 internal register read.

 nrf21540 internal register read issues 

And 2nd is "Radio test Example" NCS. Can you please guide me in this regard that how to integrate?

I tried it by copying 1st code in the "Radio test Example" main.c file. It compiled successfully but reboots continuously. 1st project is also accessing the SPI pins, CS and Pdn, and Radio test examples also the same pins. 

These are the points I found to integrate!

  1. Clone the NCS repository from GitHub (https://github.com/nrfconnect/sdk-nrf) and set up the environment as per the documentation.

  2. Navigate to the examples/radio directory in the NCS repository.

  3. Copy the CMakeLists.txt file from the radio example directory to your project's directory.

  4. Copy the src directory and its contents from the radio example directory to your project's directory.

  5. Copy the include directory and its contents from the radio example directory to your project's directory.

  6. Update the CMakeLists.txt file in your project's directory to include the radio test example as a dependency. You can do this by adding the following lines to the CMakeLists.txt file:

       # Add radio test example as a dependency

        add_subdirectory(radio)

        target_link_libraries(${YOUR_PROJECT_NAME} PRIVATE radio_test)

After integrating the radio test example into your project, you should be able to use the functions and structures defined in the radio directory to test the radio functionality of your device. You can also modify the example to fit your specific use case by changing the configurations and settings in the radio_config.h file.

Thanks in Advance! 

Regard,

Muhammad Usman

  • Hi,

    Jonathan is out of office, so I'm answering instead.

    I tried it by copying 1st code in the "Radio test Example" main.c file. It compiled successfully but reboots continuously.

    The radio_test uses the mpsl library to access the FEM, so you might need to power down the FEM with fem_power_down(), and then init and read the registers you want, before calling fem_power_up() again, and then running the radio_test as normal.

    To stop the rebooting, you can try setting CONFIG_RESET_ON_FATAL_ERROR=n

  • Hi Sigurd

    Thank you so much for the response!

    I tried fem_power_down() and fem_power_up()  but no effect. Although, when I pasted CONFIG_RESET_ON_FATAL_ERROR=n in prj. conf it stopped rebooting the controller.

    Can you please help me in this regard,

    Thanks & Regard,

    Muhammad Usman

  • Hi,

    Muhammad Usman said:
    Although, when I pasted CONFIG_RESET_ON_FATAL_ERROR=n in prj. conf it stopped rebooting the controller.

    Do you get any errors or warnings printed in the log output?

  • Hi Sigurd!

    Thank you so much for the response!

    Debug log

    JLinkGDBServerCL: SEGGER J-Link GDB Server V7.80c Command Line Version
    JLinkGDBServerCL: 
    JLinkGDBServerCL: JLinkARM.dll V7.80c (DLL compiled Sep 27 2022 16:01:16)
    JLinkGDBServerCL: 
    JLinkGDBServerCL: -----GDB Server start settings-----
    JLinkGDBServerCL: GDBInit file:                  none
    JLinkGDBServerCL: GDB Server Listening port:     59105
    JLinkGDBServerCL: SWO raw output listening port: 2332
    JLinkGDBServerCL: Terminal I/O port:             2333
    JLinkGDBServerCL: Accept remote connection:      localhost only
    JLinkGDBServerCL: Generate logfile:              off
    JLinkGDBServerCL: Verify download:               off
    JLinkGDBServerCL: Init regs on start:            off
    JLinkGDBServerCL: Silent mode:                   on
    JLinkGDBServerCL: Single run mode:               on
    JLinkGDBServerCL: Target connection timeout:     0 ms
    JLinkGDBServerCL: ------J-Link related settings------
    JLinkGDBServerCL: J-Link Host interface:         USB
    JLinkGDBServerCL: J-Link script:                 none
    JLinkGDBServerCL: J-Link settings file:          none
    JLinkGDBServerCL: ------Target related settings------
    JLinkGDBServerCL: Target device:                 nRF52840_xxAA
    JLinkGDBServerCL: Target device parameters:      none
    JLinkGDBServerCL: Target interface:              SWD
    JLinkGDBServerCL: Target interface speed:        12000kHz
    JLinkGDBServerCL: Target endian:                 little
    JLinkGDBServerCL: 
    =thread-group-added,id="i1"
    =cmd-param-changed,param="pagination",value="off"
    arch_system_halt (reason=reason@entry=0) at C:/ncs/v2.2.0/zephyr/kernel/fatal.c:32
    32		for (;;) {
    Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)
    

    Thanks & regards,

    Muhammad Usman

  • Hi,

    By looking at the call stack, we might be able to see why it ended up in the error_handler. Open the debugger tab to have a look at the call stack. 

Related