NOTE this issue was originally raised here https://community.platformio.org/t/chipkit-max32-example-doesnt-compile/843.
Also Ivan please note that in some experimenting and exploring of this issue I found that it worked fine under Ubuntu, which I also have installed on my PC. The example works, so the issue appears to be with my PC / OS / PlatrormIO install somehow. Happy to attempt to reinstall everything from scratch if you think that will help. I've already tried it once but perhaps I didn't fully uninstall and delete everything relevant before attempting to reinstall.
Hi Ivan,
Not entirely sure how to replace the toolchain. The library structure of the download in the link you gave me is quite different to the one already in the packages module. I tried just adding the new library to the existing folder but (of course) got the same error. So I tried deleting everything in the toolchain-microchippic32 folder except the package.jason file, and copying the chipkig-core from the download into it. I now get a pic32-g++ not found error. Hardly surprising as it's hidden another couple of folders down in the new library. It's in toolchain-microchippic32/chipkit-core/pic32/compiler/pic32-tools/bin/bin/gcc/ Oddly there is another one one level up, under the second bin/ folder.
So I eventually worked out that the folders I needed from the download were: chipkit-core/pic32/compiler/pic32-tools/bin/, chipkit-core/pic32/compiler/pic32-tools/lib, and chipkit-core/pic32/compiler/pic32-tools/pic32mx to be placed in toolchain-microchippic32. This way the library structure was the same and a cursory inspection of the contents of the libraries indicated that all the required files were present. The other libraries in the download; cores, libraries, tools, and variants, I ignored as I assumed they were already present somewhere else in ~/.platformio. Tried the compile again but got the original error back again, about crtbegin.o and crtend.o being multiply defined.
Just for fun I copied the rest of the libraries in the download, and the other files (boards.txt etc) into the toolchain-microchippic32 folder and tried the compile again. Same result.
Is there any other information I can give you that might point you in the direction of the error? A verbose listing of the compile and link maybe?
For the record I tried it with the -v option. here's the result.
ian@Ian-Mint ~/PlatformIO/ChipKitTest2 $ pio run --verbose
[Thu Oct 6 16:40:19 2016] Processing mega_pic32 (platform: microchippic32, board: mega_pic32, framework: arduino)
Collected 32 compatible libraries
Looking for dependencies...
Project does not have dependencies
pic32-g++ -o .pioenvs/mega_pic32/firmware.elf -w -Os -mdebugger -mprocessor=32MX795F512L -mno-peripheral-libs -nostartfiles -Wl,--gc-sections /home/ian/.platf
ormio/packages/framework-arduinomicrochippic32/cores/pic32/cpp-startup.S /home/ian/.platformio/packages/framework-arduinomicrochippic32/cores/pic32/crti.S -Wl
,--script="chipKIT-application-32MX795F512.ld" -Wl,--script=chipKIT-application-COMMON.ld .pioenvs/mega_pic32/src/blink.o -L/home/ian/.platformio/packages/fra
mework-arduinomicrochippic32/cores/pic32 -L/home/ian/.platformio/packages/framework-arduinomicrochippic32/variants/Max32 -L.pioenvs/mega_pic32 -Wl,--start-gro
up .pioenvs/mega_pic32/libFrameworkArduinoVariant.a .pioenvs/mega_pic32/libFrameworkArduino.a -lm -Wl,--end-group
/home/ian/.platformio/packages/toolchain-microchippic32/bin/bin/../../lib/gcc/pic32mx/4.8.3/size/crtbegin.o:(.sdata+0x0): multiple definition of dso_handle
'
/home/ian/.platformio/packages/toolchain-microchippic32/bin/bin/../../lib/gcc/pic32mx/4.8.3/size/crtbegin.o:(.sdata+0x0): first defined here
/home/ian/.platformio/packages/toolchain-microchippic32/bin/bin/../../lib/gcc/pic32mx/4.8.3/size/crtend.o:(.dtors+0x0): multiple definition ofDTOR_END'
/home/ian/.platformio/packages/toolchain-microchippic32/bin/bin/../../lib/gcc/pic32mx/4.8.3/size/crtend.o:(.dtors+0x0): first defined here
/home/ian/.platformio/packages/toolchain-microchippic32/bin/bin/../../lib/gcc/pic32mx/4.8.3/size/crtend.o:(.tm_clone_table+0x0): multiple definition of `__TMC
_END'
/home/ian/.platformio/packages/toolchain-microchippic32/bin/bin/../../lib/gcc/pic32mx/4.8.3/size/crtend.o:(.tm_clone_table+0x0): first defined here
/home/ian/.platformio/packages/toolchain-microchippic32/bin/bin/gcc/pic32mx/4.8.3/../../../../bin/pic32-ld: Link terminated due to previous error(s).
collect2: error: ld returned 255 exit status
*** [.pioenvs/mega_pic32/firmware.elf] Error 255
Reply
ivankravetsPlatformIO Plus Team9h
Please move issue here https://github.com/platformio/platform-microchippic32/issues