Sign in

username:

password:



Not a member?

Search c55x



Search tips

Subscribe to c55x



c55x by Keywords

AIC23 | C5509 | CCS | CSL | EMIF | EVM | GEL | GPIO | HPI | Interfacing | JTAG | McBSP | OMAP | Omap15 | OMAP59 | RTDX | SDRAM | TMS320VC5509 | USB | XDS5

Ads

Discussion Groups

Discussion Groups | TMS320C55x | reg:Bootloader

Technical discussions about the TI C55x DSPs (including the c5501, c5502, c5503, c5507, c5509, c5510 and OMAP5910).

  

Post a new Thread

reg:Bootloader - Shanthi - Jul 26 8:46:39 2007



Sir,
i am using TMS320vc5502.My application is working properly in emulator mode.But in boot mode if
am writing a program without interrupt its working properly but if i am loading an a program
with interrupt its not working.I am using Serial EEPROM boot mode.U kindly tell me wts the
problem and reply me.

my code:
#include <stdio.h>
#include <csl.h>
#include <csl_gpio5502.h>
#include <csl_chip.h>
#include <csl_pllB.h>
#include <csl_irq.h>

Uint16 TriggerFlag=0;
extern Uint32 vecs;
void delay(Uint16 val);
interrupt void INT0Isr(void);
void setupinterrupts(void);

//========================
//Configuration of PLL
//======================== 

PLL_Config myConfig={
    
    0x0001,  //PLLCSR
    0x000F,  //Multiply by 15 to generate 300MHZ
    0x8000,  //Div0-divided by 1
    0x8001,  //Div1-Divided by 1 to generate MHZ for Fast peripheral clkSYSCLK 1
    0x8003,  //Div2-Divided by 4 to generate 75MHz for slow peripherals clk SYSCLK2
    0x8003,  //Div3-Divided by 4 to generate 75MHz for EMIF clk SYSCLK3
    0x0000, //oscDiv1 
    0x001F,  //Wake up enable
    0x0000, //clockmode 
    0x0004   //CLK OUT selection.
    };
//================================
//Configuration structure of GPIO
//================================
     
GPIO_ConfigAll gCfg={

               0x00FF,    //Configuring the 8 GPIO pins as output pins
               0xFFFF,    //Configured PGPIO0 pins as output
               0xFFFF,    //Configured PGPIO1 pins as output    
               0xFFFF,    //Configured PGPIO2 pins as output 
               0xFFFF,    //Enable PGPIO Ports 0-15
               0xFFFF,    //Enable PGPIO Ports 16-31
               0xFFFF,    //Enable PGPIO Ports 32-45
               };
void GPIO_init(void)
{
 CHIP_RSET(XBSR,0x0000); 
 GPIO_configAll(&gCfg);
 
 asm("  BSET EALLOW");
 GPIO_RSET(IODIR,0x00FF);
 GPIO_RSET(IODATA,0x0000);
 PLL_config(&myConfig);
 delay(1000);
}

//================================
//Function for enabling Trigger
//================================

void setupinterrupts(void)
{
    
  //initialize interrupt vector table vector
  IRQ_plug(IRQ_EVT_INT0,&INT0Isr);

  //Enable the interrupt
  IRQ_enable(IRQ_EVT_INT0);

  //Enable all interrupts
  IRQ_globalEnable();
}
//================
// Delay fuction
//================

void delay(Uint16 val)
{
 while(val--);
}

//MAIN

void main()
{ 
 
  CSL_init();                         // initializtion of Chip support Library functions

  IRQ_globalDisable();                //Disabling the interrupts globally

  CHIP_RSET(XBSR,0x0000);             //Making GPIO6=0 and GPIO7=0
   
  GPIO_init(); 

  IRQ_setVecs((Uint32)&vecs);
 // CHIP_RSET(IVPD,0x0001); //MAP_INTERRUPT_VECTORS_TO_INTERNAL_RAM
 // CHIP_RSET(IVPH,0x0001);

  setupinterrupts();
    
while(1)
{
  
   PGPIODAT0=0x0004;
   delay(1);
   PGPIODAT0=0x0000;
   delay(1);

  if(TriggerFlag==1)
  {
   TriggerFlag=0;
   PGPIODAT0=0x0001;
   delay(1);
   PGPIODAT0=0x0000;
   IRQ_enable(IRQ_EVT_INT0);

  //Enable all interrupts
   IRQ_globalEnable();
  }

}                          // Initialization of GPIO
}

//==============================
//External trigger interrupt
//INT0 ISR
//==============================
interrupt void INT0Isr(void)
{
    asm(" BSET EALLOW");
  //Setting the Trigger flag
   TriggerFlag=1;

   PGPIODAT0=0x0000;
    asm(" BCLR EALLOW"); 
  //clear the  external interrupt flag in IFR register
  IRQ_clear(IRQ_EVT_INT0);
  //Disable the interrupt
  //IRQ_disable(IRQ_EVT_INT0);

  //set EALLOW]
 // asm(" BSET EALLOW");

 //Enable all interrupts
   IRQ_globalEnable();

}
______________________________________
Scanned and protected by Email scanner



(You need to be a member of c55x -- send a blank email to c55x-subscribe@yahoogroups.com )

Re: reg:Bootloader - Jeff Brower - Jul 26 17:18:12 2007

Shanthi-

> i am using TMS320vc5502.My application is working properly in emulator mode.
> But in boot mode if am writing a program without interrupt its working
> properly but if i am loading an a program with interrupt its not working.
> I am using Serial EEPROM boot mode.U kindly tell me wts the problem and
> reply me.

After the program boots from Flash and just before this C code line in your program:

 if (TriggerFlag == 1) {

stop the code and check the IER bit and IRQ registers.  Are both GIE and NMI bits
set?  Are the correct IRQ bits set?  If not, then you have to debug why not.

You can use a breakpoint to stop the code.

-Jeff



(You need to be a member of c55x -- send a blank email to c55x-subscribe@yahoogroups.com )