I am developing an application on the Quectel EC200 using the QuecOpen SDK (FreeRTOS based). I have a question regarding concurrent GPIO access across multiple threads.
I have two separate threads running:
Thread 1: Toggles a GPIO to reset a GPS module.
Thread 2: Rapidly toggles a different GPIO used for SPI Chip Select (CS) to read an MCP2515 CAN controller.
Even though these are completely different physical pins, I noticed signal corruption on my oscilloscope when both threads attempt to toggle their respective pins at the exact same time.
My question is: Does the underlying ql_gpio_set_level() function perform a Read-Modify-Write (RMW) on the shared GPIO Port register?
If Thread 1 and Thread 2 are trying to toggle different pins that belong to the same hardware Port/Bank concurrently, do I need to wrap my GPIO calls in an RTOS Mutex to prevent them from corrupting the register during an OS context switch?
I suggest you raise questions on the QUEC OPEN forum or seek support from your corresponding sales or FAE.
Using only one GPIO to reuse two functions may result in erroneous operation of peripherals due to GPIO status. It is recommended that you modify and use a separate GPIO for independent control