Building the firmware

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

Building the firmware

Postby mxp » Tue Nov 27, 2012 2:39 pm

Hi,

I'm trying to build the USB IR Toy firmware from source and I'm having some problems. I hope, someone can help me.

I installed MPLAB X 1.51 and MPLAB C18 3.40 lite on Windows and OSX and loaded the project in Firmware-main from the v22 download and also from svn r2064. When I try to compile, I get errors about some missing files, like IRIO.c, IrReflect.c and hal_Lin_m.c. There are files with these names in another folder (Firmware-old-MicrochipUSB), but copying them into the Firmware-main directory produces all kinds of compilation errors, so they don't seem to be compatible.

I tried removing the missing files from the project, as suggested in this thread: http://dangerousprototypes.com/forum/viewtopic.php?f=29&t=3227. This gets me a hex file, but it's only half the size of the official firmware files, and when I flash it, the toy doesn't work (and I have to put it into bootloader mode manually by connecting the two pins).

Do I need to find the missing files somewhere or am I doing something wrong? Do you need additional information to help me? I'll be happy to provide anything I can.

Thanks in advance,
mxp
mxp
Newbie
Newbie
 
Posts: 6
Joined: Tue Nov 27, 2012 2:19 pm

Re: Building the firmware

Postby RadiatorTwo » Sat Dec 01, 2012 7:53 am

I also wanted to try to compile the firmware myself.
Here is what I´ve got so far:

I´ve checked out the code from the SVN repo.
The log in SVN says that it´s now using the Open Source JTR USB Stack.

The files are here in the svn Repo.
http://dangerous-prototypes-open-hardwa ... ack/dp_usb

I copied the in the project missing files into the root folder and started the compiler.
The compiler got through without any errors. But the created hexfile only has 37 kb and apparently doesn´t work.

Now I´m looking further to find out what the problem is.
RadiatorTwo
Newbie
Newbie
 
Posts: 18
Joined: Sat Nov 24, 2012 7:39 am

Re: Building the firmware

Postby mxp » Sat Dec 01, 2012 9:50 pm

Hi,

it's relieving to see that I'm not alone with this. I tried to analyse the code to make sense of what might be going wrong, but so far, I haven't been successful. I'm new to this sort of embedded programming. Please let me know if you find anything out.

Do we know who built the release versions of the firmware? Maybe he can tell us what he did differently.

mxp
mxp
Newbie
Newbie
 
Posts: 6
Joined: Tue Nov 27, 2012 2:19 pm

Re: Building the firmware

Postby mxp » Sun Dec 02, 2012 5:29 pm

I got it to work! I'm not sure what I did differently before and why it didn't work then, but here's what I did now:

My setup:
Windows XP SP3 (running in Parallels)
MPLAB X 1.51
MPLAB C18 3.40 lite
USBIRToy.source.r1611.v22

Step 1: Open "Firmware-main\USBIRToy.X" in MPLAB
Step 2: Right-click "hal_Lin_m.c" (in "Source Files"), select "Properties", select "Exclude from build", click "OK"
Step 3: Do the same with IRIO.c
Step 4: Do the same with IrReflect.c
Step 5: Click the "Build Project" button, a valid HEX file should be generated (41KB)
Step 6: Copy the following files from "package\firmware" to "Firmware-main\USBIRToy.X\dist\default\production":
  • BootLoader.exe
  • bootloader.hex
  • fw_update.exe
  • update-USBIRToy.v22.bat
Step 7 (optional): Rename "update-USBIRToy.v22.bat" to "update-USBIRToy.production.bat"
Step 8: Edit the .bat file: Change "USBIRToy.v22.hex" to "USBIRToy.X.production.hex" at the end of the file
Step 9: Connect the IRToy
Step 10: Run the batch file

I hope this helps.

mxp
mxp
Newbie
Newbie
 
Posts: 6
Joined: Tue Nov 27, 2012 2:19 pm

Re: Building the firmware

Postby RadiatorTwo » Mon Dec 03, 2012 3:13 pm

Thanks alot for this little advice.
Also made it like this.
The only difference is using the USBIRToy.source.r1611.v22.zip for downloading the source code.

Seems there is a problem in the SVN Repository?
Because when I compile the SVN code the file only has 37 Kb and isn´t working.

