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.

CC3220MODA: Concurrent GPIO read on same pin by two threads

Genius 3100 points
Part Number: CC3220MODA

Team,

We need to read the same GPIO pin in two different threads in our application which are reading continuously in a loop, but at different speed. First thread will invoke GPIO_read every 20 microseconds and the second one will read every 1000 microseconds on the same pin. We have some challenges in combining them to a single read logic and we have not faced any issues during our testing. However we would like to understand any drawbacks if we do so? There are chances when few reads would happen at same time by both threads and if so what are the outcomes?

Appreciate support.

Regards,

Zac

  • Hi Zac,

    I don't expect a conflict on that API, but I don't believe this has been tested. I can check on that.

    I recommend having a watchdog or some other recovery mechanism as a backup.

    Best regards,

    Sarah

  • Thanks Sarah,

    Please let me know the findings based on your test. We are using watchdog for recovery.

    Regards,

    Zac

  • Hi Zac,

    To clarify, we do not have a test setup for this event. I did verify that all variables in the driver are on their respective task stacks, so they should not impact one another, and the register read is not changing any information. If you have not seen any issues in your testing and you have a watchdog enabled, this seems a reasonable approach.

    Best regards,

    Sarah