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: How can I put a longer execution time function in the callback function?

Part Number: CC2340R5

Tool/software:

Hello friend,
I'm using CC2340R5-Q1 MCU and SDK simplelink_lowpower_f3_sdk_8_10_01_02. I created a new project without BLE functionality. Functions called from interrupt callback (button 0) take longer to execute. But it seems to be stuck on the callback function. How can I put a longer execution time function in the callback function?

Thank you in advance.
Ted Wu

  • Hi Ted,

    Could you please provide more information regarding why would you need the longer execution time function in the callback function?
    When you say stuck on the callback function, may I confirm if you mean a fault?

    It would also be helpful to provide more details on exactly what the function does. Thank you so much!

    Best Regards,

    Cashmere

  • Hi Cashmere,

    I call the Display_printf function to display the debug message in the button callback function. It will not be displayed again after the first display. I want to send SPI data frame in callback function. Display_printf is stuck on the callback function, so I haven't implemented the SPI function yet. I know callbacks can use BLEAppUtil_invokeFunctionNoData to register a function to be executed. But this project does not have BLE functionality.

    Thank you very much.

    Ted Wu

  • Hi,

    1. Could you please confirm which SDK are you using?
    2. Could you also confirm if "does not have BLE functionality" means that you are using an empty example without the stack or are you just simply not calling any BLE functions?
    3. The SPI example included in the SDK uses a display_printf function without any BLE function. May I ask if you have tried using this as baseline? 
    4. Generally, If there is no stack in the project and no BLEAppUtil framework, there is no need to register callbacks using BLEAppUtil_invokeFunctionNoData. 
    5. Instead of directly calling display_printf, you could try to post an event or set a flag (or use semaphores).

    Please let me know if you need more information.

    Best Regards,
    Cashmere