SIUL2 Configuration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SIUL2 Configuration

942 Views
vignesh3
Contributor II

Hi there,

I have configure I2C0, but I2C will not work as expected  in between some times.

So I need to toggle the SCL 9 times, But I have already configured I2C using generated code by S32DS tool, If I need to config the SCL as gpio in between means How can I do that, any suggestion on this?

And after sending 9 clock pulses I need to revert back the SCL functionality to that pin.

0 Kudos
Reply
4 Replies

908 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @vignesh3 

I have not tried this exact implementation, but the general idea is:

  • Disable the I2C module.
  • Reconfigure the SCL pin as a GPIO.
  • If you want to restore the pin’s I2C functionality, you will need to:
  • Reconfigure the pin back to its I2C function.
  • Reinitialize the I2C module.

To manage pin configurations dynamically at runtime, I used a feature called "Functional Groups" in the S32 Configuration Tools. This feature allows you to define multiple configurations (groups), and the tool generates all of them in a single file for example Siul2_Port_Ip_Cfg.c for pins.

In your application code, you just need to select the appropriate configuration structure and pass it to the initialization function at the right time.

 

BR, VaneB

0 Kudos
Reply

897 Views
vignesh3
Contributor II

Hi @VaneB ,

Thanks for the reply.

This is the one do I need config?

vignesh3_0-1748957688819.png

 

0 Kudos
Reply

883 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @vignesh3 

You can find additional information in the Help → Help Contents section of S32 Design Studio (S32DS).

Please note that reconfiguring pin functionality multiple times is generally not recommended. However, if your application requires this approach, ensure that:

  • Ensure that the configuration does not conflict with other modules.
  • The pin configuration structures are not dynamically altered in a way that could cause unintended behavior.
0 Kudos
Reply

855 Views
halen45david
Contributor I

Hi there,

I have configure I2C0, but I2C will not work as expected  in between some times.

So I need to toggle the SCL 9 times, But I have already configured I2C using generated code by S32DS tool, If I need to config the SCL as gpio in between means How can I do that, any suggestion on this?

And after sending 9 clock pulses I need to revert back the SCL functionality to that pin.

 

When your I2C bus gets stuck, toggling the SCL line nine times can often clear the issue. To do this with your S32DS-generated code, you'll need to temporarily reconfigure the SCL pin from its I2C function to a GPIO output. After setting it as a GPIO, make sure it's configured as open-drain output, then toggle it high and low nine times. Finally, revert the SCL pin back to its I2C peripheral function and potentially re-initialize your I2C module to restore normal communication. You'll use SDK functions like PORT_SetPinMux and GPIO_WritePinOutput for this.

0 Kudos
Reply