• AVR Freaks

Helpful ReplyHot!HID Basic example doesn't work Harmony v2_06

Page: < 12 Showing page 2 of 2
Author
roydmiller
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2015/07/14 18:55:03
  • Location: 0
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/01/08 19:20:55 (permalink)
0
I have tried to use the bootloader basic example.
I am using a PIC32MZ EF Starter Kit w\Multimedia Expansion Board (MEB) II
It also doesn't work giving this error "PIC32 Bootloader Application V1.2 (not Responding)".
It uses the same HID interface so I wasn't really expecting it to but I was hoping.
 
I was thinking of opening up the topic to something like HID not working with Harmony V2_06 as someone else may have got the Bootloader working.
 
#21
roydmiller
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2015/07/14 18:55:03
  • Location: 0
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/01/09 23:10:10 (permalink)
0
OK I must admit defeat.
It has stumped me so I have gone back to using V2_04 until Microchip bring out a version that works.
Maybe V3 will have it fixed. It is too big a problem to work around as I can't even make a USB bootloader for any of the projects using V2_06. Fortunately it seems that everything new I have done works when recompiled using V2_04.
 
 
#22
JPortici
Super Member
  • Total Posts : 816
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/01/09 23:58:46 (permalink)
0
^ Who knows when FULL V3 will come out? I was told this summer in the other thread (should have been last october) so probably the summer MASTERS
For know, only partial ATSAM support.
I have been following this thread and i am convinced that the issues i am having with the PIC32MK and USB are the same, something was broke between these two versions.. and i will either have to go to STM32 (sigh) or create a project for 32MZ and copy over all the files (sigh) to expect to be able to use the dual USB
#23
Howard Long
Super Member
  • Total Posts : 721
  • Reward points : 0
  • Joined: 2005/04/04 08:50:32
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/01/10 04:20:14 (permalink)
0
roydmiller
OK I must admit defeat.
It has stumped me so I have gone back to using V2_04 until Microchip bring out a version that works.
Maybe V3 will have it fixed. It is too big a problem to work around as I can't even make a USB bootloader for any of the projects using V2_06. Fortunately it seems that everything new I have done works when recompiled using V2_04.

 
That was pretty much my conclusion, you have to know when to compromise, and it's hard to justify an unknown timescale.
 
#24
jcwhit54
New Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2012/11/15 16:22:39
  • Location: 0
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/02/24 15:09:28 (permalink)
0
Here is my configuration first.
PIC32MX470 Curiosity Board
Harmony 2.06
MPLAB 2.06
XC32 2.15
 
Background:  I have been using a HID interface with PIC18F for many years and have fine tuned PC interface and the PIC interface to achieve a robust control interface, including firmware upgrades and have tested on Ubuntu.  Because of the complexity of what I need to do next (MSD Storage, MP3 player, BLE, motor and multiple LED control), i decided to move to a PIC32.

