51JM128 problems running USB with other tasks

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

51JM128 problems running USB with other tasks

601 Views
ARQuattr
Contributor IV

I have a custom board based on the 51JM128, running MQX, including the MSD USB class and MFS filesystem.  On its own the USB task (based on the JMEVB examples) works fine, but adding other tasks seems to cause problems.  Similarly, the other tasks on their own (without the USB task running) work OK, so I don't think there are problems with the task stack sizes for the USB or other tasks, but once the USB task runs concurrently with another task the USB gives errors, or doesn't respond to the attach event, etc. 

 

In particular, I have a task which starts a timer event and monitors the GPIO, using short delays (_time_delay), and another task that monitors a UART port.  If either of these are started while the USB is going, usually both tasks fail or stop somewhere.

 

The USB task was given a higher priority than the other tasks (and I also tried giving it a lower priority), with similar results.

 

Is this just a RAM limitation problem, or are there some other factors I'm not taking into consideration regarding resource conflicts, etc.?  Is there any problem running timer events and delays in other tasks while running a USB task?  Should I change the type of scheduling?

 

Thank you for any input.

 

Labels (1)
Tags (1)
0 Kudos
1 Reply

323 Views
dominochmiel
Contributor II

I belive that you have problems with lack of memory. MCF51JM has only 16kb of RAM and MQX with MFS and USB takes almost all of it to works properly. Try using _mem_get_highwater to get the highest address of RAM memory used by MQX to determine is it your problem. Otherwise you could debug your application and look for errors caused by memory allocation problems.

It was solution in my project where I was using very similar configuration (MCF51JM128 + MQX3.6 + CDC USB + MFS over SPI). I resolved it by switching to MCF51MM which has 32kb of RAM and lot of nice peripherals.