Good evening,
I am a SW engineer who is developing a new DSP board with the TMS320C6655.
I have difficulties accessing a Micron NOR Flash Memory (JS28F256M29EWLA) from a TMS320C6655, via the EMIF 16 Interface.
The Flash Memory is supposed to be accessed at 16 bit.I am able to erase sectors and program values via the GEL file.
The FLASH memory area is declared in the Setup_Memory_Map() GEL routine as below
GEL_MapAddStr( 0x70000000, 0, 0x04000000, "R|W|AS2", 0 ); // EMIF16 CS2 NOR
The GEL routine to program a value is
hotmenu ProgFlash_2()
{
Delay_milli_seconds(1);
*((unsigned short *) 0x70000AAA) = 0x00AA;
Delay_milli_seconds(1);
*((unsigned short *) 0x70000554) = 0x0055;
Delay_milli_seconds(1);
*((unsigned short *) 0x70000AAA) = 0x00A0;
/*Delay_milli_seconds(1);*/
*((unsigned short *) 0x70000010) = 0xABCD;
}
What is strange is that according to the Micron Datasheet the command registers for 16 bit access should be at 0x555 and at 0x2AA,
while it works with 0xAAA and 0x554.By the way, the addresses for 8 bit access are 0xAAA and 0x555.
Using the GEL file it works independently from the values in the EMIF configuration registers,
either with the default/reset values or with the values below
#define EMIF16_BASE 0x20C00000
#define EMIF16_AWCCR_DEF 0xC0222200
#define EMIF16_A1CR_DEF 0x8532299D
#define EMIF16_A4CR_DEF 0x00480240
#define EMIF16_AWCCR (*(unsigned int*)(EMIF16_BASE + 0x004))
#define EMIF16_A1CR (*(unsigned int*)(EMIF16_BASE + 0x010))
#define EMIF16_A4CR (*(unsigned int*)(EMIF16_BASE + 0x01C))
EMIF16_AWCCR = EMIF16_AWCCR_DEF;
EMIF16_A1CR = EMIF16_A1CR_DEF;
EMIF16_AWCCR = EMIF16_AWCCR_DEF;
EMIF16_A4CR = EMIF16_A4CR_DEF;
The problem is that I am not able to reproduce this behaviour with my C program.
The routine below has no effect.
/* Program an UINT16 value at specified address. */
extern BOOLEAN flash_basic_program()
{
wait_us(1000);
*((unsigned short *) 0x7000AAA) = 0x00AA;
wait_us(1000);
*((unsigned short *) 0x7000554) = 0x0055;
wait_us(1000);
*((unsigned short *) 0x7000AAA) = 0x00A0;
wait_us(1000);
*((unsigned short *) 0x70000010) = 0xABCD;
}
Actually I am not able to execute any of the
FLASH command sequences. I suspect that the C program addresses the chip differently,
but I am not able to see why.I don't even know if it si possible to the see the assembler corresponding to the GEL routine.
I was not able to find in Code Composer Studio /SYS-BIOS/xcd or the related documentation how to do the equivalent of:
GEL_MapAddStr( 0x70000000, 0, 0x04000000, "R|W|AS2", 0 ); // EMIF16 CS2 NOR
that is how to configure a 16 bit access for the FLASH address space.
So my questions are:
-Is there a reason for the "strange" addressing when using the GEL file?
-How can I configure a 16bit access for the FLASH address space?
Thanks in advance.
I look forward to hearing from you.
Best Regards
Luciano Fiorella