Resetting a peripheral

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

Resetting a peripheral

Jump to solution
664 Views
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)?

0 Kudos
1 Solution
644 Views
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

View solution in original post

0 Kudos
1 Reply
645 Views
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 Kudos