Because of the Thanksgiving holiday in the U.S., TI E2E design support forum responses may be delayed the week of Nov. 21. Thank you for your patience.

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.

LAUNCHXL-CC3235S: About the use of mutex.

Part Number: LAUNCHXL-CC3235S
Other Parts Discussed in Thread: CC3235S

Hi team,

Here's the request from the customer:

Customer's CC3235S hangs multiple slave devices on IIC communication, how to ensure these slave devices work at the same time and read the data of their registers at the same time without affecting their respective threads? Can this function be achieved with a mutex?

If using mutex, which function should be called? Are there any reference file in the SDK?

Could you help check this case? Thanks.

Best Regards,                                                            

Nick    

  • Mutex can serve for "Critical Section" protection which is probably what is needed here.

    The SDK contains many examples that show the use of mutex (through POSIX API, look for "pthread_mutex").

  • Hi Kobl,

    Customer's SDK is the CC32xx_sdk_5_20_00_06 which without many examples, such as below:

    at_commands

    cloud_ota

    connection_manager

    httpget

    json_app

    local_ota

    local_time

    mqtt_client

    matt_client_server

    network_terminal

    out_of_box

    portable

    portableNative

    provisioning

    • Are there any examples about mutex in these examples?
    • Since the posix api is used, is the mutex example in the linux version SDK?
    • Which example is it? Preferably a mutex routine for iic communication.

    Could you help check this case? Thanks.

    Best Regards,                                                            

    Nick    

     

  • pthread_mutex is used in: out_of_box, mqtt_client, portable. Since it is POSIX, you can find examples online.  

    The API is very simple: pthread_mutex_init (initiailze the mutex) , pthread_mutex_lock (call upon entering the critical section), pthread_mutex_unlock (call upon exiting the critical section). If you have several thread you should use the same mutex  (i.e. that was initialized by a single call to pthread_mutex_init, e.g. before the threads were created) to protect the access to a single resource.