Bootloader and app using same Vector, App don't work properly

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

Bootloader and app using same Vector, App don't work properly

Jump to solution
560 Views
scary2021
Contributor II

I'm Using K60 with CW10.2 and MQX 3.8, based in example bootloader AN4368SW rev2.

After some tests I've discovered that all interrupts are working except USB(59h vector) used by the Bootloader. What can I do?

 

vectors.c from bootloader:

(tIsrFunc)USB_ISR, /*  0x59 0x00000164 - ivINT_USB0         This dont go */

(tIsrFunc)Cpu_Interrupt, /*  0x43 0x0000010C - ivINT_UART3_RX_TX        This perfect */


I have discovered that if I coment this lines in bsp_platform_init(void) in bootloader code, the app runs with usb interruption OK, but the bootloader don't.

    SIM_SOPT2 |= SIM_SOPT2_USBSRC_MASK | SIM_SOPT2_PLLFLLSEL_MASK;

    SIM_CLKDIV2=0x02;                               // USB Freq Divider  

  

    // weak pulldowns

    USB0_USBCTRL=0x40;

Someone can explain me why if this lines are executed the usb driver not initialize in the app, using MQX.

0 Kudos
1 Solution
451 Views
scary2021
Contributor II

Solved , you have to boot your app before bsp_platform_init(void) in bootloader code is a problem with dual initialization of PLL.

View solution in original post

0 Kudos
1 Reply
452 Views
scary2021
Contributor II

Solved , you have to boot your app before bsp_platform_init(void) in bootloader code is a problem with dual initialization of PLL.

0 Kudos