I am using the FSL_USB_STACK Processor expert component with MQXLite.
I had to tweak little bit with vector configuration.
With this now USB Enumeration works, and I am able to see the “virtual com port” on PC.
But now this screwed up with MQXlite itself, none of the tasks are running.
It is in loop all time in function “_pend_svc” at below location.
ASM_LABEL(find_noempty_que)
ldr r2, [r1, #0] /* address of first td */
cmp r2, r1 /* ready_q structure itself? */
bne switch_task
ldr r1, [r1, #RQ_NEXT_Q] /* try next queue */
movs r1, r1
bne find_noempty_que
/* r1 is 0 -> empty */
ASM_LABEL(no_one_to_run)
/* TODO set system task ??? */
/* enable all interrupts (r1 = 0) */
/* TODO maybe (maybe not necessary) restore PendSV priority and BASEPRI after wfi */
msr BASEPRI, r1
ldr r1, =0xE000ED20 /* SHPR3 */
ldr r2, =0xff
strb r2, [r1, #2]
/* wait for interrupt */
cpsie.n i
wfi
cpsid.n i
Hello,
I am sorry but it is not possible to analyze the issue according this short general description. Could you provide more details (vector configuration changes - modification of the source code) and the application for analysis, please?
The MQXLite use also interrupts and manual modification of the vector table may impact the MQXLite functionality.
Best Regards,
Marek Neuzil
Hi Marek,
This is my story
I am using MQX lite --> MQX_LITE_VERSION "V1.1.0" and USB stack component "FSL_USB_STACK" from Processor expert.
I modified the vector configuration table overwritten by USB stack init component to work with MQXLite Rtos.
I used function "_int_install_isr(LDD_ivIndex_INT_USB0, USB_ISR, NULL)" to setup USB interrupt.
If I enable the USB interrupt right after the initialization and before RTOS start, none of the task will run and RTOS remains looping in function "_pend_svc". with this condition when I plug in USB, enumeration happens fine and I am able to see Virtual Com port on PC.
So I moved the interrupt enable to one of the task, where I process USB communication. now All tasks run fine.
But when I plug in USB cable, I get Hard fault. I have attached pdf showing flag "INVSTATE" set in CFSR Register.
I also tried increasing stack size from 0x400 to 0x2000, still no success
Hello,
I am sorry but it is not clear yet. What product and version are you using (e.g. KDS 3.0.0, CodeWarrior 10.6.4,...) and what components are used in the project (it seems that you are using a USB component from Mcu On Eclipse website)?
Could you also provide the project for analysis, please?
Best Regards,
Marek Neuzil