Resetting a peripheral

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Resetting a peripheral

ソリューションへジャンプ
701件の閲覧回数
stefano-quantic
Contributor III

On iMXRT1176, how can I completely reset a peripheral's registers to the default out-of-reset values?

For instance, if I have an RTOS task handling a peripheral, and the task crashes and is then restarted, the peripheral will be left in an unknown state. When the task restarts, it should re-initialize the peripheral. But in some cases it could be wrong to just reinitialize it as if just out of a reset; for instance, when a peripheral is active/transmitting, some registers cannot be written.

So, I'd need a way to revert the peripheral to the default state, without creating an ad hoc procedure to disable the peripheral (if active) following a specific, proper order for writing to the registers, and to restore all the default values (which might not all be 0).

Of course, I cannot just reset the whole MCU.

Is there a dedicated flag to completely reset a peripheral? Or, could it be done by some clock gating or power gating setting? Or some setting in the Slice Reset Controller (SRC)?

タグ(3)
0 件の賞賛
1 解決策
681件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @stefano-quantic ,

Different peripherals have different reset strategy. Some peripherals like LPI2C, LPUART, ENET have soft reset control bit which can be used to reset the peripherals. Some can event be power off. And some peripherals like watchdog can't be reset until power on reset.

May of peripherals drive have deinit function which can be used to reset the peripheral, for example 

LPI2C_SlaveDeinit()

 

Regards,

Jing

元の投稿で解決策を見る

0 件の賞賛
1 返信
682件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @stefano-quantic ,

Different peripherals have different reset strategy. Some peripherals like LPI2C, LPUART, ENET have soft reset control bit which can be used to reset the peripherals. Some can event be power off. And some peripherals like watchdog can't be reset until power on reset.

May of peripherals drive have deinit function which can be used to reset the peripheral, for example 

LPI2C_SlaveDeinit()

 

Regards,

Jing

0 件の賞賛