Stuck on Enable USB Interrupts

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

Stuck on Enable USB Interrupts

1,085 Views
gianluca_panett
Contributor I

Hello,

I have the IMXRT1050 eval board with MIMXRT1052DVL6B and I wanted to set up a new project using the USB connector to create a virtual COM port, just like in the SDK example project.

So I created a new (empty) project with USB middleware included, set my clock to 588 MHz by disabling ARM_PLL bypass (PLL1_BYPASS -> ARM_PLL) and then in the Peripherals Tool in the Middleware section I added one USB entry with

Mode: Device,

Peripheral: USB1,

Preset: CDC VCOM.

After that, I had to enable the clock for USB1 and then I could generate the code.

When I start debugging my code (nothing else added here, except the generated code), the initialization fails during USB_DeviceEhiSetDefaultState() in the line

    /* Enable USB Interrupt, USB Error Interrupt, Port Change detect Interrupt, USB-Reset Interrupt*/
    ehciState->registerBase->USBINTR =
        (USBHS_USBINTR_UE_MASK | USBHS_USBINTR_UEE_MASK | USBHS_USBINTR_PCE_MASK | USBHS_USBINTR_URE_MASK

When reaching this line by debugging step-by-step, the debugger hangs up in this line, can not proceed after clicking on pause or stop, I get a window with the error message "Interrupt failed."

Normally I assume that automatically generated code should run out of the box, but here it seem like it does.

So what could be the reason that it doesn't work?

Remark: I didn't select the eval board in the wizard, I just selected the microcontroller I use, because later this project should also run on a custom board. So for example I don't use the boards additional RAM and Flash.

Labels (1)
0 Kudos
3 Replies

958 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Gianluca,

Please check the interrupt vector point to right address. The USB component only include basic file. You must add class relate file and application by yourself. I think generated code can't run out of the box. There is still many work to do. If the problem is still there, you can send me your project.

Regards,

Jing

958 Views
gianluca_panett
Contributor I

Hello Jing,

thanks for your help.

I added the clock for USB and now my program starts running. I also see an additional COM port in my windows device manager.

Where do I check the interrupt vectors?

This is a general problem which I have now also with other peripherals: I can generate example projects which run quite fine out of the box but I can not close the gap to the code which is generated when I create an empty project adding my peripherals. I see no configurations made in the Config Tools in the example projects where I can derive the settings to my own project from, there's just a bunch of code, which doesn't match to the generated code.

Where can I find documentation about peripherals, which says what to do DIRECTLY AFTER including them in the Config Tools?

Many thanks

Gianluca

0 Kudos

958 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

The interrupt vector table is point by SCB->VTOR register. When check if the pointer is correct, you should read this register and then read the memory content there.

You can read MCUXpresso_IDE_ConfigTools_User_Manual.pdf. It is in MCUXpresso install directory. When you finish configuring a peripheral, IDE will put the initialize code in peripherals.c, update pin_mux.c and clock_config.c. You should call the initialize code by yourself.

Regards,

Jing

0 Kudos