Dear support,
may you advise me wgy the FSM is running wrongly?
Scenario:
TMS570LS3137
The first addresses of the 1-st (0-th ;-)) sector in the Bank 1 (code is running from Bank 0) are initialized as follows:
const unsigned int dummyFlashInit[] = { 0xA5A5A5A5U, 0xA5A5A5A5U, 0xA5A5A5A5U, 0xA5A5A5A5U };
Erase sequence:
pDest = (unsigned int) 0x180000U;
flashWREG->FMAC = (unsigned int) Fapi_FlashBank0;
flashWREG->FBPROT = 1U;
flashWREG->FBSE = 0x0001U;
flashWREG->FBPROT = 0U;
flashWREG->FSM_WR_ENA = 0x5U;
flashWREG->FSM_SECTOR = 0xFFFEU << 16U;
flashWREG->FSM_COMMAND = (unsigned int) Fapi_ClearStatus;
flashWREG->FSM_EXECUTE = Q_F021_EXEC_TRIGGER;
flashWREG->FADDR = (unsigned int) pDest;
flashWREG->FSM_COMMAND = (unsigned int) Fapi_EraseBank;
flashWREG->FSM_EXECUTE = 0x15U;
flashWREG->FSM_WR_ENA = 0x2U;
FMSTAT = 0x11 --> SLOCK bit is set although FBSE has been set correctly.
Of course, FSM_SECTOR has not changed - in a correct case I would expect the value of (0x0001U << 16U).
If the command Fapi_EraseSector is executed instead of Fapi_EraseBank, the status register FMSTAT = 0x18U.
Control register includes both following settings of read wait without any changes regarding the erase results:
flashWREG->FRDCNTL = 0x00000000U
//| (3U << 8U)
| (0xFU << 8U)
| (1U << 4U)
| 1U;
Please do you have any idea what I have missed?
Many thanks in advance,
Best regards
Jiri