S32K GPIO initialization

cancel
Showing results for 
Search instead for 
Did you mean: 

S32K GPIO initialization

801 Views
cg0
Contributor II

S32K GPIO initialization is better add a initValue setting when configure as a output.

when initialize a pin as ouput, it can't definet the initialize output level, but search from the generated code, there do have a  initValue variable, but it did't use. 

Tags (2)
2 Replies

489 Views
constantinrazva
NXP Employee
NXP Employee

Hello again cg0‌,

I must add the following: if you need to add any block to the initialization function (called once at the beginning), you can use the standard Simulink block Initialize Function. You can find it by typing "Initialize" in the model, then selecting it, or from the Simulink library browser (slLibraryBrowser) - under Simulink/User-Defined Functions. You can put inside this special subsystem the GPIO output block, with the constant you need to set in the initialization. You can delete the state writer that comes with the standard block.

View from Top model - Initialize subsystem:

pastedImage_2.png

View from inside the Initialize subsystem:

pastedImage_1.png

Note: You'll most likely have to set "Unspecified initialization detection" to "Simplified" - for the model to build. You will get an error otherwise. 

pastedImage_1.png

Hope this helps,

Razvan.

0 Kudos

489 Views
constantinrazva
NXP Employee
NXP Employee

Hello cg0‌,

You are right, the GPIO blocks do not have the option to set an initial value. If you need this, in our current release you can add a subsystem you call only once in the beginning (controlled by a flag variable) in which you can use the GPO block and set it to the desired value. We'll take this feedback under consideration and we'll most likely add this option in the block itself in our next release (which will come out this summer).

Thank you for sharing your thoughts!

Kind regards,

Razvan.

0 Kudos