Example_VirtualSerial running on M0 4350

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

Example_VirtualSerial running on M0 4350

590 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marshall on Thu Sep 13 14:18:56 MST 2012
Board Hitex 4350

I am trying to port the Example_VirtualSerial from M4 Ram to M0 flash, I have the code compiled and running to a point. The sequence of the problem is when USB_Device_ProcessControlRequest is called by the PC for REQ_GetDescriptor, REQ_SetAddress, REQ_GetDescriptor the last call returns and Endpoint_IsSETUPReceived() is still set (or set again) causing the PC to retry the sequence over and over.

So the question is, is there any setup differences for Example_VirtualSerial for running in flash on M0 vs M4 and ram? I commented out bsp_init, and pasted in the scu_pinmux commands that were inside of it (they seemed to make no difference).

Another clue is that the PC which does get a Descriptor complains that the device is in Low Power Mode. (using usbview.exe).
Labels (1)
0 Kudos
5 Replies

574 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marshall on Fri Jun 14 12:04:11 MST 2013

Turns out the problem was the Ulink Pro, if I run the example on M0 without using the Ulink Pro to debug it then it works fine, it locks if the debugger is enabled.

0 Kudos

574 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nxp21346 on Wed Nov 28 14:22:38 MST 2012
non-building examples

Hi marshall,

Can you post a link to the dual core examples that you are having trouble with so we can fix them?

Thanks!
-Dave at NXP
0 Kudos

574 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marshall on Fri Oct 19 12:49:44 MST 2012
More info, I am not sure it is hanging so much as repeatedly running the reset routine, and when I stop the M0 that is where it is sitting.

What I really need is some example code that will run on the Hitex 4350 A1 board with USB code in the M0, just getting it to enumerate would be enough.

Does anyone have such an example?

The Dual core examples recently put out do not compile, and aren't for the hitex, so they are no help. (Missing files).
0 Kudos

574 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marshall on Thu Oct 18 15:34:53 MST 2012
Sorry it took me so long to get back, I was going ahead with just making the software work on M4 and ram, now I am trying to get the M0 to run usb code in ram. We setup the M0 based on one of the dual core examples ( I am not the one who set it up). The M0 runs code fine up until doing the USB setup it hangs, if you break then single step then you can move past the hang. I have checked that the scatter file copies the code correctly, and there is no M4 conflict, and even copied it again with a setupcopy routine.

The board is a Hitex 4350

It is hanging in this code:
  USB_REG(USBPortNum)->ENDPTFLUSH = 0xFFFFFFFF;
  while (USB_REG(USBPortNum)->ENDPTFLUSH); /* Wait until all bits are 0 */

Is there some magic setup that needs to be done so that the M0 can access the USB ports reliably? I do get the interrupts for USB0 sometimes.
Next is there some CPU speed past which you can't run USB code on M0. We have it setup for 204MHz CGU_SetPLL1(17)

I am not the one who initially set up the board, I am just trying to make it work, so there is still the learning curve thing.
Most boards that I have worked with just worked, no strange behavior accessing I/O ports, so I am at a loss.

0 Kudos

574 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Mon Sep 17 06:40:02 MST 2012
Hello,

it seems that the porting from an M4 core project to an M0 core project is OK so far, otherwise the software wouldn't run to this point, right?
However, the M0 has the same execution rights as the M4, so if you ported all things correctly then it should work.

What did you take as a basis fore the dual core setup? One of the dual core examples from lpcware.com or did you port the M4/M0 setup into the Example_VirtualSerial project?

Best regards.
0 Kudos