Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot upload to mzeropro with using stable or development version #805

Closed
fjammes opened this issue Oct 14, 2016 · 8 comments
Closed

Cannot upload to mzeropro with using stable or development version #805

fjammes opened this issue Oct 14, 2016 · 8 comments
Assignees
Labels
Milestone

Comments

@fjammes
Copy link

fjammes commented Oct 14, 2016

Configuration

Operating system:

Debian jessie

PlatformIO Version (platformio --version):

PlatformIO, version 3.2.0a7 (but occurs also with current stable version)

Description of problem

Can not upload to mzeropro because of minor openocd error:

Uploading .pioenvs/mzeropro/firmware.bin
Open On-Chip Debugger 0.9.0-gd4b7679 (2014-10-03-00:26)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
/home/lora/.platformio/packages/tool-openocd/bin/openocd.bin: option requires an argument -- 'c'
Info : only one transport option; autoselect 'swd'
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 01.1F.0118
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD IDCODE 0x0bc11477
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints

Steps to Reproduce

git clone [email protected]:fjammes/braise.git
cd braise/gps_bme_send
platformio init --board mzeropro
# Command below is broken
platformio run -t upload

Actual Results

Script waits without doing nothing.

Expected Results

Upload code to mzeropro

Additional info

Changing openocd '-c' with '--command=' option works fine, as shown below:

~/.platformio/packages/tool-openocd/bin/openocd  -f /home/lora/.platformio/packages/framework-arduinosam/variants/arduino_zero_org/openocd_scripts/arduino_zero_org.cfg -s /home/lora/.platformio/packages/tool-openocd/share/openocd/scripts -s /home/lora/.platformio/packages/tool-openocd/share/openocd/scripts/board -s /home/lora/.platformio/packages/framework-arduinosam/variants/arduino_zero_org/openocd_scripts --command="telnet_port disabled; program {{.pioenvs/mzeropro/firmware.bin}} verify reset 0x4000; shutdown"
# Command stdout:
Open On-Chip Debugger 0.9.0-gd4b7679 (2014-10-03-00:26)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 01.1F.0118
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD IDCODE 0x0bc11477
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x000028f4 msp: 0x20002c00
** Programming Started **
auto erase enabled
Info : SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM)
wrote 49152 bytes from file .pioenvs/mzeropro/firmware.bin in 6.412093s (7.486 KiB/s)
** Programming Finished **
** Verify Started **
verified 48948 bytes in 3.957394s (12.079 KiB/s)
** Verified OK **
** Resetting Target **
shutdown command invoked
@ivankravets
Copy link
Member

@valeros I have the same issue. Could you help us?

@fjammes Please use mzeroproUSB board and USB port instead. It works.

@fjammes
Copy link
Author

fjammes commented Oct 17, 2016

Thanks, I can indeed use mzeroproUSB to upload binaries, but then platformio device monitor -p /dev/ttyACM0 does not print any output message.

@fjammes
Copy link
Author

fjammes commented Oct 17, 2016

I would need to use SerialUSB.print(...) in my code, but some third-parties use Serial.print(), so it seems I'm stick with programming port. Coudl you please fix this bug?

@ivankravets
Copy link
Member

Could you try one fix? Please go to ~/.platformio/packages/tool-openocd/bin/ and edit openocd wrapper. Replace

LD_LIBRARY_PATH="$MYAPP_HOME/lib" "$0.bin" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"

with

LD_LIBRARY_PATH="$MYAPP_HOME/lib" "$0.bin" "$@"

Does it work now?

@ivankravets ivankravets added this to the 3.2.0 milestone Oct 26, 2016
@ivankravets ivankravets self-assigned this Oct 26, 2016
@ivankravets
Copy link
Member

@fjammes do you have any news?

@ivankravets
Copy link
Member

Just run pio update where tool-openocd should be updated.

/cc @fraimondo @fjammes

@fraimondo
Copy link

What was problem/solution then?

@ivankravets
Copy link
Member

@fraimondo see #805 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants