2020-09-22 05:38 AM
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.
2020-09-22 09:15 AM
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.