This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

2806x creating bootloader Interrupt issue

Other Parts Discussed in Thread: MOTORWARE

Hi,

I'm developing a custom bootloader for the 28069 DSP. I would like a minimal code size for the booloader. The bootloader must contain a UART but no PWM or ADC functionality. To use the UART I enable the global interrupts but than nothing happens.. The UART only works when I also enable the PWM interrupts...

Is this something from instaSPIN or what do I miss?

Best regards,

  • what .c code/project have you added your UART code to?

    The ADC conversion done ISR is what drives the control system.

  • Thanks for your quick answer!

    I started a clean project.

    What do you mean by "drives the control system"? Does this mean that when I want to use interrupts always the ADC interrupt must be used to.

    I would like to have interrupts for the UART communication and true UART the DSP can be flashed. During this flashing it would be better if I'm not have to worry about ADC or PWM interrupts.

  • My comment is in regards to if you are using the InstaSPIN-FOC proj_lab##.c as a starting point.  By default they all have a mainISR loop that is driven by the ADC conversion done interrupt. 

    You want to insure you put your UART application in the main loop, and take care of your interrupts.

    Are you using the standard from MotorWare projects?

      // initialize the interrupt vector table
      DRV_initIntVectorTable(drvHandle);


      // enable the ADC interrupts
      DRV_enableAdcInts(drvHandle);


      // enable global interrupts
      DRV_enableGlobalInts(drvHandle);


      // enable debug interrupts
      DRV_enableDebugInt(drvHandle);


      // disable the PWM
      DRV_disablePwm(drvHandle);

  • Hi,

    Yes I'm using the standard from the MotorWare projects. But I thought maybe I can strip down the bootloader code to the bare minimum by not calling all the code.

    What I cal now: The driver init function so all the handles are filled.

      // initialize the driver
      drvHandle = DRV_init(&drv,sizeof(drv));

    And than some code of the DRV_setParams function:

    // disable global interrupts
      CPU_disableGlobalInts(obj->cpuHandle);
    
    
      // disable cpu interrupts
      CPU_disableInts(obj->cpuHandle);
    
    
      // clear cpu interrupt flags
      CPU_clearIntFlags(obj->cpuHandle);
    
    
      // setup the clocks
      DRV_setupClks(handle);
    
    
      // Setup the PLL
      DRV_setupPll(handle,PLL_ClkFreq_90_MHz);
    
    
      // setup the PIE
      DRV_setupPie(handle);
    
    
      // setup the peripheral clocks
      DRV_setupPeripheralClks(handle); //Only Sci
    
    
      // setup the GPIOs
      DRV_setupGpios(handle); //Only sci
    
      //Setup sci
      DRV_setupSci(handle);

    The result is that every flag and enable line is set to the correct state accroding the added image. But my "tx" interrupt is only working when I force the IFR9 flag by hand while debugging.

    I don't see any other interupts appear so i guess the ADC is not working because the peripheral clock is also of. So group_9_int is generated only not parsed to INT9

    Thanks,

  • Wouter,

    With this limited code snippet its hard to tell whats wrong.  My advice would be to start at the peripheral and look at the registers to make sure everything is configured correctly.  Specifically you'll want to look at the TX interrupt enable bits.  From there you'll want to make sure the interrupt is asserted in the peripheral before following the interrupt line to the PIE.  Just take this step by step to find your problem.

    BR,

  • Hi,

    I found the issue. The PIE interrupt flags where not handled correctly. It has to do with the implementation of the functions:

    PIE_clearInt and PIE_clearAllInts. This functions don't do  what the function-name tells ;)

  • Thanks Wouter!  I'll file a bug and make sure this gets fixed.  Sorry for the trouble.