AnsweredAssumed Answered

How to setup external PRAM Debugging for DSP56F8367

Question asked by Stephen Noonan on Sep 14, 2016
Latest reply on Jan 20, 2017 by Stephen Noonan

I am looking for some help getting CodeWarrior for MCU 10.6.4 to download program code to a external memory chip.


This is an 56F8367, with CS0 tied to the memory chip's enable pin, D0:15 for data, and A0:17 for address.


The following C code written by Processor Expert allows me to read and write to it at runtime:


/* External bus initialization */
/* SEMI_CSBAR_0: ADR23=0,ADR22=0,ADR21=0,ADR20=0,ADR19=0,ADR18=1,ADR17=0,ADR16=0,ADR15=0,ADR14=0,ADR13=0,ADR12=0,BLKSZ3=0,BLKSZ2=1,BLKSZ1=1,BLKSZ0=0 */
setReg16(SEMI_CSBAR_0, 1286U); /* Chip select 0 base address register */


/* SEMI_CSOR_0: RWS=2,BYTE_EN=3,R_W=3,PS_DS=2,WWS=2 */
setReg16(SEMI_CSOR_0, 6082U); /* Chip select 0 option register */



/* SEMI_CSTC_0: WWSS=1,WWSH=1,RWSS=1,RWSH=0,??=0,??=0,??=0,??=0,??=0,MDAR=1 */
setReg16(SEMI_CSTC_0, 21505U); /* Chip select 0 timing control register */



/* GPIO_D_PER: PE|=256 */
setReg16Bits(GPIO_D_PER, 256U);



/* SEMI_BCR: DRV=1,BMDAR=0,??=0,??=0,BWWS=18,BRWS=28 */
setReg16(SEMI_BCR, 33372U); /* Bus control register */


I can write code that writes P code to the external ram and then runs from the external ram, but I would like the debugger to set up the chip selects and directly program to external ram, and then run from it.


I have a linker command file that writes and links and .elf to 0x50000 which is where i have my chip select (CSBAR_0 = 0x506).


I found the MC56F8367_PRAM.tcl, which I thought I could modify to do just that. So I took the values in the C code above and translated it to the initialization file, for example:

# /* SEMI_CSBAR_0: ADR23=0,ADR22=0,ADR21=0,ADR20=0,ADR19=0,ADR18=1,ADR17=0,ADR16=0,ADR15=0,ADR14=0,ADR13=0,ADR12=0,BLKSZ3=0,BLKSZ2=1,BLKSZ1=1,BLKSZ0=0 */
# CSBAR_0 = 0xF020, 1286U = 0x0506
change x:0xF020 0x0506


# /* SEMI_CSOR_0: RWS=2,BYTE_EN=3,R_W=3,PS_DS=2,WWS=2 */
# CSOR_0 = 0xF028, 6082U = 0x17C2
change x:0x00f028 0x17C2


# /* SEMI_CSTC_0: WWSS=1,WWSH=1,RWSS=1,RWSH=0,??=0,??=0,??=0,??=0,??=0,MDAR=1 */
# CSTC_0 = 0xF030, 21505U = 0x5401
change x:0x00f030 0x5401


# /* GPIO_D_PER: PE|=256 */
# GPIO_D_PER = 0xF323, 256U = 0x100
change x:0x00f323 0xff1f


# /* SEMI_BCR: DRV=1,BMDAR=0,??=0,??=0,BWWS=18,BRWS=28 */
# EMI_BCR = 0xF038, 33372U = 0x825C
change x:0x00f038 0x825C

This however does not work. The EMI registers appear unchanged by any of those change arguments.


So, am I missing something? For example,does the memory configuration file (*.mem) need to be modified? Are there any samples I can download somewhere?