{"id":2829,"date":"2022-10-24T18:32:05","date_gmt":"2022-10-24T16:32:05","guid":{"rendered":"https:\/\/www.final-memory.org\/?page_id=2829"},"modified":"2022-11-01T15:42:35","modified_gmt":"2022-11-01T13:42:35","slug":"wissenssammlung-stm32-bluepill","status":"publish","type":"page","link":"https:\/\/www.final-memory.org\/?page_id=2829","title":{"rendered":"Wissenssammlung STM32 BluePill"},"content":{"rendered":"<p>Hier sammel ich kleine Codeschnipsel und Kommandozeilen, die bei der Arbeit mit STM32 BluePill Boards unter Linux aufkamen.<\/p>\n<p>Ich benutze meist einen ST-Link V2 Clone.<\/p>\n<h3>Intel HEX mit ST-Link programmieren<\/h3>\n<p><code>st-flash --reset --format ihex write program.hex<\/code><\/p>\n<h3>CMake Toolchain in Visual Studio Code angeben<\/h3>\n<p>Leider funktioniert die Compiler Kit Auswahl nicht immer.<br \/>\nBei Problemen die Autodetektion ausw\u00e4hlen und in den settings.json des Projektes das Toolchainfile angeben:<br \/>\n<code>\"cmake.configureArgs\": [ \"-DCMAKE_TOOLCHAIN_FILE=\/home\/marndt\/Projects\/STM32_BluePill\/arm-cmake-toolchains\/arm-gcc-toolchain.cmake\" ],<\/code><\/p>\n<h3>launch.json f\u00fcr Visual Studio Code mit OpenOCD<\/h3>\n<p>Der .elf Name muss angepasst werden.<\/p>\n<p><code><br \/>\n\"configurations\": [<br \/>\n{<br \/>\n\"cwd\": \"${workspaceRoot}\",<br \/>\n\"executable\": \"${workspaceRoot}\/build\/mein-programm.elf\",<br \/>\n\"name\": \"Debug with OpenOCD\",<br \/>\n\"request\": \"launch\",<br \/>\n\"type\": \"cortex-debug\",<br \/>\n\"servertype\": \"openocd\",<br \/>\n\"configFiles\": [ \"interface\/stlink-v2.cfg\",\"target\/stm32f1x.cfg\"],<br \/>\n\"searchDir\": [],<br \/>\n\"runToEntryPoint\": \"main\",<br \/>\n\"preLaunchCommands\": [],<br \/>\n\"showDevDebugOutput\": \"none\",<br \/>\n\"svdFile\": \"STM32F103xx.svd\",<br \/>\n}<br \/>\n<\/code><\/p>\n<h3>.elf file mit OpenOCD hochladen und starten<\/h3>\n<p>Den .elf Namen entsprechend anpassen, das Binary startet und OpenOCD l\u00e4uft nicht weiter:<br \/>\n<code>openocd -f interface\/stlink-v2.cfg -f target\/stm32f1x.cfg -c \"program cortexm3-blinky.elf verify reset exit\"<\/code><\/p>\n<h3>Aktuellen arm-none-eabi-gdb aus Sourcen compilieren<\/h3>\n<ol>\n<li>gdb-x.y.z.tar.zx runterladen<\/li>\n<li>auspacken<\/li>\n<li>mit Buildverzeichnis erstellen\n<ol>\n<li>mkdir build-gdb<\/li>\n<li>cd build-gdb<\/li>\n<li>..\/$GDB\/configure &#8211;target=$TARGET &#8211;prefix=$PREFIX &#8211;enable-interwork &#8211;enable-multilib\u00a0 &#8212;&#8211;with-python<\/li>\n<li>make<\/li>\n<li>make install<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>Beim Bau ohne Buildverzeichnis passiert alles m\u00f6gliche, also im jungfr\u00e4ulich ausgepackten Verzeichnis arbeiten.<\/p>\n<p>Und das Bauen dauert seine Zeit. Ich musste noch die Pakete texinfo und libgmp-dev nachinstallieren.<\/p>\n<div id=\"facebook_like\"><iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.final-memory.org%2F%3Fpage_id%3D2829&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=segoe+ui&amp;colorscheme=light&amp;height=80\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:500px; height:80px;\" allowTransparency=\"true\"><\/iframe><\/div>","protected":false},"excerpt":{"rendered":"<p>Hier sammel ich kleine Codeschnipsel und Kommandozeilen, die bei der Arbeit mit STM32 BluePill Boards unter Linux aufkamen. Ich benutze meist einen ST-Link V2 Clone. Intel HEX mit ST-Link programmieren st-flash &#8211;reset &#8211;format ihex write program.hex CMake Toolchain in Visual Studio Code angeben Leider funktioniert die Compiler Kit Auswahl nicht immer. Bei Problemen die Autodetektion &hellip; <a href=\"https:\/\/www.final-memory.org\/?page_id=2829\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Wissenssammlung STM32 BluePill&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":79,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2829","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/pages\/2829","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2829"}],"version-history":[{"count":6,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/pages\/2829\/revisions"}],"predecessor-version":[{"id":2840,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/pages\/2829\/revisions\/2840"}],"up":[{"embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/pages\/79"}],"wp:attachment":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}