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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
557 次查看
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 项奖励
1 解答
448 次查看
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 项奖励
1 回复
449 次查看
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 项奖励