Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Linux: steps to program fullsize RC robot (http://www.chiefdelphi.com/forums/showthread.php?t=23517)

rwaliany 09-01-2004 16:56

Linux: steps to program fullsize RC robot
 
Post here if you need help and this doesn't work.
Current site: http://ryan.scv.net/x2545/pic

Code:

Documentation IFI Linux PICloader setup Fullsize RC with MCC18 compiler:

Non-root setup (advanced users):
Same steps as "root setup"
 Additional steps
 edit ~/picloader/code/Makefile # change user directory to yours
 chmod permissions <device>    # on startup
 cp picloader /usr/bin          # cp picloader to binary directory as root

Gentoo (root setup):
cd ~/
wget http://ryan.scv.net/x2545/picloader/...der.0.2.tar.gz # get the file
emerge wine                        # installs package
wine                              # installs wine basic setup information
mount /dev/cdrom /mnt/cdrom        # pipe the cdrom to /mnt/cdrom
cd /mnt/cdrom                      # change local directory to /mnt/cdrom
wine MPLAB_C18.exe                # start the install, install it to default directory c:/mcc18
cd ~/                              # change to home directory
(editor) ~/.wine/config            # add path
@ 77
- "Path" = "c:\\Windows;c:\\Windows\\System;f:\\;h:\\;z:\\"
+ "Path" = "c:\\Windows;c:\\Windows\\System;f:\\;h:\\;z:\\;c:\\mcc18\\bin;h:\\ifi-picloader\\code"
@ 90
- "Windows" = "win98"
+ "Windows" = "winxp"

cd ~/
tar -xzvf ifi-picloader.0.2.tar.gz # extract the file
cd ifi-picloader                  #
make                              # compile the Linux programmer for the RC
cd code                            # change to where all the code should be done for your robot
make                              # compile the code in the code directory
picloader FrcCode.hex <device>    # write program to serial device, usually /dev/ttyS0 com1

# Device samples
# Com1 = "/dev/ttyS0"
# Com2 = "/dev/ttyS1"
# Com3 = "/dev/ttyS2"
# USBSerial (pl2303) = "/dev/usb/tts/0"

Thanks,
Ryan Waliany

Servo888 09-01-2004 20:40

Re: Linux: steps to program fullsize RC robot
 
Hmm no luck getting the MPLAB IDE to run under Linux.

I've tried, wine version 20031212, XOffice, and WineX. And they all give me the same responce. The Microchip MPLAB IDE logo loads, and just stays there. Doesn't do anything else.

Very strange; It would be nice of Micochip to offer us a C18 compiler... They can keep the IDE, just want the compile =\.

*sigh*. Gonna keep trying to get the IDE

rwaliany 10-01-2004 02:01

Re: Linux: steps to program fullsize RC robot
 
The point of this thread is to show steps to bypass the MPLAB Ide allowing you to use any IDE or editor you want, anjuta, vim, or kate for example and be able to compile code and load it to the pic in Linux. MPLAB is limited, need I say more? MPLAB requires internet explorer 5....what for? If you want MPLAB to use the simulator, you should be able to wine the simulator dll mpsim.dll.

Once your done with these steps, you can edit the source files user_routines.c in any editor you would like, then type make in console and then picloader FrcCode.hex <device>, and you would have programmed the PIC with the same functionality as in Windows, with MPLAB etc...

Servo888 10-01-2004 18:51

Re: Linux: steps to program fullsize RC robot
 
Let me see if I understand this:

The MPLAB_C18.exe is just the compiler; and not the IDE? (sorry, I don't have a copy of the CD; so I'm trying to figure this out.)

rwaliany 10-01-2004 19:18

Re: Linux: steps to program fullsize RC robot
 
Yes, MPLAB_C18 is the compiler.

ScottWolchok 17-01-2004 20:06

Re: Linux: steps to program fullsize RC robot
 
Quote:

Originally Posted by rwaliany
Yes, MPLAB_C18 is the compiler.

You mean it's the installer for the IDE...mcc18.exe is the compiler =P
Note that there's a typo in the Makefile. The line that starts with MCC18DIR should read:
Code:

MCC18DIR=$(USER_DIR)/.wine/fake_windows/mcc18/
(The trailing slash after $(USER_DIR) was missing)

rwaliany 17-01-2004 20:16

Re: Linux: steps to program fullsize RC robot
 
Quote:

Originally Posted by ScottWolchok
You mean it's the installer for the IDE...mcc18.exe is the compiler =P
Note that there's a typo in the Makefile. The line that starts with MCC18DIR should read:
Code:

MCC18DIR=$(USER_DIR)/.wine/fake_windows/mcc18/
(The trailing slash after $(USER_DIR) was missing)

Note how USER_DIR had a trailing slash at the end of it in the example...also it seems that what the executable for mcc18 is, is dependent on your kernel I believe. On 2.4.23 it appeared as mcc18.exe and on 2.6.1-mm2 it appeared as whatever I had in the installation documentation. Hopefully, I'll improve it this weekend, I have to fix a few things. I've received some courteous improvements for the Makefile from Michael Wu I'll have to add.

Also, the project page should be up now at http://ifi-picloader.sourceforge.net .

Thanks for your interests,
Ryan Waliany

rwaliany 19-01-2004 17:47

Re: Linux: steps to program fullsize RC robot
 
New release 0.3, it should be easier to install now and more user-friendly. Lots of makefile improvements with some suggestions from others. A serial reader will be coming in 0.4 which will allow you to debug using a terminal and read data from the program port.

http://ifi-picloader.sf.net/

deltacoder1020 19-01-2004 18:34

Re: Linux: steps to program fullsize RC robot
 
heh, now all we need is a PocketPC running Linux and we'll be able to have a mobile programming and download platform ;)

mikew 19-01-2004 21:13

Re: Linux: steps to program fullsize RC robot
 
compiler is x86 only, so you'll need a pc emulator. dunno how well those run on pocketpc.

deltacoder1020 20-01-2004 00:11

Re: Linux: steps to program fullsize RC robot
 
eh, so it's only a mobile download platform. either way, it would still be fun ;)

rwaliany 20-01-2004 00:30

Re: Linux: steps to program fullsize RC robot
 
Added some more suggestions from Michael Wu, will hopefully release 0.4 tomorrow with serial reader and fixed erasing pic for multiple memory banks.http://xp.scv.net/x2545/picloader/if...der.0.4.tar.gz Beta release

Working on make install, and moving to /usr/share/ifi-picloader/

Jeff McCune 20-01-2004 14:37

Re: Linux: steps to program fullsize RC robot
 
I'm having trouble reproducing your results. I'm running Debian Sarge (testing) on my notebook, and tried to apt-get install wine. Upon configuring wine the way you suggest, I can't get the mcc18.exe compiler to work. It keeps bombing out with this error:

Code:

F:\Code\code>mcc18 -p=18F8520 -fo user_routines.o user_routines.c /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od-         
fixme:win:GetProcessWindowStation (void): stub
fixme:win32:GetUserObjectInformationW (0x1 2 (nil) 0 0x4067fb68),stub!
fixme:win:GetThreadDesktop (9): stub
fixme:win32:GetUserObjectInformationW (0x1 2 (nil) 0 0x4067fb6c),stub!
fixme:win32:GetUserObjectInformationW (0x1 2 0x4036a0a8 0 0x4067fb68),stub!
fixme:win32:GetUserObjectInformationW (0x1 2 0x4036a0a8 0 0x4067fb6c),stub!
fixme:ntdll:NtQueryInformationProcess (0xf04,0x00000000,0x4067fa40,0x00000018,(nil)),stub!
fixme:msvcrt:_spawnve :not translating name .\cpp18 to locate program
fixme:msvcrt:msvcrt_spawn :must dup/kill streams for child process
error -1 spawning .\cpp18

I'm running this from wine by using wine cmd.exe I tried it from a bash shell with the same error message. I figured running from cmd.exe might help things, but apparently not.

This is the version of wine I'm running:
Code:

silas@frink:~$ wine --version
find: /usr/bin/../lost+found: Permission denied
Wine 20031212

Has anyone had success with the free and open version of wine? I'm not too keen on this 30 Day trial software from codeweavers, and I have issues in general with supporting the codeweaver software. Any help would be greatly appreciated.

mikew 20-01-2004 15:24

Re: Linux: steps to program fullsize RC robot
 
check ~/.wine/config . you need to make sure the native, not wine, version of msvcrt is being used or mcc18 will die with some spawning error. oh, and you need a copy of msvcrt.dll too.

Jeff McCune 20-01-2004 16:11

Re: Linux: steps to program fullsize RC robot
 
Thanks for the advice... One step closer in the right direction, but still not there. Hopefully if I can get this working, I can document the process and perhaps package something nice for people to easily get development up and running in Linux. Hopefully it'll help you focus on the excellent work you're doing with the clone of the IFI loader.

I copied my msvcrt.dll from my Windows XP machine (The copy in C:\Windows\System32, there were many copies) into my .../fake_windows/Windows/System32 directory in Linux. I made sure that msvcrt is trying to load native before loading the builtin. It now just refuses to load the exe with the following error:

Code:

silas@frink:/var/silas/public/first2004/Code/code$ wine -- "C:\\mcc18\\bin\\mcc18.exe" -p=18F8520 -fo "F:\\Code\\code\\main.o" "F:\\Code\\code\\main.c"
find: /usr/bin/../lost+found: Permission denied
err:module:LdrInitializeThunk Main exe initialization failed, status c0000142
Wine failed with return code 1

Any more suggestions? Are you using built-ins from a full install of Windows? I'd like not to do this, but I have Windows XP and Windwos 98 lying around that I can copy the DLL's from if need be.

Thanks again for your help with this.

Here's what my ~/.wine/config looks like:
Code:

(Deleted because it was flippin' huge.  My windows version line was wrong, see below for fix)


All times are GMT -5. The time now is 00:04.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi