5213 problems...debugging and printf

cancel
Showing results for 
Search instead for 
Did you mean: 

5213 problems...debugging and printf

1,668 Views
airswit
Contributor III
Hi everyone,

I am working on my senior project, and have asked this of the tech support at freescale...they told me to re-write everything from scratch..and read all of the technical data sheets for codewarrior. my problems are that I can no longer debug this project over the BDM cable, in sram. I try using the 'console debug' target, but when i try to run the debugger, i get a bus error when it tries to call uart_init(). Also, i cannot use the printf function (it just doesn't do anything...skips over it?), and i know that it does in some of the files i have downloaded from freescale (this is for the M5213EVB, with some peripherals added on). i doubt i will get help here, because I have asked this question before, but i'll give it a shot. I have attached my project files, and hope to hear back from someone soon!
Labels (1)
0 Kudos
1 Reply

48 Views
DrSeuss
Contributor I
You should let the initialization of ram and vectors complete befor using them:
 
void
mcf5213_init(void)
{
/********************************************************************/
/*  RAMBAR & FLASHBAR already initialized in asm_startmeup         */
/********************************************************************/
 extern char __DATA_ROM[];
 extern char __DATA_RAM[];
 extern char __DATA_END[];
 extern char __BSS_START[];
 extern char __BSS_END[];
 extern uint32 VECTOR_TABLE[];
 extern uint32 __VECTOR_RAM[];
 register uint32 n;
 register uint8 *dp, *sp;
 /* Copy the vector table to RAM */
 if (__VECTOR_RAM != VECTOR_TABLE)
 {
  for (n = 0; n < 256; n++)
   __VECTOR_RAM[n] = VECTOR_TABLE[n];
 }
    mcf5xxx_wr_vbr((uint32)__VECTOR_RAM);
 /*
  * Move initialized data from ROM to RAM.
  */
 if (__DATA_ROM != __DATA_RAM)
 {
  dp = (uint8 *)__DATA_RAM;
  sp = (uint8 *)__DATA_ROM;
  n = __DATA_END - __DATA_RAM;
  while (n--)
   *dp++ = *sp++;
 }
 
 /*
  * Zero uninitialized data
  */
 if (__BSS_START != __BSS_END)
 {
  sp = (uint8 *)__BSS_START;
  n = __BSS_END - __BSS_START;
  while (n--)
   *sp++ = 0;
 }
 mcf5213_wtm_init();
 mcf5213_pll_init();
 mcf5213_uart_init();
 mcf5213_allow_interrupts();
  
}
0 Kudos