I was able to get the HID Basic to work right away.  I then moved on to the HID_MSD app.  Issues with getting a SST26 device to work ( see https://www.microchip.com...=1086747&mpage=1), but solved that.  I had done a simple test to see if the device manager in Win10 recognized i, it did.  I also have a HidTest program I found a long time ago that verifies all the low level functionality, and it worked.   So i had moved off to other tasks.  When I cam back to use the PC program, it all failed.  Going back to the HID Basic worked as expected, but this HID_MSD would not work.
 
The symptoms were the PC program would hang on sending the first HID command.  The HID event handler would only fire once, with a set idle command on enumeration.  I had compared the HID_Basic and HID_MSD app.c files to see what the differences were.  Obviously my program is slightly different just because of what I am doing.  After putting in the dbug console and printf statements everywhere, I was really no closer.  Tracked through the USB event ISR looking for why this was not re-arming.

In the end it was this line of code.
            USB_DEVICE_HID_ReportReceive (USB_DEVICE_HID_INDEX_0, &appData.rxTransferHandle, appData.receiveDataBuffer, 64 );

In both apps, this is in quite a few places.  It just happened that the initialization path in my code did not cross this at the correct time.  For now it is in the HID event handler, SetIdle case.  Not sure that is where it will stay put at least the PC and the PIC32 are talking to each other now.  Just thought I would pass along what happened to me.
#25
roydmiller
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2015/07/14 18:55:03
  • Location: 0
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/02/24 20:44:20 (permalink)
0
That is interesting as I had the opposite problem.
I could get the the HID_MSD working fine with both MSD and HID functions working OK.
However when I just used the HID it didn't work.
I was pretty sure the problem was initialization of the HID configuration wasn't happening correctly.
I checked all the Library code and there was no differences excepting for the MSD extra code. I think that the MSD function was initialized before the HID so that "fixed the problem"
Can you show me the code where you initialize the HID function now?
 
Thanks
Roy
 
 
 
#26
nigelwright7557
Super Member
  • Total Posts : 308
  • Reward points : 0
  • Joined: 2006/11/06 08:15:51
  • Location: 0
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/02/25 08:05:12 (permalink)
0
roydmiller
Hi
 
I believe something changed after v2_04 because none of my other projects that use the HID interface work anymore either.
 




I recently did a PIC32MZ USB project that read data from a2d out onto USB bus.
The first problem I came across was that the USB buffers must be in uncached memory or they become corrupted.
This is because USB hardware DMA's the data and so must be uncached.
 
The second problem was after leaving the pc program when after about 5 seconds the USB bus froze.
Someone suggested bugs in 2.05 and 2.06 so I reverted to 2.04 and the problem went away.
#27
Paul PortSol
Super Member
  • Total Posts : 509
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/02/25 08:18:53 (permalink)
0
Are you using the example in the apps folder, 
or are you asking MHC to Generate Code with the options under "Apps" at the top of the MHC screen.
I've had better luck with the MHC generate code, as the pre-done examples in apps folder may have been done with different tools versions.
Paul
#28
jcwhit54
New Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2012/11/15 16:22:39
  • Location: 0
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/02/25 10:11:31 (permalink)
0
Attached is a zip file of the Hidtest src files (cant load the project because I am limited to 500K).  Since the hid-basic app did not fit my development board, I built this from scratch then went through and compared the two, to make them as close as possible.  Note the following
1. I modified the bsp, since for some reason it did not match my board.  I also added things I knew I was going to need.
2. the app never decoded any of my messages, i just wanted to verify it would not hang the pc program.
3.  I dont think I used the timer in the example
 
Observation
I did not use the MHC to generate app code.  i have used the examples for the code basis.  after looking at several examples now, I am beginning to wonder if this is a good idea.  For instance, The HID event handler seems to be different in every example.  While the code in each case may need to be different, I would think in these examples, they would at least list all the cases.  I have seen this in other instances, in the spiflash fat example, they have intentionally moved the port initialization earlier than where the code generator places it, with comment not to move.  So I agree with another comment that these examples may have been generated with previous tools and not necessarily the best for the latest version of Harmony. 
 
Right now I am only trying to verify that what I want to do can be done before I start to build the hardware. AT that point I will probably start over and only  use the generator. Also it should be noted that I only started with PIC32MX and Harmony in January.  So I only have about 6-7 weeks part time on this.  Therefore buyer beware.
 
 EDIT:  This maybe lost in the thread, but I am using a PIC32MX470 Curiosity board.  The issues most people are having seems to be PIC32MZ from what I can tell. 
 
 
post edited by jcwhit54 - 2019/03/04 08:24:39
#29
nigelwright7557
Super Member
  • Total Posts : 308
  • Reward points : 0
  • Joined: 2006/11/06 08:15:51
  • Location: 0
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/03/02 21:06:59 (permalink)
0
When  I moved to PIC32MZ I started having problems.
IF I started PIC and pc App it would run great forever.
If I left the app, after 5 seconds the USB bus would freeze and stay stuck even if I went back into pc app.
 
Went back to Harmony 2.04 and problem went away.
 
#30
viktor_shemyakin
Starting Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2017/04/14 05:17:50
  • Location: 0
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/03/06 04:54:20 (permalink) ☄ Helpfulby DominusT 2019/04/29 13:51:16
5 (2)
Had similar problems with HID on PIC32MZ:
when I connect device to PC, it is enumerated on PC  and in device is executed function
 APP_USBDeviceEventHandler with parameter event  = USB_DEVICE_EVENT_CONFIGURED.
 
When PC sends very first block of data, APP_USBDeviceEventHandler is executed with parameter
event  = USB_DEVICE_EVENT_DECONFIGURED and PC never receives Ack from device.

So from now on PC thinks that device is configured and device thinks that it is deconfigured.
 
Find simple workaround:

In function APP_USBDeviceEventHandler add few strings:
        after case USB_DEVICE_EVENT_CONFIGURED:
       
add     NeedReattach = true; 

and
        after case USB_DEVICE_EVENT_DECONFIGURED:
       
add     
            if (NeedReattach) {
                NeedReattach = false;
                USBCSR0bits.SOFTCONN = 0; 

                Delay_us(10);
                USBCSR0bits.SOFTCONN = 1; 

            }

In other words, if device became deconfigured after it was configured, I imitate reconnecting of USB cable, so that PC reenumerates device.      
Don't know why, but it works, problem disapeared.       
(Maybe someone can put any theory behind that grin: grin)
 
By the way:
1. I use Harmony 2.06
2 I have very similar project on PIC32MX and it works ok without any workarounds.
post edited by viktor_shemyakin - 2019/03/06 05:17:26
#31
roydmiller
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2015/07/14 18:55:03
  • Location: 0
  • Status: offline
Re: HID Basic example doesn't work Harmony v2_06 2019/03/06 23:52:15 (permalink)
0
That's great Viktor.
I tried this and it works fine.
I have no idea why, but I tried to fix this for a long time and never had any luck.
 
So thanks very much.
 
Roy
 
#32
Page: < 12 Showing page 2 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5