platformio / platform-microchippic32

Microchip PIC32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/microchippic32
Apache License 2.0
6 stars 3 forks source link

Chipkit example for Max32 does not compile #5

Closed mogplus88 closed 7 years ago

mogplus88 commented 7 years ago

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

mogplus88 commented 7 years ago

Hi Ivan, please note that this issue is not a biggy for me, I'm not going to be using my Max32 any time soon, so if you need to put it on the back burner and get on with more urgent work (i.e. pretty much anything else) please do it. I appreciate that PlatformIO is a labour of love for you and all the help and advice you provide is in your own time, and we all appreciate it. Thanks!

EmbeddedMan commented 7 years ago

mogplus88 - I'm happy to help you out if I can be of any assistance. It sounds to me like the installation of the chipKIT-core files is not right for some reason.

I have tried reproducing your issue (using my primary development machine - which is Windows based) with no luck so far.

But I can help you understand how to replace the chipKIT-core files in your PlatformIO system with 'fresh' ones if you would like.

*Brian

mogplus88 commented 7 years ago

Hi Brian, sorry just saw this post', and thank you for the offer, much appreciated. Haven't had a go at reinstalling or anything yet, so I guess I should start at the beginning. If it is just a case of doing a "pio platform remove ..." or something and then reinstall it I'll do that first (i.e. RTFM). if still no joy Ill get back to you for some more things to try! Thanks, Ian

mogplus88 commented 7 years ago

Well, did an uninstall and reinstall of the pic32 platform, and that seems to have done the trick. The example now compiles and loads successfully. I still get the warning about the 99-platformio-udev-rules being missing, but it's only a warning and doesn't seem to affect anything. Problem solved!

EmbeddedMan commented 7 years ago

I'm very happy to hear that!

I unfortunately have no idea what the udev-rules warning is about - that seems like more of a platform-io thing than a chipKIT thing.

Good luck-

*Brian

On Thu, Oct 20, 2016 at 12:58 AM, mogplus88 notifications@github.com wrote:

Well, did an uninstall and reinstall of the pic32 platform, and that seems to have done the trick. The example now compiles and loads successfully. I still get the warning about the 99-platformio-udev-rules being missing, but it's only a warning and doesn't seem to affect anything. Problem solved!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/platformio/platform-microchippic32/issues/5#issuecomment-255016135, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbeCKKBlJmmaEBEbxS-BmqfqgqfhTd0ks5q1wLzgaJpZM4KR6u0 .

ivankravets commented 7 years ago

I still get the warning about the 99-platformio-udev-rules being missing, but it's only a warning and doesn't seem to affect anything.

Is fixed in PlatformIO 3.2 development version.

ivankravets commented 7 years ago

@mogplus88 please update Microchip PIC32 development platform to 1.2.0 version. See new release https://github.com/platformio/platform-microchippic32/releases/tag/v1.2.0

Using PlatformIO Core (CLI): pio update Using PlatformIO IDE: Menu: PlatformIO > Update packages...

Does it work now?

ivankravets commented 7 years ago

Please reopen if you still need help

mogplus88 commented 7 years ago

All good thanks Ivan, and thanks to you and the other forum members for you great support. Cheers, Ian