Skip to main content
Topic: Fixed overflow bug in Sample mode in Firmware 2.4 (Read 5653 times) previous topic - next topic

Fixed overflow bug in Sample mode in Firmware 2.4

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.


[attachment=0]

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Reply #1
Thanks for sharing :)

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Reply #2
What exactly is the bug you claim to have fixed?

Sources?

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Reply #3
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: [attachment=0]

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Reply #4
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 :)

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Reply #5
It has been working well for me for the past weeks.

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Reply #6
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?

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Reply #7
You have to reprogram the Irtoy firmware as described in the irtoy pages.

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Reply #8
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:TEMPbin>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 . . .

Re: Fixed overflow bug in Sample mode in Firmware 2.4

Reply #9
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.