Part Number: J722SXH01EVM
Other Parts Discussed in Thread: TCA6424
Tool/software:
In order to operate the GPIO on J28.37 I need to switch TRC_MUX_SEL to 0. How to I do that? Below pictures are from schematic given here www.ti.com/.../J722SXH01EVM


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.
Part Number: J722SXH01EVM
Other Parts Discussed in Thread: TCA6424
Tool/software:
In order to operate the GPIO on J28.37 I need to switch TRC_MUX_SEL to 0. How to I do that? Below pictures are from schematic given here www.ti.com/.../J722SXH01EVM


Hi Zorah,
In Linux device tree this should be set to output low here: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-j722s-evm.dts?h=ti-linux-6.1.y#n430
Is it not setting to low?
Regards,
Takuma
No by default it is set to 1. Let me add you to the email chain describing this problem.
Is there any way to set it to 0 using the syscfg?
Hi Zorah,
I assume this is not using Linux. I'm not too savvy with how RTOS does the GPIO configuring, so I will reassign this to someone that may be able to help you more.
In the meantime, I did some digging through and found this GPIO example in the MCU+ SDK: https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-j722s/09_02_00_05/exports/docs/mcu_plus_sdk_j722s_09_02_00_41/docs/api_guide_j722s/DRIVERS_GPIO_PAGE.html
And since the particular GPIO wanting to change is on the IO expander, there is an API that is used to initialize and control the output documented here: https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-j722s/09_02_00_05/exports/docs/mcu_plus_sdk_j722s_09_02_00_41/docs/api_guide_j722s/group__BOARD__IO__EXPANDER__TCA6416__MODULE.html
Please feel free to look through them and if there is a question, please post back.
Regards,
Takuma
Hi Zorah,
Is there any way to set it to 0 using the syscfg?
The GPIO is connected in IO Expander ,so we can't use syscfg here
In order to operate the GPIO on J28.37 I need to switch TRC_MUX_SEL to 0. How to I do that? Below pictures are from schematic given here www.ti.com/.../J722SXH01EVM
Please refer the code below to set the gpio of the IO expander. Let us know if this is helpful.
TCA6424_Config config;
TCA6424_Params param;
int32_t status;
param.i2cInstance = I2C_INSTANCE_0;
param.i2cAddress = 0x23U;
status = TCA6424_open(&config, ¶m);
if (status != SystemP_SUCCESS)
{
return SystemP_FAILURE;
}
status = TCA6424_config(&config, 17U, TCA6424_MODE_OUTPUT);
if (status != SystemP_SUCCESS)
{
return SystemP_FAILURE;
}
status = TCA6424_setOutput(&config, 17U, TCA6424_OUT_STATE_HIGH);
if (status != SystemP_SUCCESS)
{
return SystemP_FAILURE;
}
TCA6424_close(&config);
Regards,
Karthik
Can you please share the full code or where you got it from?
What is I2C_INSTANCE_0?
In the shared code below
status = TCA6424_config(&config, 17U, TCA6424_MODE_OUTPUT);
Why is pin num 17 used?
Hi Zorah,
Source code for RTOS is in the RTOS SDK zip file: https://www.ti.com/tool/download/PROCESSOR-SDK-RTOS-J722S
I2C_INSTANCE_0 I assume is the I2C bus number. Karthikeyan S, please correct me if I am wrong.
TRC_MUX_SEL should be pin 0. I think the example is just a generic example that just happen to use pin 17.
Regards,
Takuma
When I run the above example after
status = TCA6424_config(&config, 1U, TCA6424_MODE_OUTPUT);
if (status != SystemP_SUCCESS)
I get status=-12 and no change in gpio pin after enabling gpio indicating the above code is not working
Is any other initialization in terms of i2c needed prior to this other than setting it in syscfg?
Hi Zorah,
Can you please share the full code or where you got it from?
This generic reference code can be used to make GPIO 17 high, we don't have any examples for IO Expander. therefore you can change the gpio J28.37 instead than the gpio 17.
Is any other initialization in terms of i2c needed prior to this other than setting it in syscfg
Yes,you need to enable the I2C_INSTANCE_0 in syscfg.
Regards,
Karthik