How to setup external PRAM Debugging for DSP56F8367

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to setup external PRAM Debugging for DSP56F8367

1,767 Views
steve_n
Contributor II

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?

 

Thanks!

Labels (1)
0 Kudos
Reply
2 Replies

1,570 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello Stephen

By default, the register should be able to be configured in memory initialization file (*.tcl).  Please check whether GPIO_D_PER register is 0x00FF after your programming.  And whether the other registers configured in *.tcl are also shown as Reset Value in debugger. 

If so, it shows that the debugger generates a reset signal before running the application.

Best Regards
Fiona Kuang
TIC - Technical Information Center
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Mark Correct button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,571 Views
steve_n
Contributor II

Eventually I figured out that I had to swap the values for my "change x" commands. This got my chip selects and other registered configured properly. However I have still not been able to get my Debug connection to actually program the PRAM section. I have a related, but distinct issue where I was unable to get my internal PRAM section programmed through the debugger.

0 Kudos
Reply