Hi,
We are stuck on some inexplicable issue, please review the setup below and advice, thanks.
(The same setup code and application works with GEL and CCS, but fails to run from an SPI bootflash)
-The system we have developed is build with an C5515 and has a external mSDRAM (MT48H4M16LF-8)
We want to place some code in a external SDRAM. Before the bootloader can write code into ext SDRAM the EMIF must be configured for the uSDRAM
on the target. In debug mode the uSDRAM init setup is done by the code in the GEL file. Loading and running the code with the debugger works fine.
We have tried to translate the IMIF setup code in the GEL to corresponding register values and let the HEX55 tool create an image including preload of registers.
With the HEX55.EXE it is possible put all option switches in a command file. One of the option is to preload registries before the bootloading of code
starts. We are using that option for setting up the EMIF.
After programming the flash and rebooting the system we can see that the code is loaded but
stuck when the code tries to call functions stored in the external RAM. The reason is probably a bad setup of the EMIF
The command file for the HEX55 contains following commands
evm_sample.out
-v5505
-serial8
-map evmdemo.map
-boot
-o evmdemo.bin
-b /* Binary format */
-reg_config=0x1c02,0x0000 /* Activate all perifial clock
-reg_config=0x1c03,0x0000 /* IMIF clock is needed */
-reg_config=0x1c26,0x0000 /* EDIV active Sysclock divided by 2 fir SDRAM */
-reg_config=0x1c1e,0x0001 /* enable SDRAM CLOCK */
-reg_config=0x1c1f,0x0000 /*bypass PLL */
-reg_config=0x1c20,0x8be8 /*Set PLL to 98MHZ PLL CTL0*/
-reg_config=0x1c21,0x8000 /* PLL CTL1 */
-reg_config=0x1c22,0x0806 /* PLL CTL2 */
-reg_config=0x1c23,0x0000 /* PLL CTL3 */
-delay 0x07ff /* wait 0x7fff */
-reg_config=0x1c1f,0x0001 /* remove bypass */
-reg_config=0x3000,0x0019 /* set SPI divider to 25 -> 4MHz */
/*-reg_config=0x3a04,0x0101 set SD_FLASH clock divisor to 1 -> 25MHz */
/* setup mSDRAM for MT48H4M16LF-8
-reg_config=0x1c05,0x0002 /* reset EMIF */
-delay 0x00ff /* wait 0xff */
-reg_config=0x1c1e,0x0001 /* enable clock */
-reg_config=0x1c33,0x0000 /* */
-reg_config=0x1020,0x4710 /* for timing details see "SPRUGU6.PDF" */
-reg_config=0x1021,0x3911 /* */
-reg_config=0x103c,0x0007 /* */
-reg_config=0x100c,0x04e3 /* */
-reg_config=0x1008,0x4720 /* */
-reg_config=0x1009,0x0001 /* */
-delay 0x00ff /* wait 0xff */
-reg_config=0x100c,0x061a /* */
The beginning of the generated evmdemo.bin looks like this
09 aa 00 00 a0 00 00 16 1c 02 00 00 1c 26 00 00
1c 1e 00 01 1c 1f 00 00 1c 20 8b e8 1c 21 80 00
1c 22 08 06 1c 23 00 00 ff ff 07 ff 1c 1f 00 01
30 00 00 19 ff ff 00 ff 1c 1e 00 01 1c 33 00 00
10 20 47 10 10 21 39 11 10 3c 00 07 10 0c 04 e3
10 08 47 20 10 09 00 01 ff ff 00 ff 10 0c 06 1a
/Magnus and David