cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop m4 core within m4 core

SMich.1
Senior

hi,

I need to stop some peripherals within m4 core before linux stop command:

echo -n stop > /sys/class/remoteproc/remoteproc0/state

how can I manage that ?

tnx.

1 REPLY 1
AntonioST
ST Employee

The command in your post causes a reset of the M4.

There is no way for the M4 to avoid or to delay the reset and run some code.

Maybe you could send a message from Linux to M4 'before' stopping the M4. This will inform M4 about the imminent stop and M4 can stop the peripherals.

Please also notice that every peripheral's clock that has been enabled by M4 through the RCC registers RCC_MC_*ENSETR will be automatically disabled when the M4 is reset by Linux. I mean, even if the bits in RCC_MC_*ENSETR will remain set, the corresponding clock will not run when M4 is kept in reset by Linux.