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.

TDA4AL-Q1: I'm trying to read the GPIO value via sysfs.

Part Number: TDA4AL-Q1

Tool/software:

Hello. TI experts.

PROCESSOR-SDK-RTOS-J721S2 : 09.02.00.05 (10 Apr 2024)

I'm trying to read the GPIO value using sysfs.

After exporting GPIO0_0 and setting the direction to 'in', the pin goes HIGH.

When I set the direction to 'out', it goes LOW.

However, when I switch the direction back to 'in', I can only read a value of '0', regardless of the switch status.

One more thing, how can I read the value in QNX? I would like to know how to do it both from the console and using C code.

Best regards,

JK

  • After exporting GPIO0_0 and setting the direction to 'in', the pin goes HIGH.

    When it is input an external source can pull it high. When Output SOC has to drive its value.

    However, when I switch the direction back to 'in', I can only read a value of '0', regardless of the switch status.

    Are you particular about the GPIO0_0? Can you try any other GPIO?

    - Keerthy

  • Hello. Keerthy.

    The only pin we can currently check on our board is almost exclusively GPIO0_0.

    Is there any other way to check further?

    Best regards,

    JK

  • Note the IO is an Open-Drain IO...meaning when set to output it can drive low only.  It does not drive high, but rather it tri-states the pin and relies on the IO to pull it high.

    When initially testing GPIO0_0 using input mode - can you read both high and low based on switch setting (open/closed)?

    When testing GPIO0_0 using output mode - make sure the switch is always OPEN.  Can you read both high and low outputs based on software setting?

    When reading the GPIO0_0 after a change - are you giving IO time to change?  When setting to low (0) will happen very quickly, but setting to high (1) will take longer as it uses the pull-up resistor to change the value (there is R-C time constant delay).  If you want faster response, you can change the resistor (smaller value) and/or remove the capacitor.

  • Hello, Robert Eschler.

    I want to read the value of GPIO0_0.

    However, when I use 'cat value', it only reads 0 for both 0V and 3.3V.

    Time is not an issue. I'm checking while maintaining the High/Low state.

    root@mobase-icmu:/sys/class/gpio# echo 333 > export

    root@mobase-icmu:/sys/class/gpio/gpio333# echo in > direction

    root@mobase-icmu:/sys/class/gpio/gpio333# cat value

    Best regards,

    JK

  • Can you please respond to my previous questions.....

    When initially testing GPIO0_0 using input mode - can you read both high and low based on switch setting (open/closed)?

    When testing GPIO0_0 using output mode -  Can you read both high and low outputs based on software setting?