SO I´ve compared the code and found out the SVN Code doesn´t include the USB Stack but tries to include it by itself?
In general the code seems to be very different.
Maybe it´s a work in Progress? But then why is it in the trunk folder of SVN?

Nevertheless got it finally working thanks alot.
RadiatorTwo
Newbie
Newbie
 
Posts: 18
Joined: Sat Nov 24, 2012 7:39 am

Re: Building the firmware

Postby mxp » Mon Dec 03, 2012 4:59 pm

Great to hear it works for you. I'm glad I could help.

I also usually use the trunk folder for active development, I guess it's a matter of philosophy. :-)

mxp
mxp
Newbie
Newbie
 
Posts: 6
Joined: Tue Nov 27, 2012 2:19 pm

Re: Building the firmware

Postby ian » Wed Dec 05, 2012 1:43 am

Do we know who built the release versions of the firmware? Maybe he can tell us what he did differently.


That would be this guy :) Glad you got it going.

I don't really understand the intricacies of SVN and just work in the trunk, also makes it easier for new contributors. It is bad habit I know, but would prefer to move to GIT rather than learn more SVN stuff.
User avatar
ian
Crew
Crew
 
Posts: 10578
Joined: Mon Jul 06, 2009 6:14 am

Re: Building the firmware

Postby dukey » Wed Dec 05, 2012 6:26 am

svn is easy on windows, specially with tortoisesvn ;p
dukey
Full Member
Full Member
 
Posts: 219
Joined: Thu Jul 08, 2010 2:18 pm

Re: Building the firmware

Postby KamalS » Sun Dec 09, 2012 11:01 pm

ian wrote:
Do we know who built the release versions of the firmware? Maybe he can tell us what he did differently.


That would be this guy :) Glad you got it going.

I don't really understand the intricacies of SVN and just work in the trunk, also makes it easier for new contributors. It is bad habit I know, but would prefer to move to GIT rather than learn more SVN stuff.


I am lost trying to program a DIY Toy: I expected to see a USBIRToy-BLxFWyy-DUMP.hex in the release package but it is missing?

Also the release package and source seems to be from last year.

Were it not ported over to the Hoken stack a few months ago so that the MAL dependency is now gone?

Where can I get that release (or where could I get the "latest" USBIRToy-BLxFWyy-DUMP.hex)

I want the hex file with the bootloader as I intend to change the firmware that runs.
Looking forward to meeting other hobbyists. PM me if you are in or around Orange, CA!
KamalS
Newbie
Newbie
 
Posts: 29
Joined: Fri Jul 08, 2011 1:37 am

Re: Building the firmware

Postby ian » Mon Dec 10, 2012 2:39 am

I am lost trying to program a DIY Toy: I expected to see a USBIRToy-BLxFWyy-DUMP.hex in the release package but it is missing?


It would be in the source package, manufacturing resources directory if it is there.

Also the release package and source seems to be from last year.


Could be a date problem, but could also be right. The last 4 or 5 updates with the new stack have not gone well enough to move to manufacturing.
Were it not ported over to the Hoken stack a few months ago so that the MAL dependency is now gone?

True.
Where can I get that release (or where could I get the "latest" USBIRToy-BLxFWyy-DUMP.hex)

Everything we have is in the source pack or SVN repository.
User avatar
ian
Crew
Crew
 
Posts: 10578
Joined: Mon Jul 06, 2009 6:14 am

Re: Building the firmware

Postby KamalS » Mon Dec 10, 2012 4:56 pm

ian wrote:
I am lost trying to program a DIY Toy: I expected to see a USBIRToy-BLxFWyy-DUMP.hex in the release package but it is missing?


It would be in the source package, manufacturing resources directory if it is there.

Where can I get that release (or where could I get the "latest" USBIRToy-BLxFWyy-DUMP.hex)

Everything we have is in the source pack or SVN repository.


Thank you Ian, I got the factory image from SVN - IT HELPS to have a composite image so that I can be up and running the moment I take the PIC off the programmer.
Looking forward to meeting other hobbyists. PM me if you are in or around Orange, CA!
KamalS
Newbie
Newbie
 
Posts: 29
Joined: Fri Jul 08, 2011 1:37 am


Return to USB Infrared Toy