This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2340R5: About the CC2340R5 evaluation board,Under the receiving routine of the custom wireless function, how can I perform my other functional requirements when the wireless reception is enabled

Part Number: CC2340R5


HI team:

    About the CC2340R5 evaluation board,Under the receiving routine of the custom wireless function, how can I perform my other functional requirements when the wireless reception is enabled。thanks a lot。

  • Hi Ixy,

    The rfPacketRx is quite simply purposed to continually receive packets without ever exiting (rclPacketRxCmdGenericRx.config.repeated = 1).  Some options include:

    • Thread synchronization to post/pend semaphores (see uart2callback.c) which will allow access to a main while loop.  This is preferred as it does not quit the RX command during any time.
    • Quit the RX command, perform functions, and re-submit the RX command (all in a while loop).  See rfEchoRx for an example.  RX will be paused while functions are performed.

    Regards,
    Ryan

  • Hello ,

    Thank you for your reply。I looked at the routine of UART and found that the routine did not carry out wireless reception. We want the program to continue to carry out wireless reception while it can also enter the main loop. Can we operate like this?thanks a lot。

  • uart2callback was only provided as an example of semaphore usage, not RF operation.  Add semaphores to the rfPacketRx example.

    Regards,
    Ryan

  • Hello ,

    Thank you for your reply。I can imagine the scenario you suggested, but that is not what we want. We want to know whether the chip can check whether there is RF data while doing the function of flipping IO operation. For example, the following code, I debug the IO flip is not executed。thanks a lot。

  • Since CONFIG_GPIO_RLED is not used in this project by default, please confirm that you are configuring this pin correctly.

        /* Configure the LED pin */
        GPIO_setConfig(CONFIG_GPIO_RLED, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);

    Once you can control the GPIO from the main thread, you can try to further debug its usage inside the callback.  You should also set breakpoints within the CCS debugger to make sure that the code does reach execution of this line.

    Regards,
    Ryan

  • Hello ,

    Thank you for your reply。I understand what you mean. My code has been initialized in other places, and the same initialization LED can work normally. I want to confirm whether the chip can also flip IO operation while receiving wirelessly。thanks a lot。

  • While in active mode the CC2340R5 is able to toggle a GPIO during the radio's receiver mode.  You may consider taking the GPIO function outside of the callback if this is the only code execution which you are not able to observe taking place.  You should also further utilize debug tools as previously mentioned.

    Regards,
    Ryan

  • Hello ,

    Thank you for your reply。I have used the debugger to debug the break point. During the debugging, I found that the system could not perform IO flip outside the callback function when receiving wirelessly(as noted in the following figure), nor could it perform it inside the callback function (as noted in the following figure)。thanks a lot。

  • For the first instance concerning toggling outside the callback function (i.e. the while loop), you will also have to set rclPacketRxCmdGenericRx.config.repeated to zero, otherwise RCL_Command_pend never finishes.  Gather further information from the rfEchoRx example.

    For the second instance, you if the GPIO_toggle inside of the rclEvents.rxEntryAvail if statement is working then you should further debug your count operation to determine what causes this statement to never execute.

    Regards,
    Ryan

  • Hello ,

    Thank you for your reply。For the first instance concerning toggling outside the callback function (i.e. the while loop), I want to set rclpacketrxcmdgenericrx.config. repeat to 1,and I also want to enter while(1),Implement multi-task switching, Is there a way to do that?thanks a lot。

  • If repeated is set then RCL_Command_pend is never exited, thus you should forgo this usage and rely on Semaphores instead for pend/post from the RX callback.

    For creating multiple tasks, you can refer to the Tasks section of the BLE5-Stack User's Guide.

    Regards,
    Ryan

  • Hello ,

    Thank you for your reply。For the first instance concerning toggling outside the callback function (i.e. the while loop), I want to set rclpacketrxcmdgenericrx.config. repeat to 1,In addition, I open the timer and interrupt of the chip at the same time, can the code run the timer interrupt service function code?thanks a lot。

  • In addition, I open the timer and interrupt of the chip at the same time, can the code run the timer interrupt service function code?

    Please provide further context as this is the first instance for which timers have been discussed in this thread.  A timer and radio can operate at the same time.  If both have interrupts then these will be serviced in turn according to their priorities.  

    Regards,
    Ryan