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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,344 次查看
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

标记 (2)
0 项奖励
回复
3 回复数

1,266 次查看
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 项奖励
回复

1,325 次查看
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 项奖励
回复

1,323 次查看
mastupristi
Senior Contributor I

RT1051 and RT1175

0 项奖励
回复