Skip to main content
Topic: PIC programming under Linux and Mac OS X (Read 29210 times) previous topic - next topic

Re: PIC programming under Linux and Mac OS X

Reply #30
It may only work with ELF files containing debug information (variable names, symbols etc.).
Loading a stripped (bare) executalbe ELF file in MPLAB-X makes no sense without a simulator,
at least not to me.

Re: PIC programming under Linux and Mac OS X

Reply #31
[quote author="IPenguin"]
It may only work with ELF files containing debug information (variable names, symbols etc.).
[/quote]

yes, loading elf with debug info does make some sense - also - it works :D

look at it here: http://www.youtube.com/watch?v=Hy-O_FD2QpU

btw status goes:
1. Creating project
2. Analyze binary

Re: PIC programming under Linux and Mac OS X

Reply #32
Well actually we weren't talking about creating a new project from an elf file.

When you compile (hammer&sweep icon) e.g. the bus pirate in MPLABX, it finishes on the following messages:

BUILD SUCCESSFUL (total time: 10s)
Loading .../trunk/source/busPirate.X/busPirate/dist/default/production/busPirate.production.elf...
The program file could not be loaded: com.microchip.mplab.mdbcore.program.exceptions.ProgramFileProcessingException

So maybe it simply doesn't make sense if there is no debug info but it's quite disturbing, they should then not attempt to load the result at all...

Edit: I tried the "Debug Project" (ctrl+F5), same behavior

 

Re: PIC programming under Linux and Mac OS X

Reply #33
[quote author="doegox"]
Well actually we weren't talking about creating a new project from an elf file.

When you compile (hammer&sweep icon) e.g. the bus pirate in MPLABX, it finishes on the following messages:

BUILD SUCCESSFUL (total time: 10s)
Loading .../trunk/source/busPirate.X/busPirate/dist/default/production/busPirate.production.elf...
The program file could not be loaded: com.microchip.mplab.mdbcore.program.exceptions.ProgramFileProcessingException

So maybe it simply doesn't make sense if there is no debug info but it's quite disturbing, they should then not attempt to load the result at all...

Edit: I tried the "Debug Project" (ctrl+F5), same behavior
[/quote]

I believe what you are referring to is a known bug in MPLAB X.  See my post here

