Giter VIP home page Giter VIP logo

blue-pill-quickstart's People

Contributors

aurelj avatar texitoi avatar tim-seoss avatar timbod7 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

blue-pill-quickstart's Issues

README instructions may not produce a working OpenOCD setup

My *buntu setup already had a copy of OpenOCD installed in /usr/local, so following the instructions produced this error:

Open On-Chip Debugger 0.10.0+dev-00403-g3737dd69e738 (2018-04-20-22:55)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
embedded:startup.tcl:60: Error: Can't find openocd.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 60
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: Debug Adapter has to be specified, see "interface" command
embedded:startup.tcl:60: Error: 
in procedure 'script' 
at file "embedded:startup.tcl", line 60

The solution was to run this instead:

openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/local/share/openocd/scripts/target/stm32f1x.cfg

It might be a good idea to acknowledge that possibility.

tlink.x build error

I get the error below when trying run on ubuntu. I'm not familiar enough with rust yet but it looks like "-Tlink.x" is being used as a command line argument twice for rust-lld. Commenting out the rustflags line in .cargo/config fixes this for me.

   Compiling blue-pill-quickstart v0.1.0 (/home/zlewko/src/my-new-project/blue-pill-quickstart)                                                 
error: linking with `rust-lld` failed: exit code: 1                                                                                             
  |                                                                                                                                             
  = note: "rust-lld" "-flavor" "gnu" "-L" "/home/zlewko/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.10l9keozr1azjxxb.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.1nnvqjw29kudhvn3.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.1qdwekv9om07jq89.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.1wqxsabd0q7gamlh.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.2ckemoq0z4sbznl9.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.2d3ro4mimji4gjot.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.2jvvr9y25t17tqu8.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.2ktiphgdj33f5dhp.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.2odvisrdwlwbncgw.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.2zau10m7ucn44pn4.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.3o97obryy241fwbl.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.4hlo6wom1hmssrw3.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.4l7jjzmb1yy8yvxp.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.5722xo7rjzr5sw89.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.5ebqcj5vu1lkcjus.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.64rwavbiml2ui7g.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.aigwtnjqxough0l.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.izjotxgugmodeed.rcgu.o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc.onapcjauee2gk5n.rcgu.o" "-o" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/blue_pill_quickstart-3ab8b685c888f3cc" "--gc-sections" "-L" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps" "-L" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/debug/deps" "-L" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/build/cortex-m-9345be4a269acadb/out" "-L" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/build/cortex-m-rt-2b43955fa98b4ad0/out" "-L" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/build/cortex-m-semihosting-ab07e1b57173a6a5/out" "-L" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/build/stm32f103xx-hal-16832c351c2938ac/out" "-L" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/build/stm32f103xx-d3deb763bb715481/out" "-L" "/home/zlewko/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib" "-Bstatic" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libstm32f103xx_hal-75db98507f0321f8.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libcast-a5321062713d01a4.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libstm32f103xx-09e4d9d1fdff3e8e.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libembedded_hal-aad34f8d9c33ffcf.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libvoid-c89b4d8d5f4ffed8.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libnb-115008accecdccaa.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libcortex_m_rt-4d3998b9322d76f6.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libr0-d9b5ebe20b659dec.rlib" "--start-group" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libpanic_semihosting-48bd918cb6b7e64c.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libcortex_m_semihosting-619a349c9ad4ce86.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libcortex_m-3fdd2f688076ed68.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libvolatile_register-237e033e63048848.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libvcell-617ada1d0d900745.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libbare_metal-d9e85f06fcdd0262.rlib" "/home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/deps/libaligned-24e16d16f1d52771.rlib" "/home/zlewko/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib/libcore-bc99d396b91fe14a.rlib" "--end-group" "/home/zlewko/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib/libcompiler_builtins-4b33c00e5bd54fa2.rlib" "-Tlink.x" "-Tlink.x" "-Bdynamic"
  = note: rust-lld: error: /home/zlewko/src/my-new-project/blue-pill-quickstart/target/thumbv7m-none-eabi/debug/build/stm32f103xx-hal-16832c351c2938ac/out/memory.x:4: region 'FLASH' already defined
          >>>   FLASH : ORIGIN = 0x08000000, LENGTH = 64K                                                                                       
          >>>                                         ^                                                                                         
                                                                                                                                                
                                                                                                                                                
error: aborting due to previous error                                                                                                           
                                                                                                                                                
error: Could not compile `blue-pill-quickstart`.

Blue pills with clone CPUs

Hello and thank you!

It turns out that recent blue pills sometimes (always?) have a clone of the stm32 so the corresponding openocd config file needs to be updated as described here: https://www.eevblog.com/forum/beginners/unexpected-idcode-flashing-bluepill-clone/

In case that link breaks, the error printed by openocd is:

Info : using stlink api v2
Info : Target voltage: 3.140492
Warn : UNEXPECTED idcode: 0x2ba01477
Error: expected 1 of 1: 0x1ba01477
in procedure 'init' 
in procedure 'ocd_bouncer'

The fix is to update the ID in the stm config file to match the clone:

curl https://raw.githubusercontent.com/arduino/OpenOCD/master/tcl/target/stm32f1x.cfg > clone.cfg
sed -i 's/0x1ba01477/0x2ba01477/g' clone.cfg
openocd -f interface/stlink-v2.cfg -f clone.cfg

Can this be fixed by making a PR against openocd with the new config file? Would it be better to keep the config file for the one true original chip and document the possible modifications here? Perhaps this issue suffices to document this.

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.