Using GPIOs 17 to 20 on CX3

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
user_1065201
Level 1
Level 1

Hi everyone,

I am trying to bring our first hardware based on CX3 to life and I am bit struggling with GPIOs, namely pins GPIO[17] to GPIO[20]. If I enable these as simple (or complex, it does not matter actually) GPIOs CyU3PIoMatrixConfig_t and call CyU3PDeviceConfigureIOMatrix(), it will fail and fall into fatal error handler.

I have found out that I use CyU3PDeviceGpioOverride() to work around this, but I have not found any mention of this in the documentation, so I am not sure why it is actually needed. I feel that it should not be needed, from my previous experience with FX3, the override was needed only when the pin was shared between software control (using GPIO API) and GPIF state machine control. Normally there was no need to do the override, but since CX3 is way different from FX3, there is probably something I have missed.

If anyone can point me to document that explains this in detail so I can actually try to figure out if it is fine to override it or if it will cause some troubles elsewhere, I would really appreciate it.

Thanks for any help.
Ivo

CyU3PIoMatrixConfig_t

0 Likes
1 Solution

Edited for better clarity:

 

Ivo,

 

You can use CyU3PDeviceGpioOverride API to use any GPIO irrespective of whether it is shared with any other interface or it is free to use as GPIO. This avoids the extra efforts to do bitmapping in IOMatrix configuration.

 

I have reproduced your requirement over the Denebola kit observed as follows:

 

To use GPIO 17,18,19,20 you must use CyU3PDeviceGpioOverride API, other GPIOs can be used by passing to IOMatrix.

By doing this, functionality of MIPI/GPIF II block does not interfere with control of these GPIOs.

Please refer to FX3 TRM section 8.9.4.2 to understand how GPIOs can be enabled. GPIO[17] is can be used but
cannot be enabled in IO Matrix , as it is part of the GPIF II I/Os. If this I/O is not used with the GPIF II interface (as mentioned in CX3 datasheet), it can be overridden to become a GPIO by invoking the CyU3PDeviceGpioOverride call

View solution in original post

8 Replies