Resetting a peripheral

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

Resetting a peripheral

跳至解决方案
700 次查看
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 解答
680 次查看
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 回复
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 项奖励