Help compiling to PIC chip
Help compiling to PIC chip
I'm an original Kickstarter supporter, and have been playing with my MicroPython board. I'd like to try the 16 bit PIC version, but need just a bit of hand holding: What commands were used to compile the code? I'm running MPLABX under Windows, and the process for using an existing makefile is utterly un-documented.
I would be perfectly willing to set up a PC with Linux if it would make things easier.
Meanwhile, thanks for creating this wonderful tool!
I would be perfectly willing to set up a PC with Linux if it would make things easier.
Meanwhile, thanks for creating this wonderful tool!
Re: RE: Help compiling to PIC chip
Quite simply you just type "make" and it will build. But that requires a working make environment (which you can set up on Windows) as well as the mplabx command line compiler and linker.fdeck wrote:What commands were used to compile the code?
You have 3 options: 1) get a working make environment going under Windows, 2) create an mplabx project and import all the needed uPy source files, 3) run Linux in a virtual machine and compile it in there.
I'd suggest the first or second option. If you go for the second option then you'll need to generate 2 header files by hand: mpversion.h and qstrdefs.generated.h
Re: Help compiling to PIC chip
Thanks. I'll give it a whirl. Did you original write it on a Windows machine? Would it be possible to share the .X project file? This is all just for a learning project, but it's much appreciated.
Re: Help compiling to PIC chip
I do not have a mplabx project file. You probably know better than me how to make one!
Re: Help compiling to PIC chip
On a related note, I am trying to build the pic16bit port of micropython under Mac OSX as a precursor to trying to get it running on another 16-bit PIC part (PIC24FJ256GB206). I had to change the path to XC16 from /opt/microchip/xc16/v1.24 to /Applications/microchip/xc16/v1.24, but otherwise I haven't made any other changes to the Makefile. When I attempted to build the project, it got to the point of trying to link everything together into an .elf file at which point it exited with the following error:
LINK build/firmware.elf
__TEXT __DATA __OBJC others dec hex
size: file: build/firmware.elf is not an object file
make: *** [build/firmware.elf] Error 1
make: *** Deleting file `build/firmware.elf'
I do have an Ubuntu machine with the Microchip tools installed on it and was able to get the project to build out of the box on that machine. I would really rather develop on my Mac, if possible. Does anyone have any ideas about why the linker might be trying to interpret the .elf file as an object file?
Brad Minch.
LINK build/firmware.elf
__TEXT __DATA __OBJC others dec hex
size: file: build/firmware.elf is not an object file
make: *** [build/firmware.elf] Error 1
make: *** Deleting file `build/firmware.elf'
I do have an Ubuntu machine with the Microchip tools installed on it and was able to get the project to build out of the box on that machine. I would really rather develop on my Mac, if possible. Does anyone have any ideas about why the linker might be trying to interpret the .elf file as an object file?
Brad Minch.
Re: Help compiling to PIC chip
I had this problem when switching between a unix flavor of the build done on Linux and a unix flavor of the build on MacOSX. I was build essentially from a network drive.
So make sure that you remove the build directory.
If you still hit the problem, then it would be good to see the output by adding V=1 to the make command line.
So make sure that you remove the build directory.
If you still hit the problem, then it would be good to see the output by adding V=1 to the make command line.
Re: Help compiling to PIC chip
If the error is just coming from running size on the output elf file then you can just remove that line from the Makefile.
The reason it's broken is because the Makefile is using the host "size" program instead of the target/cross-compile version of "size". So you might be able to fix it by using the right "size" binary.
Line 61 of the Makefile is what you should look at.
The reason it's broken is because the Makefile is using the host "size" program instead of the target/cross-compile version of "size". So you might be able to fix it by using the right "size" binary.
Line 61 of the Makefile is what you should look at.
Re: Help compiling to PIC chip
There does not appear to be a target/cross-compiler version of size, at least not one that comes with the Microchip tool suite. It appears that the version of size that comes on a typical Linux installation understands .elf files, but the one that comes with Mac OSX does not. If I comment out line 61 of the Makefile, the build process goes through just fine.
Brad Minch.
Brad Minch.
Re: Help compiling to PIC chip
I am looking at setting up a Microchip development environment on Ubuntu system to compile pic-16 bit (24 and 33 parts) port of micropython.
Did anyone use Microchip XC16 compiler and which version supports optimization to compile micropython or did you use anything else?
All assistance and pointers would be appreciated.
Regards
John
Did anyone use Microchip XC16 compiler and which version supports optimization to compile micropython or did you use anything else?
All assistance and pointers would be appreciated.
Regards
John
Re: Help compiling to PIC chip
Has anybody recently succeeded in running on any PIC devices ??