• AVR Freaks

Helpful ReplyHot!PIC32MZ USB HID: Status=CANCELLED?

Author
sskr
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2019/02/07 06:20:27
  • Location: 0
  • Status: offline
2019/03/27 09:53:05 (permalink)
0

PIC32MZ USB HID: Status=CANCELLED?

Hi!
 
I've used Harmony to create a USB HID device on a PIC32MZ with hid_basic_demo as a template. I have modified it so that when I do an interrupt transfer from the PC to the device, the device sends data back to the PC.
 
It works nicely, but there is a catch: if I don't send anything to the device, in about 6s, two packages arrive from the device with no content, carrying a status code 0xC0010000. The program I use to send the HID data to the device freezes if I try to send it after the error appears.
 
USBD_STATUS_CANCELED (0xC0010000): The USB stack reports this error whenever it completed a transfer because of an AbortPipe request from the client driver.
 
Is this normal? What does this error mean and how to recover from it?
 
 
post edited by sskr - 2019/03/27 09:54:58
#1
nigelwright7557
Super Member
  • Total Posts : 213
  • Reward points : 0
  • Joined: 2006/11/06 08:15:51
  • Location: 0
  • Status: offline
Re: PIC32MZ USB HID: Status=CANCELLED? 2019/03/27 12:00:57 (permalink) ☄ Helpfulby sskr 2019/03/28 02:18:03
0
I don't know if its related but I found an HID problem.
It runs fine unless I exit the communicating pc program.
About 6 seconds after it exits the USB locks up. I think it goes into suspend.
If I then go back into the pc program it cant communicate with the PIC. 
Some kind gentlemen on here suggested going back from Harmony 2.06 to Harmony 2.04 and that fixed the problem.
#2
roydmiller
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2015/07/14 18:55:03
  • Location: 0
  • Status: offline
Re: PIC32MZ USB HID: Status=CANCELLED? 2019/03/27 15:26:23 (permalink)
0
That is correct HID does not work in Harmony 2.06
I have abandoned 2.06 and just use 2.04 now
A lot of time and effort has gone into trying to fix that problem see the link below
 
https://www.microchip.com/forums/m1075689.aspx?tree=true
 
Roy
 
#3
JPortici
Super Member
  • Total Posts : 674
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: offline
Re: PIC32MZ USB HID: Status=CANCELLED? 2019/03/27 23:53:33 (permalink)
0
nigelwright7557
I don't know if its related but I found an HID problem.
It runs fine unless I exit the communicating pc program.
About 6 seconds after it exits the USB locks up. I think it goes into suspend.
If I then go back into the pc program it cant communicate with the PIC. 
Some kind gentlemen on here suggested going back from Harmony 2.06 to Harmony 2.04 and that fixed the problem.




Harmony 3 doesn't have this issue either (at least it hasn't appeared -yet-)
but be carefult that the support for PIC32MZ is still in its early stages, if you rely on many of the harmony modules you may _not_ be able to migrate
#4
sskr
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2019/02/07 06:20:27
  • Location: 0
  • Status: offline
Re: PIC32MZ USB HID: Status=CANCELLED? 2019/03/28 02:18:54 (permalink)
0
Thank you all for responding. I guess I'll try the same with Harmony 2.04. Any idea where to download older versions?
 
Edit: nwm, there is an archive on the download page.
 
post edited by sskr - 2019/03/28 02:21:22
#5
JPortici
Super Member
  • Total Posts : 674
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: offline
Re: PIC32MZ USB HID: Status=CANCELLED? 2019/03/28 02:20:07 (permalink) ☄ Helpfulby sskr 2019/03/28 02:21:41
0
From the harmony webpage, next to the download tab there is the archives tab.
#6
sskr
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2019/02/07 06:20:27
  • Location: 0
  • Status: offline
Re: PIC32MZ USB HID: Status=CANCELLED? 2019/03/28 04:31:51 (permalink)
0
Hi!
 
I've installed Harmony 2.04 as suggested and generated a fresh project with only USB HID library. I have copied the content of app.c and app.h from hid_basic device project and made sure the Harmony settings are the same as well. I have only slightly modified the app.c (commented all the LED toggling since I use a custom board), the rest is the same.
 
The results are the same as with 2.06. Everything works fine, unless the device is kept without instructions for more that 6 s. After that, the control transfers still seem to work but the bulk or interrupt transfers become locked:
https://imgur.com/K2KCRDB
 
Trying to write to the HID device afterwards returns the same error and writing the second time freezes the PC app.
 
Any other ideas?
 
 
#7
Paul PortSol
Super Member
  • Total Posts : 439
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: PIC32MZ USB HID: Status=CANCELLED? 2019/03/28 04:35:04 (permalink)
0
I fixed a harmony bug with a newer version by using beyond compare to compare the same project in each version, and found the flawed generated code and how to patch it.
Maybe if you compare your USB in HarmonyV204 versus HarmonyV206 you can catch the bug and submit a ticket.
Paul
#8
Jump to:
© 2019 APG vNext Commercial Version 4.5