energia / Energia

Fork of Arduino for the Texas Instruments LaunchPad's
http://energia.nu
Other
798 stars 670 forks source link

Issues with Uploading to FraunchPad MSP430FR5739 on Mac OS X #112

Closed rei-vilo closed 12 years ago

rei-vilo commented 12 years ago

I tried uploading to the FraunchPad MSP430FR5739 the classic Blink example from Energia on Mac OS X but faced this error message:

Binary sketch size: 708 bytes (of a 15 872 byte maximum) /Applications/Energia.app/Contents/Resources/Java/hardware/tools/msp430/mspdebug/mspdebug rf2500 --force-reset prog /var/folders/95/qchnfz9d0854_3931bv30gt80000gn/T/build2744895414480989413.tmp/Blink.cpp.hex MSPDebug version 0.19 - debugging tool for MSP430 MCUs Copyright (C) 2009-2012 Daniel Beer dlbeer@gmail.com This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Trying to open interface 1 on 005 Initializing FET... FET protocol version is 30328680 Configured for Spy-Bi-Wire Sending reset... Set Vcc: 3000 mV Device ID: 0x0381 Device: MSP430FR5739 Code memory starts at 0xc200 Number of breakpoints: 3 Erasing... fet: FET returned error code 14 (Could not erase device memory) fet: erase command failed ihex: error on line 38

The Blink sketch ends at line 19 so the error on line 38 isn't of much help.

The board FraunchPad w/ msp430fr5739 is selected on the Tools > Board menu.

The case has been solved on Windows —see #70— but still remains in Mac OS X.

rei-vilo commented 12 years ago

According to Mass erase of MSP-EXP430FR5739,

/Applications/Energia.app/Contents/Resources/Java/hardware/tools/msp430/mspdebug/mspdebug rf2500 --force-reset prog /var/folders/95/qchnfz9d0854_3931bv30gt80000gn/T/build2744895414480989413.tmp/Blink.cpp.hex

prog should be replaced by load

/Applications/Energia.app/Contents/Resources/Java/hardware/tools/msp430/mspdebug/mspdebug rf2500 --force-reset load /var/folders/95/qchnfz9d0854_3931bv30gt80000gn/T/build2744895414480989413.tmp/Blink.cpp.hex

for the FraunchPad.

But it seems other issue may appear and mass erase was needed.

rei-vilo commented 12 years ago

After a while and uploading different sketches using the loadcommand, the following warning is raised:

MSPDebug version 0.19 - debugging tool for MSP430 MCUs Copyright (C) 2009-2012 Daniel Beer dlbeer@gmail.com This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Trying to open interface 1 on 002

Initializing FET... FET protocol version is 30328680 Configured for Spy-Bi-Wire Sending reset... fet: FET returned error code 4 (Could not find device (or device not supported)) warning: fet: reset failed Set Vcc: 3000 mV Device ID: 0x0381 Device: MSP430FR5739 Code memory starts at 0xc200 Number of breakpoints: 3 Writing 1956 bytes to c200... Writing 128 bytes to ff80... Done, 2084 bytes written

As it is a warning, it doesn't block the upload, that goes successfully.

RickKimball commented 12 years ago

Are you using a patched msp430-gcc that fixes the msp430fr5739 bsl corruption problem? I have been testing a version for linux and will be uploading it soon. It doesn't appear that windows or osx have fixed gcc's at this point.

rei-vilo commented 12 years ago

The msp430-gcc version I use comes from standard Energia.

robertinant commented 12 years ago

The error you see is luckily not the message of death. There is an issue with mspdebug or the OS X driver where the first time the reset does not go through. Oddly, if you don't unplug the board then successive attempts to program go through just fine. You can ignore it for now. With that said, Rick has a good point. The current version of mspgcc for mac does not have the patch for the "message of death". When this happens de board is dead. I will do a new build of mspgcc over the weekend and check it in.

rei-vilo commented 12 years ago

Thanks!

rei-vilo commented 12 years ago

Works fine, thanks.

I close the ticket.

pmm223 commented 12 years ago

I have this same issue on Mac OS X 10.8, but can't seem to get it to program, even with multiple writes, and using the rf2500 programmer option. Any thoughts?

rei-vilo commented 12 years ago

By default, Energia uses the following command, here in Mac OS X:

/Applications/Energia.app/Contents/Resources/Java/hardware/tools/msp430/mspdebug/mspdebug rf2500 --force-reset prog /var/build.tmp/DualBlink_430.cpp.hex

Upload seems to work better with load instead of prog, see http://forum.43oh.com/topic/815-msp430-support-for-430fr-fram-parts/#entry7296

/Applications/Energia.app/Contents/Resources/Java/hardware/tools/msp430/mspdebug/mspdebug rf2500 --force-reset load /var/build.tmp/DualBlink_430.cpp.hex

pmm223 commented 12 years ago

And how do I change it?

rei-vilo commented 12 years ago

Best way is to open a ticket.

robertinant commented 12 years ago

@pmm223. Are you using Energia from git? If so then update your repository (git pull). There have been several fixes re FRAM including mspdebug turning a prog into a load if it detects you are trying to program the FraunchPad.