【问题标题】:Platform.io upload to Teensy 3.6 via SWD (J-LINK)Platform.io 通过 SWD (J-LINK) 上传到 Teensy 3.6
【发布时间】:2018-01-18 15:08:42
【问题描述】:

我正在使用优秀的http://platformio.org/ 和 Visual Studio Code 为 Teensy 3.6(Arduino 兼容板)进行开发。

这很好用。但我想通过 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?

【问题讨论】:

    标签: arduino teensy platformio swd


    【解决方案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 不包含在 PATH 中,则需要指定 JLinkGDBServer.exe 的完整文件名。

    我试过了,效果很好。

    还有另一个使用 JlinkGDBServerCL.exe 的示例 - J-Link and ST Nucleo

    【讨论】:

    • 感谢您的回复!我独立发现了自定义配置。但是我遇到了几个错误。幸运的是,platformio 支持非常好。我花了很多时间与 platformio 团队通过电子邮件和 teamviewer 让这个板与 SWD 一起使用。当这个问题最终解决后,我将发布一个单独的答案,并且我很肯定修复将到达 platformio 主分支。
    猜你喜欢
    • 2020-02-25
    • 2017-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-08
    • 2020-07-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多