platformio / platform-nordicnrf51

Nordic nRF51: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/nordicnrf51
Apache License 2.0
20 stars 25 forks source link

waveshare_ble400: added stlink programmer #19

Closed danielkucera closed 6 years ago

danielkucera commented 6 years ago

example output:

GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00114-g8419536 (2017-04-18-22:28)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.249304
Info : nrf51.cpu: hardware has 4 breakpoints, 2 watchpoints

target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x000006d0 msp: 0x000007c0
** Programming Started **
auto erase enabled
Warn : Unknown device (HWID 0x000000d1)
Info : Padding image section 0 with 2112 bytes
Info : Padding image section 1 with 5864 bytes
Warn : using fast async flash loader. This is currently supported
Warn : only with ST-Link and CMSIS-DAP. If you have issues, add
Warn : "set WORKAREASIZE 0" before sourcing nrf51.cfg to disable it
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000001e msp: 0x000007c0
wrote 129024 bytes from file .pioenvs/waveshare_ble400/firmware.hex in 5.985116s (21.052 KiB/s)
** Programming Finished **
** Verify Started **
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x000007c0
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x000007c0
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x000007c0
verified 120668 bytes in 0.810280s (145.431 KiB/s)
** Verified OK **
** Resetting Target **
shutdown command invoked
=========================================
ivankravets commented 6 years ago

Thanks! Resolved in https://github.com/platformio/platform-nordicnrf51/commit/d95b50fba0305b5e7aae234c052e00369668947c

Please re-test with

[env:xxx]
platform = https://github.com/platformio/platform-nordicnrf51.git
board = waveshare_ble400
framework = mbed
upload_protocol = stlink
debug_tool = stlink
danielkucera commented 6 years ago

Hi, it doesn't work, I need to load stlink-v2.


GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00114-g8419536 (2017-04-18-22:28)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
embedded:startup.tcl:60: Error: Can't find scripts/interface/stlink.cfg
in procedure 'script'
at file "embedded:startup.tcl", line 60
*** [upload] Error 1```
ivankravets commented 6 years ago

Please run pio update

danielkucera commented 6 years ago

Thanks! Now it works. Is it possible to make the debug work also? Now it's showing: screenshot from 2018-01-24 23-00-08

danielkucera commented 6 years ago

Sorry to bother you, it works with debug_tool = stlink

ivankravets commented 6 years ago

yes, that is a correct behaviour. Default debug tool is J-Link but you can change to other. We are working on this new feature and you will see all debug tools and upload protocols in build process log soon.