• AVR Freaks

Enabling USB stack interferes with Ethernet and USART

Author
Juan Sapriza
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/10/04 07:52:22
  • Location: 0
  • Status: offline
2019/10/07 07:10:34 (permalink)
0

Enabling USB stack interferes with Ethernet and USART

Hello everyone,
 
I am working on a custom board with a PIC32MZ2048EFM144, using MPLAB X v5.10, xc32 v1.44 and Harmony v2.6.
 
In our project we have already set up correctly the Ethernet driver, and USART driver with multiple instances for communication with a GPRS modem and thermal printer. Everything has been working properly for a long time now. 
The project has a USB connection we use for programming purposes through a bootloader application, and also works perfectly. 
 
The problems start when I set up the USB driver configuration in Harmony to use our application as a USB CDC device. After doing so, the printer stops responding, and GPRS and Ethernet communications start failing in various ways. Moreover, USB functionalities work fine only when receiving data, while sending data it only works for an apparently random amount of time/data; although I suspect this issue has a different origin, for which I will keep on doing some tests.   
 
My investigation has been around interruptions and timers overlaping, yet I have not found anything.
 
I cannot think of anything else that could be causing this kind of problems, so any ideas or suggestions are more than welcome, even if it refers to interrumptions and timers, as I am not an expert in the subject and might be ignoring something. 
 
Thank you in advance for taking the time to read through this, and for any help you might be able to provide. 
 
I upload herewith a capture of the harmony configuration panel, in case you find it handy.   
 
 

Attached Image(s)

#1
Paul PortSol
Super Member
  • Total Posts : 493
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: Enabling USB stack interferes with Ethernet and USART 2019/10/08 04:37:36 (permalink)
0
Heap size? 
#2
Juan Sapriza
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/10/04 07:52:22
  • Location: 0
  • Status: offline
Re: Enabling USB stack interferes with Ethernet and USART 2019/10/08 08:02:58 (permalink)
0
Hello Paul! Thank you for your prompt reply!
 
I have tried with both, 512 and 44960 (the size I get after generating the USB code from harmony), but got similar results. 
 
 
#3
BillP
Super Member
  • Total Posts : 334
  • Reward points : 0
  • Joined: 2014/09/28 07:53:35
  • Location: CA
  • Status: offline
Re: Enabling USB stack interferes with Ethernet and USART 2019/10/08 08:58:32 (permalink)
0
Try adding the following changes to system_config.h
 
#define SYS_PORT_H_ANSEL   0x0040
#define SYS_PORT_J_ANSEL   0x0000
 
I had the same problem and it took me days/weeks to find this solution.  Hopefully it works for you.
#4
Jump to:
© 2019 APG vNext Commercial Version 4.5