De-initializing an already de-initialized peripheral causes a BusFault

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

De-initializing an already de-initialized peripheral causes a BusFault

1,268 Views
mastupristi
Senior Contributor I

Hi,

Deinit functions have a similar structure to each other. First peripheral registers are accessed then then the peripheral clock is "turned off"

mastupristi_0-1716988284266.png 

mastupristi_1-1716988376470.png

If deinitialization is retried a BusFault will be raised for attempting to access a clockless peripheral.
It would be needed for the deinit functions to check beforehand whether the peripheral is already deinitialized, in which case return without doing anything else.

I have something like this in mind:

add CLOCK_IsClockEnabled() to fsl_clock.h:

mastupristi_0-1716990281941.png

And then I would use it in deinit functions:

mastupristi_1-1716990353558.png

 

best regards

Max

Tags (2)
0 Kudos
Reply
3 Replies

1,190 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @mastupristi,

I have suggested your recommendation to the internal SDK team in hopes that they add this feature in the future. Thanks for sharing.

BR,
Edwin.

0 Kudos
Reply

1,249 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @mastupristi 

Thanks for your sharing. Would you mind tell us which chip do you used? Thanks.

 

BR

Alice

0 Kudos
Reply

1,247 Views
mastupristi
Senior Contributor I

RT1051 and RT1175

0 Kudos
Reply