Hi everyone,
I am doing a project in my company with MIMXRT1024, and I am facing problems with getting the module to enter serial download mode.
I needed to make some changes in the code to solve some I/O problems with the following lines:
int ocotp_ctrl = OCOTP->CTRL;
ocotp_ctrl &= ~OCOTP_CTRL_ADDR_MASK;
ocotp_ctrl|= OCOTP_CTRL_ADDR(6);
ocotp_ctrl &= ~OCOTP_CTRL_WR_UNLOCK_MASK;
ocotp_ctrl|= OCOTP_CTRL_WR_UNLOCK(0x3E77);
OCOTP->CTRL = ocotp_ctrl; //Write ADDR and unlock
OCOTP->DATA = (long)((1<<4)|(1<<16));//burn BT_FUSE_SEL (1<<4) and FORCE_INTERNAL_BOOT (1<<16)
After that, my module never entered serial download mode. This is correct, but I needed to revert this condition, and I couldn´t.
The way that I tried to revert this condition was to clear the flags that I had set before, but the result is the same: the module doesn´t enter serial download mode anymore. The lines below are the lines that I changed in my code:
int ocotp_ctrl = OCOTP->CTRL;
ocotp_ctrl &= ~OCOTP_CTRL_ADDR_MASK;
ocotp_ctrl|= OCOTP_CTRL_ADDR(6);
ocotp_ctrl &= ~OCOTP_CTRL_WR_UNLOCK_MASK;
ocotp_ctrl|= OCOTP_CTRL_WR_UNLOCK(0x3E77);
OCOTP->CTRL = ocotp_ctrl; //Write ADDR and unlock
OCOTP->DATA = (long)((0<<4)|(0<<16));