Fixed overflow bug in Sample mode in Firmware 2.4

USB infrared remote control receiver/transmitter. Get one for $20, including worldwide shipping.

Fixed overflow bug in Sample mode in Firmware 2.4

Postby Floppy » Sat Oct 03, 2015 2:34 pm

In my setup it was running into overflow mode every other minute or two.
I took the version 2.2 firmware sources as a base and fixed the sampling mode by changing the interrupt routine.
It now runs flawlessly in sampling mode - didn't change anything else but also didn't test the other modes.
Using usbirtoy hardware verion 2, running on a RaspberyyPi model 2 B with Lirc 0.9.0 with the patches applied of Peter Kooiman to support Usb_Irtoy.
I called the firmware version V2.4 as somebody else already posted V2.3. I did use V2.2 as a base.
Obviously, this is a beta release at your own risk! It works for me though.


USBIRToyv24.zip
(12.23 KiB) Downloaded 333 times
Floppy
Newbie
Newbie
 
Posts: 9
Joined: Sat Oct 03, 2015 2:25 pm

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Postby IRTech » Sun Oct 04, 2015 1:51 am

Thanks for sharing :)
IRTech
Newbie
Newbie
 
Posts: 11
Joined: Thu Jul 11, 2013 7:10 am

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Postby Barf » Sun Oct 04, 2015 2:38 am

What exactly is the bug you claim to have fixed?

Sources?
Barf
Jr. Member
Jr. Member
 
Posts: 64
Joined: Mon Jul 07, 2014 3:12 pm

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Postby Floppy » Sun Oct 04, 2015 4:59 am

The bug in my setup was that very often in sampling mode (using usb_irtoy driver in lirc) the device returned a 0xffff message which is a long space. It appeared that this was in many cases caused by the device sending three times 0xfff (see manual) which indicates an overflow: the device is producing more data than it can feedback to the host.
LIrc trips over this because it thinks the 0xffff are long spaces .
After examining the mechanism between interrupt handler and main loop, I fond out there is a critical timing problem in the software. By fixing this, there is more time to transport the data to the host.
I am using a Raspberry pi model 2 which is pretty fast but I still had this overflow problem. The problem might not be occurring on other setups.
I also fixed the usb_irtoy driver to cope with this overflow more gracefully.

See sources attached:
USB_Irtoyv24.zip
(207.82 KiB) Downloaded 312 times
Floppy
Newbie
Newbie
 
Posts: 9
Joined: Sat Oct 03, 2015 2:25 pm

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Postby iMave » Sat Oct 17, 2015 4:24 pm

Hi,

I started to test your version yesterday. Af first glance it looks good. I always had the problem that the IRToy was suddenly not reacting. In most cases this happened after resume.

From time to time even replugging the IRToy doesn't help because the orange LED on the IRToy stays permanently on. In this case only reflashing helps to get it running again.

I will continue testing and post my results.

Thank you for sharing your changes :)
iMave
Newbie
Newbie
 
Posts: 1
Joined: Sat Oct 17, 2015 4:13 pm

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Postby Joker » Tue Nov 17, 2015 10:36 am

It has been working well for me for the past weeks.
Joker
Newbie
Newbie
 
Posts: 7
Joined: Wed Apr 02, 2014 9:24 pm

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Postby clueo8 » Thu Jan 07, 2016 2:05 pm

I gave up on the IRToy and RPi while ago, but it sounds like this may finally be a fix... I noticed you posted two files, do we only need to upgrade the firmware in the first file you posted? (USBIRToyv24.hex)

Do we need to use the other one you posted? If so, what do we do with it?
clueo8
Newbie
Newbie
 
Posts: 4
Joined: Fri Jun 05, 2015 7:05 am

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Postby Floppy » Tue Feb 16, 2016 5:39 pm

You have to reprogram the Irtoy firmware as described in the irtoy pages.
Floppy
Newbie
Newbie
 
Posts: 9
Joined: Sat Oct 03, 2015 2:25 pm

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Postby MisterE » Thu Dec 15, 2016 3:42 pm

Hi,
I seem to have a similar problem with my raspberry pi.
Want to try to test this new firmware.

I once managed to update the firmware but it failes now. Can use some help.

Steps i did:
* downloaded "USBIRToy.package.v22.zip" and unpacked it
* downloaded this alternative firmware "USBIRToyv24.hex" en copied it to the "firmware" folder
* created "bat" file "update-USBIRToy.v24.bat", modified it to use "USBIRToyv24.hex"

* wired PGC and PGD
* plugged it in, orange light is burning
* In the device manager, under "human interface devices" i get a "usb input device" with a exclamation mark (This device cannot start. (Code 10))

* start "cmd" with admin rights
* Enter Com Port => pressing enter

Results below:

C:\TEMP\bin>update-USBIRToy.v24.bat
Enter Com Port Number
Could not open com port.
Once the device has entered boot loader mode
Press any key to continue . . .
U2IO flash erasing: FAILED.
Device is not found.
Operation aborted.
Press any key to continue . . .
MisterE
Newbie
Newbie
 
Posts: 8
Joined: Fri Aug 05, 2016 4:05 pm

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Postby Barf » Fri Dec 16, 2016 2:58 am

Slightly off-topic...

I am all but an expert on flashing on windows, but it appears to me as if the update-USBIRToy.*.bat files expect the toy to be in normal mode (!= boot loader mode). Execute fw_update directly, or comment out the BootLoader.exe line, and it may work.
Barf
Jr. Member
Jr. Member
 
Posts: 64
Joined: Mon Jul 07, 2014 3:12 pm


Return to USB Infrared Toy