USB on Dual Core Device

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
PaSw_2578827
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

On a PSoC6 CY8C6247BZI-D34 we're having some trouble getting the M0+ to access the USB as a slave device. The available USB examples only use the M4 core, when we try to move that code over to the M0+ it compiles fine but doesn't seem to run. Debugging it lands us in some odd disassembly location with a corrupt (or otherwise unreadable) call stack. Any ideas?

0 Likes
1 Solution

So the problem is related to the way you initialized the interrupts. In CM0+, there is an extra variable in the structure.

Since you are using PSoC Creator, you can refer to config structure create in Generated_Source>PSoC6>cy_fitter_sysint_cfg.c.

Use these config structures with Cy_SysInt_Init().

View solution in original post

0 Likes
6 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Hello,

Please check the  PSoC 6 Dual-Core MCU Architecture given at this link:

https://www.cypress.com/products/32-bit-arm-cortex-m4-psoc-6

USB comes under Cortex-M4 (Main) core resources.

Thanks,

Ankita

Are you referring to the following image:

Diagram-PSoC-6-Dual-Core-MCU-Architecture_920_V4.png

The block diagram on Figure 2 of the datasheet shows differently which is why I was confused. This image also implies that the M4 cannot access any of the UDB, is that true?

0 Likes

You can run the USBFS in CM0+.

The problem is probably related to the way you init the interrupts.

Are you using PSoC Creator? If yes, make sure you select the CM0+ in the Interrupt tabs under the Design Resources file.

If you have correctly setup, can you share the project?

0 Likes
lock attach
Attachments are accessible only for community members.

Yes I'm using PSoC Creator, my initial post was partially incorrect as I was basing it on another engineers testing. I've loaded the code myself and it does seem to run but we're getting an error in the Device Manager when we connect the device to our Window machine: "Device Descriptor Request Failed". I'm using example CE223368 and it runs fine on the M4 (just running the project unchanged) but when I try to get it to run on the M0 I get the above error and no COM Port. The only changes I made were:
1) Moving the "main_cm4.c" code over to the"main_cm0p.c"
2) Enabling the USB interrupts on the M0+ (via Design Wide Resources > Interrupts)
3) Changing the interrupt priority to match the 3 levels available on the M0+ (vs the 7 available on the M4)

If I debug the code it looks like we're just not getting any interrupts on the M0+ and it sits waiting in the following line of code: Cy_USB_Dev_Connect(true, CY_USB_DEV_WAIT_FOREVER, &USBUART_devContext);

The project is attached

0 Likes

So the problem is related to the way you initialized the interrupts. In CM0+, there is an extra variable in the structure.

Since you are using PSoC Creator, you can refer to config structure create in Generated_Source>PSoC6>cy_fitter_sysint_cfg.c.

Use these config structures with Cy_SysInt_Init().

0 Likes

Great that seems to have resolved it, I'm having a separate driver issue now, but at least it's showing up as a recognised USB device! Thanks

0 Likes