Segmentation Fault with Pic32prog [Linux]

Hi everyone,

First of all, I think that it’s important to precise that I’m new with PlatformIO. Actually I’m working for a university in Belgium and I try to replace the old MPIDE (which was abandonned by Microchip) to program some PIC32.

We are currently using the Chipkit Uno32 (and the uC32) that is supported by PlatformIO. Then I first tried on Windows (by installing PlatformIO IDE with Atom) and that was a succes. I even could recompile some old projects just by addind the peripheral libraries (plib was also abandonned by microchip by the way) to platformIO.

The problem is that when I try to do it using platformIO with Linux, that doesn’t work. With both PlatformIO IDE and CLI (which is actually the same process), I always get the same error :

Auto-detected: /dev/ttyUSB0
“/home/User/.platformio/packages/tool-pic32prog/pic32prog” -b 11520
0 -d “/dev/ttyUSB0” .pioenvs/uno_pic32/firmware.hex
Programmer for Microchip PIC32 microcontrollers, Version 2.0.224
Segmentation fault (core dumped)
scons: *** [upload] Error 139
=========================================== [ ERROR ] Took 0.95 seco
nds ===========================================

PlatformIO compiles the code without problem. The problem happens when pic32prog is called to upload the code via USB. I also tried to upload an .hex file generated on windows with pic32prog on linux but that doesn’t work either.

However, when I upload an .hex file generated by xc32-gcc (the MPLab compiler) with pic32prog and the pickit2, it works.

I have to guess that I’m lost. Does anyone have an idea of how to solve my problem ?

Thank you for reading my message anyway. I’m also sorry for my English and pardon me for my mistakes please.

We tightly work with Microchip. They are interested in PlatformIO and will add support for it later. Stay tuned with PlatformIO https://twitter.com/PlatformIO_Org .

Secondly, thanks a lot that you use PlatformIO in university. PlatformIO is free and open source project with cross-platform behaviour. It means, that students can reproduce the same PlatformIO project on the most popular host OS without any additional installation or configuration.

Finally, this issue is fixed in the latest development version. Please switch to PlatformIO 3.0. See Redirecting...

Please report if it works for you.

1 Like

Hi,

Thanks for your answer !

I tried and… It works for both ! Thank you very much for PlatformIO by the way. I think that we will use it to teach the student how to program on pic32.

Just one question : can I know what was the issue ?

Sure, see

Many thanks !

I think it will be easier with PlatformIO to teach the students.

Just one more question : I included the peripheral library by myself in platformIO. Why don’t you include it in the platformIO distribution ?

I know that this library was dumped by Microchip in chipkit-core and xc32. They ask you to use MPLab Harmony instead but plib is actually included in Harmony…

Where is located this library?

I found it in the last version (abandoned) of MPIDE available here :

http://chipkit.net/wiki/index.php?title=MPIDE

following the path :

\mpide-0150\hardware\pic32\compiler\pic32-tools\pic32mx\include

You need to add plib.h and the file peripherals in the pic32mx file of platformIO which is located here :

.platformio\packages\toolchain-microchippic32\pic32mx\include

Plese open an issue here Issues · platformio/platform-microchippic32 · GitHub

That’s done.

Thanks !