Hi,
In addition to http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/p/68376/359709.aspx#359709 I want to be more clearly.
I have a programm ready to work on the EVM5515.
I now want it to boot from SD Card. I have ereased the program on the SPI (coming with the EVM) and also erased Flash (nor and nand).
First Problem
I have the secureimageboot-utility and converted the out-File to a bin-File. I used "not bound to device" and some arbitrary values for keys.
I added SetupSystem() - Function as follows and changed the linker file as below. The programmtool writes to the SD Card, but it doesn't boot.
Can you please provide a running bin file, to check wheather my SD Card might have a boot problem (I can use the ata_fs-Demos and read and write to the SD Card.
Additionally: Why is this not booting:
#define ESCR 0x1c33
#define SDTIMR1 0x1020
#define SDTIMR2 0x1021
#define SDCR1 0x1008
#define SDCR2 0x1009
#define SDSRETR 0x103C
#define SDRCR 0x100C
#define PRCR 0x1C05
#define PCGCR1 0x1c02
#define PCGCR2 0x1c03
#define PSRCR 0x1c04
#define CLKCFGL 0x1c1e
#define CCR2 0x1c1f
#define CGCR1 0x1c20
#define CGCR2 0x1c21
#define CGCR3 0x1c22
#define CGCR4 0x1c23
#define CCSSR 0x1c24
#define IVPD 0x0049
void SetupSystem(){
int i=0;
/* Disable interrupts */
*(int*)0x0003 = *(int*)0x0003 | 0x0800; // Set INTM
*(int*)0x0000 = 0; // Clear IER0
*(int*)0x0000 = 0; // Clear IER1
// Zürcksetzen der Peripherie
*(ioport Uint16*)PSRCR = 0x0020;
*(ioport Uint16*)PRCR = 0x00BB;
// Interrupt vector
for(i=0;i<0xff;i++);
*(ioport Uint16*)IVPD = 0x027F; // Load interrupt vector pointer
/* Enable clocks to all peripherals */
*(ioport Uint16*) PCGCR1 = 0x0;
*(ioport Uint16*) PCGCR2 = 0x0;
/* Bypass PLL */
*(ioport Uint16*) CCR2 = 0x0;
/* Set CLR_CNTL = 0 */
*(ioport Uint16*)CGCR1 = *(ioport Uint16*)CGCR1 & 0x7FFF;
*(ioport Uint16*)CGCR1 = 0x8BE8;
*(ioport Uint16*)CGCR2 = 0x8000;
*(ioport Uint16*)CGCR3 = 0x0806;
*(ioport Uint16*)CGCR4 = 0x0000;
/* Wait for PLL lock */
for(i=0;i<0x7ff;i++);
/* Switch to PLL clk */
*(ioport Uint16*)CCR2 = 0x1;
/* Enable clocks to all peripherals */
SYS_PCGCR1 = 0x0000;
SYS_PCGCR2 = 0x0000;
// SDRAM
/* reset EMIF */
*(ioport Uint16*)PRCR = 0x0002;
for(i=0;i<0xff;i++);
//enable SDRAM clock
*(ioport Uint16*)CLKCFGL=0x0001;
/* enable word writes to EMIF regs */
*(ioport Uint16*)ESCR = 0;
/* step 1 */
*(ioport Uint16*)SDTIMR1 = 0x4710;
*(ioport Uint16*)SDTIMR2 = 0x3911;
*(ioport Uint16*)SDSRETR = 0x0007;
/* step 2 */
*(ioport Uint16*)SDRCR = 0x04E3;
/* step 3 */
*(ioport Uint16*)SDCR1 = 0x4720;
*(ioport Uint16*)SDCR2 = 0x0001;
/* step 4 */
for(i=0;i<0xff;i++) asm("\tnop");
/* step 5 */
*(ioport Uint16*)SDRCR = 0x061A;
}
My linker file is:
-stack 0x2000 /* Primary stack size */
-sysstack 0x1000 /* Secondary stack size */
-heap 0x2000 /* Heap area size */
-c /* Use C linking conventions: auto-init vars at runtime */
-u _Reset /* Force load of reset interrupt handler */
/* SPECIFY THE SYSTEM MEMORY MAP */
MEMORY
{
PAGE 0: /* ---- Unified Program/Data Address Space ---- */
MMR (RWIX): origin = 0x000000, length = 0x0000c0 /* MMRs */
DARAM0 (RWIX): origin = 0x0000c0, length = 0x00ff40 /* 64KB - MMRs */
SARAM0 (RWIX): origin = 0x010000, length = 0x010000 /* 64KB */
SARAM1 (RWIX): origin = 0x020000, length = 0x02A000 /* 128KB */
BOOT (RWIX): origin = 0x04E000, length = 0x001fff /* 64KB */
VECS (RWIX): origin = 0x04A000, length = 0x000200 /* 512B */
PDROM (RIX): origin = 0xff8000, length = 0x008000 /* 32KB */
PAGE 2: /* -------- 64K-word I/O Address Space -------- */
IOPORT (RWI) : origin = 0x000000, length = 0x020000
}
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
SECTIONS
{
.text >> SARAM1|SARAM0 /* Code */
/* Both stacks must be on same physical memory page */
.stack > DARAM0 /* Primary system stack */
.sysstack > DARAM0 /* Secondary system stack */
.data >> DARAM0|SARAM0|SARAM1 /* Initialized vars */
.bss >> DARAM0|SARAM0|SARAM1 /* Global & static vars */
.const >> DARAM0|SARAM0|SARAM1 /* Constant data */
.sysmem > DARAM0|SARAM0|SARAM1 /* Dynamic memory (malloc) */
.switch > SARAM1 /* Switch statement tables */
.cinit > SARAM1 /* Auto-initialization tables */
.pinit > SARAM1 /* Initialization fn tables */
.cio > SARAM1 /* C I/O buffers */
.args > SARAM1 /* Arguments to main() */
vectors > VECS /* Interrupt vectors */
.ioport > IOPORT PAGE 2 /* Global & static ioport vars */
}
Second Problem
I want to use the SDRAM. Can I use it to hold some time uncritical init-routines during startup? As I understand do I have to init the RAM, CCS does this for me, but if I boot from the SD Card, I would have to init it or is there a default mode running? Is this possible at all?
Thanks in advance.
Micky