Giter Site home page Giter Site logo

erwango / openocd-stm32 Goto Github PK

View Code? Open in Web Editor NEW
15.0 6.0 2.0 12.31 MB

Some scripts to flash and debug stm32 boards

License: GNU General Public License v2.0

Makefile 1.08% Shell 0.10% M4 0.56% Perl 0.05% C 88.36% C++ 0.73% Assembly 2.53% Python 0.65% Haskell 0.03% Tcl 2.31% SourcePawn 0.54% GDB 0.06% HTML 3.01%

openocd-stm32's Introduction

openocd for STM32

This repository proposes some scripts on top of openocd to flash and debug seamlessly official STM32 development board (Nucleo, Discovery and Eval series)

Prerequistites

  • Functional gdb

Quick install and use

Install opencod

  • $ ./bootstrap
  • $ ./configure --enable-maintainer-mode --enable-stlink
  • $ make

Load scripts

  • Update setlocal.sh script with your local path to arm gdb, then source local script
  • $ source setlocal.sh

Flash your board

  • Plug your STM32 board to any available USB port
  • For a STM32 L4 board (eg: nucleo_l476rg)
  • $ stm32_flsh l4 binary.bin

Debug

  • For a STM32 L4 board (eg: nucleo_l476rg)
  • $ stm32_dbg l4 binary.elf

Commands

For ease of use, following command could be defined in a local .gdbinit

  • define
  • rst monitor reset halt
  • end

About

Supported STM32 families

This version support following families:

  • F1, F2, F3, F4, L0, L1, L4

openocd

Current openocd version is 0.10.0. Check README for more information

Credits

Thanks to @jamike for his initial work and support

openocd-stm32's People

Contributors

afaerber avatar borneoa avatar broadcom-wiced-admin avatar dac922 avatar dinomight avatar drasko avatar fjullien avatar frantony avatar freddiechopin avatar hsiangkai avatar jaouen avatar karlp avatar marex avatar mike-dunn avatar nattgris avatar ndreys avatar nemuisan avatar npitre avatar ntfreak avatar oharboe avatar olerem avatar paulfertser avatar plagnioj avatar rlrosa avatar sysgo-maw avatar thinkfat avatar tom-van avatar uwebonnes avatar uwehermann avatar yurovsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

fabo jamike

openocd-stm32's Issues

Unable to open USB STLink v2-1 on OS X

I'm trying to program a Nucleo STM32L432KCU6.

I've verified the STLink v2.1 appears properly on OS X:
STM32 STLink:
Product ID: 0x374b
Vendor ID: 0x0483 (STMicroelectronics)

I've also updated my STlink v2.1 to the latest firmware:
http://www.st.com/en/embedded-software/stsw-link007.html
v2.28.18

And I see that the tcl config clearly addresses those Product and Vendor IDs.

Running openocd in debug level 3 mode:
openocd -s ~/zephyr/openocd-stm32/tcl/ -f stm32l4.cfg -c "stm_flash outdir/nucleo_l432kc/zephyr.bin " -d 3

We can clearly see that the proper TCL files have been loaded and vid/pid are being properly sought out.. however, we still end up with an error on open.

Debug: 267 6 hla_layout.c:40 hl_layout_open(): hl_layout_open
Debug: 268 6 stlink_usb.c:1642 stlink_usb_open(): stlink_usb_open
Debug: 269 6 stlink_usb.c:1659 stlink_usb_open(): transport: 1 **vid: 0x0483 pid: 0x374b serial:** 
Error: 270 49 stlink_usb.c:1672 stlink_usb_open(): **open failed**
Debug: 271 49 hla_layout.c:47 hl_layout_open(): failed
Debug: 272 49 command.c:626 run_command(): Command failed with error code -4
User : 273 49 command.c:687 command_run_line(): in procedure 'init' called at file "/Users/developer/openocd-stm32/tcl//stm32l4.cfg", line 2

Has there been any known issue where OS X is prohibiting any USB Port opens?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.