This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS570LS1114: How to read and write rightly to operate the FLASH based on TMS570LS1114?

Part Number: TMS570LS1114

Tool/software: Code Composer Studio

Hello :

I read and write FLASH , based on the F021 FLASH API, founding that the write data is normal, but when read, there is no data. My steps are:

1 Divide an area in the CMD

2 for the division of the area to write data

3 for the divided area to read data

I have been tested and found three problems. The first problem is that I can write data, but the data is not correct, whether my method  is wrong  in the process, how do I modify it? The second problem is that I transplanted flash yesterday wrote a new project into the process and found that some can be achieved FLASH data write, and some are not? Of course, I was based on HALCogen generated code, the failure to write and halcogenconfiguration related?

Regarding what QJ Wang mentioned 1 yesterday, what should I do in the program?

About 2 and 3 you mentioned yesterday have been changed.

MEMORY
{
/*VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH0 (RX) : origin=0x00000020 length=0x000FFFE0
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0001EB00*/
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH0 (RX) : origin=0x00000020 length=0x000F5FE0
CAL_ROM (RX) : origin=0x000FE000 length=0x000003E8//length=0x00002000
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001501 length=0x0001CFFF
CAL_RAM (RW) : origin=0x0801E500 length=0x00001000

void Fapi_FLASH_init(void)
{
Fapi_initializeFlashBanks(GCLK_FREQ);
Fapi_setActiveFlashBank(Fapi_FlashBank0);
Fapi_enableMainBankSectors(0xFFFFF);//0x0000_0000-0x0000_3FFF

}

uint8 Fapi_FLASH_save(uint32_t *Flash_Start_Adress, uint32_t *Datas_Start_Adress,uint8_t Datas_SizeInBytes)

{

uint16 i = 50000;
register uint32_t ESA=Flash_Start_Adress;
register uint32_t DSA=Datas_Start_Adress;
register uint8_t DSB=Datas_SizeInBytes;
while(i--)
{
if(Fapi_Status_FsmReady == Fapi_checkFsmForReady())
break;
}
Fapi_issueProgrammingCommand((uint32_t*)ESA, (uint8_t*)DSA, DSB, 0, 0, Fapi_AutoEccGeneration);

// Fapi_doVerifyByByte((uint8_t*)ESA,(uint32_t)DSB,uint32_t DSA,Fapi_Status_Success);
}

uint8 Fapi_FLASH_read(uint32_t *Flash_Start_Adress, uint32_t *Datas_Start_Adress,uint8_t Datas_SizeInBytes)
{
uint16 i = 20000;
register uint32_t ESA=Flash_Start_Adress;
register uint32_t DSA=Datas_Start_Adress;
register uint8_t DSB=Datas_SizeInBytes;
while(i--)
{
if(Fapi_Status_FsmReady == Fapi_checkFsmForReady())
break;
}
Fapi_doMarginReadByByte((uint32_t*)ESA, (uint8_t*)DSA,(uint8_t)DSB,Fapi_NormalRead);


}

int main(void)
{
/* USER CODE BEGIN (3) */
/*************************2017/12/27********FAPI Operate FLASH *******************************************
*********************************************************************************************************/
Fapi_FLASH_init();
Fapi_FLASH_save(0x000FE100,API_flash_save_data,16);
Fapi_FLASH_read(0x000FE200,API_flash_read_data,16);
while(1);

I am looking forward to your replay.

                                                                                                                                                                                                                      QiiuChi

2017/12/28