Hello,
According to section 3.2 (Detailed procedure) of app note AN5317 (Loading Code on
Cortex-M4 from Linux for the i.MX 6SoloX and i.MX 7Dual/7Solo), Rev. 0, 08/2016
the following is recommended sequence to load and run the CM4 code:
1) Issue a software platform reset by setting up SW_M4P_RST (Bit 2) in the SRC_M4RCR
(SRC_M4RCR[2]) register. Issuing a platform reset, resets the Cortex-M4 cores and
associated memories.
2) Load the code for the Cortex-M4 processor into the (TCM_L) memory.
3) Setup the Stack and PC pointer in the OCRAM_S memory, because after reset the
processor uses the OCRAM_S start address (0x0018_0000) as the first instruction.
4) Set the ENABLE_M4 (Bit 3) in the SRC_M4RCR (SRC_M4RCR[3]) register.
5) Set the SW_M4C_RST (Bit 1) in the SRC_M4RCR (SRC_M4RCR[1]) register, which will
boot the new code on the Cortex-M4 processor.
So, we can see that, the variant A in Your considerations is not correct; at least it violates
the recommended sequence.
When it is needed to reload a new image, just repeat steps 1-3, as recommended in the
app note. There is no mentions about disable / enable CM4 with ENABLE_M4. Generally
such approach works, but I recommend to disable CM4 before reloading new application.
So, regarding Your question “Is M4 non running under B correct?” - no, it is not guaranteed.
Please look at the following Community thread.
https://community.nxp.com/message/1011287
Note, bit SW_M4C_NON_SCLR_RST (bit 0) in the SRC_M4RCR[3] can be used to hold the CM4
core in reset state.
Regards,
Yuri.