See also this Microchip Forum thread (you have to be registered to see this -- first you have to register on Microchip's forum then second you have to request access to the MPLAB X board but, I can't remember where or how you do that right now -- I'll update this when I remember or find it).

-Eric

Re: PIC programming under Linux and Mac OS X

Reply #34
[quote author="doegox"]
When you compile (hammer&sweep icon) e.g. the bus pirate in MPLABX, it finishes on the following messages:

BUILD SUCCESSFUL (total time: 10s)
Loading .../trunk/source/busPirate.X/busPirate/dist/default/production/busPirate.production.elf...
The program file could not be loaded: com.microchip.mplab.mdbcore.program.exceptions.ProgramFileProcessingException
[/quote]

It works for me ?!

the "The program file could not be loaded: .." is not displayed

Re: PIC programming under Linux and Mac OS X

Reply #35
I just tried to compile another project with dspic (as pic32mx uses C32 so I wanted to check if C30 is working ok), and again, after the elf is generated it is "loaded properly" (whatever that means) ... but then I compiled BusPirate firmware (outside of some case sensitive stuff it all works ok) - I got the same "The program file could not be loaded: com.microchip.mplab.mdbcore.program.exceptions.ProgramFileProcessingException" you are getting so it has nothing to do with mplab-x installation imho but we are doing something wrong with the bp firmware on mplab-x

Re: PIC programming under Linux and Mac OS X

Reply #36
[quote author="arhi"]
I got the same "The program file could not be loaded: com.microchip.mplab.mdbcore.program.exceptions.ProgramFileProcessingException" you are getting so it has nothing to do with mplab-x installation imho but we are doing something wrong with the bp firmware on mplab-x
[/quote]

I was probably not clear before.  This bug seems to have been identified by Microchip and fixed for the next beta which has not been released yet. 

Below are the two relevant posts from the Microchip >> Development Tools >> MPLAB X IDE forum I referenced.

-Eric

Quote
Monday, October 18, 2010 9:53 AM ( #1 )

Hi

I'm using MPLAB X Beta3.0a on fedora 13 x86_64 with java 1.6.0_22 (32 bits)

When building a project with microchip C18 I get the following error:
BUILD SUCCESSFUL (total time: 4s)
Loading /home/rbras/progs/pic/testeTCP/dist/default/production/testeTCP.production.cof...
The program file could not be loaded: com.microchip.mplab.mdbcore.program.exceptions.ProgramFileProcessingException

The complete java exception is:

java.util.NoSuchElementException
    at java.util.LinkedList$ListItr.next(Unknown Source)
    at com.microchip.mplab.mdbcore.program.ScopeBlock.InsertBlock(ScopeBlock.java:61)
    at com.microchip.mplab.mdbcore.program.ScopeBlock.InsertBlock(ScopeBlock.java:71)
    at com.microchip.mplab.mdbcore.program.ScopeBlock.InsertBlock(ScopeBlock.java:71)
    at com.microchip.mplab.mdbcore.program.processors.CoffReaderC18v2.BuildSymbolTable(CoffReaderC18v2.java:202)
    at com.microchip.mplab.mdbcore.program.processors.ProgramFileCoffDefault.Load(ProgramFileCoffDefault.java:346)
    at com.microchip.mplab.mdbcore.program.processors.ProgramFileCoffDefault.Load(ProgramFileCoffDefault.java:245)
    at com.microchip.mplab.mdbcore.program.spi.ProgramFileProviderFactory.getProvider(ProgramFileProviderFactory.java:98)
    at com.microchip.mplab.mdbcore.loader.MCLoader.Load(MCLoader.java:67)
    at com.microchip.mplab.nbide.loader.MdbLoader$1.run(MdbLoader.java:42)
[catch] at java.lang.Thread.run(Unknown Source)

It looks like MPLAB-X can't open the cof file but I am not sure.

Best regards

Xxxxx Xxxx

...several more posts here including the original poster sending the developer/programmer a copy of the COFF file as requested...

Quote
Wednesday, October 27, 2010 5:43 PM ( #6 )

Thank you very much for prioviding the COFF file ;-). There was definitely a yet unidentified and unexposed corner case created by the particular project and Language tools you are working with.  The COFF file provided me with the context to locate and trap the cause of the problem.
 
The problem has been fixed and the solution will be available in the soon to be release Beta 4 version of MPLAB X.
 
Thanks again for investing the time and helping us to sharpen and refine the next generation of MPLAB.
 
Regards,

xxxxxx

...a thank you post from the original poster and then my post...

Quote
Saturday, November 06, 2010 3:37 PM ( #8 )

I just started testing with MPLAB X and am getting this same error.  Well, not exactly the same since I am using the C30 tools so it is complaining about a ...production.elf file instead of a .cof file (It does not seem like the option to select between ELF and COFF formats has been implemented yet).   The same error occurs when this particular project is compiled on both a windows and a Linux platform.  Is there any workaround or patch?  Would it be helpful to post the .elf file?

-Eric

...and no response yet.



Re: PIC programming under Linux and Mac OS X

Reply #39
Thanks for the news Eric!
But still the same bug when attempting to compile & load the Bus Pirate ELF:(

Re: PIC programming under Linux and Mac OS X

Reply #40
[quote author="doegox"]
Thanks for the news Eric![/quote]

No problem.

[quote author="doegox"]
But still the same bug when attempting to compile & load the Bus Pirate ELF:(
[/quote]

That's very disappointing to hear.  After I get a chance to test it I will update my post on the Microchip Development Tools MPLAB X forum to see if I get any response.  They may have not bothered responding to me last time because they knew the release was only a few days away.  If it is still having the same problem with the latest version maybe they will reply.

-Eric

Re: PIC programming under Linux and Mac OS X

Reply #41
Just on a side note: Microchip released a new version (3.25) of the C30 (PIC24 and dsPIC) compiler for Win32 on 11/15/2010 (Download)

However, the C30 compiler on the MPLAB X download site still is v3.24. Since the Win32 versions of the official MPLAB C compilers and the MPLAB C compilers released on the MPLAB X download site are identical, you may want to try the new C30 under MPLAB X on a Win32 system for the BP project ... as the error could be caused by something in the ELF file. Just a wild guess ...

Re: PIC programming under Linux and Mac OS X

Reply #42
just a note, beta4 have a simulator :D (still no pk2 support) .. I just tested PIC30-GCC (3.24) PIC24FJ128GA010  (some demo project) and darn, simulator works like a charm .. tried the D32 (UBW32 - PIC32-GCC v1.11a) firmware but simulator ignored me .. so either pic32 is not fully supported or something else is the problem... anyhow I like where this is going :D

for osx users - c18 is still not there

Re: PIC programming under Linux and Mac OS X

Reply #43
Hey guys, any methods for installing MAL to Linux directly?  I am searching about this in my free time but it seems that I have to use Wine.

Re: PIC programming under Linux and Mac OS X

Reply #44
the way I did is was to install it under virtual box on windows and then copy the directory to linux ..

you can see it in my UBW32 "fix" to compile with mplabx here: http://elco.crsndoo.com/files/UBW32.fir ... abx.tar.gz

it is only Microchip directory from MAL 2010-08-04 ( USB stack v2.7a ..) but it is all you need (the examples etc I have not copied) ... it is kinda "not straight forward to upgrade", but let's hope mchip delivers on their promisse to have mplabx GA in first quarter of 2011 .. that gives them another 4 months to make everything work everywhere :D and it should include the whole MAL that works together with mplabx on all platforms