2017-08-10 117 views
0

我使用優秀的http://platformio.org/與Visual Studio Code一起爲Teensy 3.6(Arduino兼容板)開發。Platform.io通過SWD(J-LINK)上傳到Teensy 3.6

This works great。但我想通過SWD(串行線調試)做更好的調試。 因此,我斷開了與Arduino兼容的USB芯片,並通過SWD和JLINK進行連接。與此類似:https://mcuoneclipse.com/2017/04/29/modifying-the-teensy-3-5-and-3-6-for-arm-swd-debugging/

我可以通過使用「J-Link Lite」軟件通過platformio構建的固件進行閃存。另外,我也可以運行J-Link GDB服務器。 但我無法讓IDE集成工作。

platformio.ini看起來是這樣的:

[env:teensy36] 
platform = teensy 
board = teensy36 
framework = arduino 
upload_protocol = jlink 
debug_tool = jlink 

仍然upload_protocol被忽略,當我通過IDE調用上傳(platformio.exe run --target upload)我得到的是

Linking .pioenvs\teensy36\firmware.elf 
Checking program size 
text  data  bss  dec  hex filename 
17348  172 2696 20216 4ef8 .pioenvs\teensy36\firmware.elf 
Building .pioenvs\teensy36\firmware.hex 
Uploading .pioenvs\teensy36\firmware.hex 
Teensy Loader, Command Line, Version 2.1 
Read ".pioenvs\teensy36\firmware.hex": 17520 bytes, 1.7% usage 
Soft reboot is not implemented for Win32 
Waiting for Teensy device... 
(hint: press the reset button) 

所以它仍然試圖上傳通過Arduino兼容USB連接,而不是通過SWD連接。我如何才能讓platformio更改上傳方法或upload_protocol?

回答

1

Project Configuration File platformio.ini,它提供瞭如何配置JLINK GDB服務器的示例:

[env:bluepill_f103c8] 
... 
; Debug options 
debug_tool = custom 
debug_server = 
    JLinkGDBServer 
    -singlerun 
    -if 
    SWD 
    -select 
    USB 
    -port 
    2331 
    -device 
    STM32F103C8 

如果路徑不包括JLinkGDBServer.exe,那麼你需要指定JLinkGDBServer.exe的完整文件名。

我試過這個,它的工作原理。

還有另一個使用JlinkGDBServerCL.exe的例子 - J-Link and ST Nucleo

+0

感謝您的回覆!我獨立發現了自定義配置。但是我遇到了一些錯誤。幸運的是平臺支持非常好。我通過電子郵件和團隊查看器與平臺團隊一起度過了許多小時,以便讓SWD參與此板。當這個問題最終得到解決後,我會發佈一個單獨的答案,並且我肯定修正將會到達平臺主分支。 – user643011