- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you referring to the following image:
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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