This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB and RADIO are having problems working together on nrf52833.

Platform: pca10100

SDK version: SDK17.0

Purpose: Use radio to scan Bluetooth devices and perform CTE sampling. When the scan data and IQ data accumulate nearly 4K, output these data via USB CDC ACM.

Detail:

1 Softdevice isn't enabled

2 After EVENT_PHYEND is generated, if the CRC status is correct, put the function that processes the scan result into app_scheduler, and then start the next scan after the processing is completed; otherwise, directly start the next scan. Insert this part of the code below.

After scanning for a period of time, more than ten seconds or several minutes, the function( radio_scan_report_hdl() or radio_scan_handler() ) put in app_scheduler is not executed, cause the scanning process to not continue. Insert the corresponding log information.

3 But when the USB is not sending data, radio scanning can work. 

4 RADIO uses hardware resource TIMER1, USB uses hardware resource TIMER2.

5 Is there any resource conflict between USB and RADIO? Or other problems?

if (NRF_RADIO->EVENTS_PHYEND == 1) {
    NRF_RADIO->EVENTS_PHYEND = 0;
    if(NRF_RADIO->CRCSTATUS == 1) {
        NRF_LOG_INFO("EVENTS_PHYEND CRC ok");
        APP_ERROR_CHECK(app_sched_event_put(NULL, 0, radio_scan_report_hdl));
    } else {
        NRF_LOG_INFO("RADIO->CRCSTATUS Error!");
        APP_ERROR_CHECK(app_sched_event_put(NULL, 0, radio_scan_handler));
    }
}

Parents
  • Hi 

    There shouldn't be a conflict between the USB and RADIO interfaces, no. These should be running independently of each other, except they might use some of the same chip resources, such as clocks and regulators. 

    What interrupt priority is the radio interrupt running at?

    You have checked that the app error handler is not running, as a result of an error code being returned by one of the SDK functions?

    Best regards
    Torbjørn

  • Hi Ovrebekk,

    Thanks for prompt reply.

    The interrupt priority of radio is 1.

    It does not return an error code and works well.

    It works when the function is called directly without app_scheduler.

  • Hi 

    What is your scheduler queue size? 

    Could you try to increase it and see if it makes a difference?

    Also, can you confirm that you are running app_sched_execute() before every powerdown?

    Best regards
    Torbjørn

Reply Children
No Data
Related