Other Parts Discussed in Thread: TMS570LS3137
Tool/software: Code Composer Studio
Hi,
I'm programming flash on tms570ls3137 demo board,in the Programming a Single Byte example code of spna148.pdf,I didn't see the code to calculate ecc,what is the code for calculating ecc?
Thanks.
FLASH_CONTROL_REGISTER->Fbprot.u32Register = 1U; /* Disable Level 1 Protection */ /* Enable all sectors of current bank for erase and program. For EEPROM banks with more than 16 sectors, this must be 0xFFFF */ FLASH_CONTROL_REGISTER->Fbse.u32Register = 0xFFFF; FLASH_CONTROL_REGISTER->Fbprot.u32Register = 0U; /* Enable Level 1 Protection */ /*Unlock FSM registers for writing */ FLASH_CONTROL_REGISTER->FsmWrEna.u32Register = 0x5U; /* Set command to "Clear the Status Register" */ FLASH_CONTROL_REGISTER->FsmCommand.FSM_COMMAND_BITS.FSMCMD = Fapi_ClearStatus; /* Execute the Clear Status command */ FLASH_CONTROL_REGISTER->FsmExecute.FSM_EXECUTE_BITS.FSMEXECUTE = 0x15U; /* Write address to FADDR register */ FLASH_CONTROL_REGISTER->Faddr.u32Register = 0x0100U; /* Placing byte at address 0x0102 */ oFwpWriteByteAccessor[2] = 0xA5; /* Set command to "Program" */ FLASH_CONTROL_REGISTER->FsmCommand.FSM_COMMAND_BITS.FSMCMD = Fapi_ProgramData; /* Execute the Program command */ FLASH_CONTROL_REGISTER->FsmExecute.FSM_EXECUTE_BITS.FSMEXECUTE = 0x15U; /* re-lock FSM registers to prevent writing */ FLASH_CONTROL_REGISTER->FsmWrEna.u32Register = 0x2U;