Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN
Hi,
In enabling the sectors of EEPROM banks, there is a configuration for FSM_SECTOR1 register where the complete register is updated:
FLASH_CONTROL_REGISTER->FsmSector1.u32Register = ~(u32SectorsEnables_31_0);
As there are 32 sectors in EEPROM, the complete register can be configured for performing erase operation.
While enabling the sectors of main banks, the FSM sector is found to be updated as below:
FLASH_CONTROL_REGISTER->FsmSector1.u32Register = (uint32_t)(~u32SectorsEnables)<<0x10U;
The complete register is updated due to the assignment which always affects the upper 16 bits of the register and the lower 16 bits are always set to 0 due to the shift operation. There are only 16 sectors available for both the main banks Bank 0 and Bank 1 which means that the lower 16 bits of FSM_SECTOR1 should get updated corresponding to the variable u32SectorsEnables.
Kindly, let me understand how this configuration of FSM_SECTOR1 register in the implementation leads to enabling the corresponding sectors of the main bank as provided in FSM_SECTOR1 register description from the manual.
Thank you,
Susvitha.