AnsweredAssumed Answered

Debugging code running in SDRAM

Question asked by Peter847 on Feb 28, 2012
Latest reply on Feb 29, 2012 by Peter847



I'm having difficulty using the debugger to run code in SDRAM on a custom board (BF534-based) using the ICE100B emulator. My project is VDK-based and I am using VDSP++ 5.0, Update 10.


My setup has a bootloader programmer (in Flash) which runs at boot time and loads a program stored in Flash into SDRAM. Before copying the program from Flash to SDRAM the program sets up the SDRAM. The bootloader then forces execution to the start of the program image in SDRAM (using a function pointer set to 0x40 (the start of program code). All of this works OK and my program works.


What I now want to do is use the emulator to load, run and step-through a debug version of the code. This will allow me to run and debug the code without having to re-flash the board for every change to the code and also I can set breakpoints, examine registers etc. I have used the emulator/debugger extensively on programs compiled to run on Blackfin internal RAM with no problem. But when I try to debug a program compiled to run from SDRAM it doesn't work. Pressing F7 to build and load works normally until the load is complete and then instead of staying in the HALTED mode waiting for me to start it it goes immediately to RUNNING mode. Sometimes it stops at KernelPanic, sometimes it runs until I halt it and sometimes I cannot halt it and have to close the emulator session. None of my breakpoints are ever hit. It seems as though the CPU is running out of control. Using the various debug windows I can check CPU registers and the SDRAM and they all seem to have sensible stuff in them.


I am using the custom board-support file shown below to set up the SDRAM and set the reset vector EVT1 to 0x40. Have I missed some setup value?









<?xml version="1.0" standalone="yes"?>




     xsi:noNamespaceSchemaLocation="\Program Files\Analog Devices\VisualDSP 5.0\System\ArchDef\ADSP-custom-board.xsd"




<!-- ************************************************************************* -->

<!-- ******* ADSP-BF534-Multicontroller-custom.xml                             -->

<!-- ************************************************************************* -->

<!-- ******* Custom register reset definitions for SDRAM.                      -->

<!-- *******       <custom-register-reset-definitions>                         -->

<!-- ************************************************************************* -->




     <!-- SDRAM reset definitions -->


     <register name="EBIU_SDRRC" reset-value="0x305" core="Common" />

     <register name="EBIU_SDBCTL" reset-value="0x13" core="Common" />

     <register name="EBIU_SDGCTL" reset-value="0x80911189" core="Common" />


     <!-- Reset address -->


     <register name="EVT1" reset-value="0x40" core="Common" />