Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE
In my project I use S29GL128S90TFI010 flash memory and TMS320F28379D microcontroller, which communicate via EMIF1 interface.
I used example project called emif_dc_flash from C2000Ware. I modified pinout for my project. Whereas I used EMIF1CS4 in my project, so I had to correctly modify EMIF_DC_initCS2 function.
Enter to CFI mode works fine. Checking CFI data is correct. Clearing the flash memory also works correctly.
But the EMIF_DC_programCS4Flash() function does not write any data to the flash memory. It is a customized EMIF_DC_programCS2Flash() function for the EMIF1CS4.
The definition of this function is:
//
// EMIF_DC_programCS4Flash - Program single 16b word to Flash address
//
void EMIF_DC_programCS4Flash(Uint16 emifModule, Uint32 addr, Uint16 data) {
Uint16 cmdNum;
Uint32 CS4Addr;
Uint16 restorePage;
restorePage = EMIF_DC_activeCS4Page;
EMIF_DC_selectCS4Page(emifModule, 0);
if( emifModule == 1 ) {
CS4Addr = EMIF_DC_EM1_CS4_ADDR;
}
for(cmdNum=0;cmdNum<sizeof(EMIF_DC_FLASH_PROG_SEQ)/2;cmdNum++) {
*(Uint16*)(CS4Addr + EMIF_DC_FLASH_PROG_SEQ[cmdNum][EMIF_DC_FLASH_SEQ_ADDR]) = EMIF_DC_FLASH_PROG_SEQ[cmdNum][EMIF_DC_FLASH_SEQ_DATA];
}
if( restorePage != EMIF_DC_activeCS2Page ) {
EMIF_DC_selectCS4Page(emifModule, restorePage);
}
*(Uint16*)addr = data;
F28x_usDelay(EMIF_DC_FLASH_BUSY_DELAY); // Wait for Ready/Busy# signal to become valid
while( GPIO_ReadPin(EMIF_DC_FLASH_READY[emifModule]) == 0 ); // Wait for Flash to complete command
}
where
#define EMIF_DC_EM1_CS4_ADDR 0x00380000
Do you have any advice for me? What am I doing wrong?
Thank you for your answers.
Regards
Joseph
