{"id":13629594,"url":"https://github.com/andysworkshop/stm32plus","last_synced_at":"2026-03-12T09:23:32.865Z","repository":{"id":7938251,"uuid":"9329533","full_name":"andysworkshop/stm32plus","owner":"andysworkshop","description":"The C++ library for the STM32 F0, F100, F103, F107 and F4 microcontrollers","archived":false,"fork":false,"pushed_at":"2021-03-16T20:41:18.000Z","size":21943,"stargazers_count":750,"open_issues_count":23,"forks_count":226,"subscribers_count":96,"default_branch":"master","last_synced_at":"2025-04-17T23:06:42.058Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.andybrown.me.uk","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andysworkshop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-09T19:18:49.000Z","updated_at":"2025-04-08T08:01:13.000Z","dependencies_parsed_at":"2022-08-06T20:15:22.528Z","dependency_job_id":null,"html_url":"https://github.com/andysworkshop/stm32plus","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/andysworkshop/stm32plus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andysworkshop%2Fstm32plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andysworkshop%2Fstm32plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andysworkshop%2Fstm32plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andysworkshop%2Fstm32plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andysworkshop","download_url":"https://codeload.github.com/andysworkshop/stm32plus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andysworkshop%2Fstm32plus/sbom","scorecard":{"id":195458,"data":{"date":"2025-08-11","repo":{"name":"github.com/andysworkshop/stm32plus","commit":"3cdec3bd63afc97855a577c783bdbcdea4a8083d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Code-Review","score":4,"reason":"Found 9/19 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Binary-Artifacts","score":0,"reason":"binaries present in source code","details":["Warn: binary detected: examples/usb_device_hid_custom_adc/hidreader/hidreader.exe:1","Warn: binary detected: utils/bm2rgbi/bm2rgbi/bin/Debug/bm2rgbi.exe:1","Warn: binary detected: utils/bm2rgbi/bm2rgbi/bin/Debug/bm2rgbi.vshost.exe:1","Warn: binary detected: utils/bm2rgbi/bm2rgbi/bin/Debug/lzg.exe:1","Warn: binary detected: utils/bm2rgbi/bm2rgbi/bin/Release/bm2rgbi.exe:1","Warn: binary detected: utils/bm2rgbi/bm2rgbi/bin/Release/lzg.exe:1","Warn: binary detected: utils/fonts/FontConv/bin/Debug/FontConv.exe:1","Warn: binary detected: utils/fonts/FontConv/bin/Debug/FontConv.vshost.exe:1","Warn: binary detected: utils/fonts/FontConv/bin/Release/FontConv.exe:1","Warn: binary detected: utils/fonts/LzgFontConv/bin/Debug/LzgFontConv.exe:1","Warn: binary detected: utils/fonts/LzgFontConv/bin/Debug/LzgFontConv.vshost.exe:1","Warn: binary detected: utils/fonts/LzgFontConv/bin/Release/LzgFontConv.exe:1","Warn: binary detected: utils/fonts/LzgFontConv/bin/Release/bm2rgbi.exe:1","Warn: binary detected: utils/fonts/LzgFontConv/bin/Release/lzg.exe:1","Warn: binary detected: utils/liblzg/liblzg-1.0.6/src/tools/benchmark.exe:1","Warn: binary detected: utils/liblzg/liblzg-1.0.6/src/tools/lzg.exe:1","Warn: binary detected: utils/liblzg/liblzg-1.0.6/src/tools/unlzg.exe:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":["Info: Possibly incomplete results: error parsing shell code: for statement must end with \"done\": examples/pframe/images/controls/bak/convert.sh:0"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T21:44:59.977Z","repository_id":7938251,"created_at":"2025-08-16T21:44:59.977Z","updated_at":"2025-08-16T21:44:59.977Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27786164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-17T02:00:08.291Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:01:14.457Z","updated_at":"2025-12-17T20:05:25.898Z","avatar_url":"https://github.com/andysworkshop.png","language":"C++","readme":"Introduction\n============\nFirstly, welcome to stm32plus, the C++ library that eases the burden of programming the STM32F030, F042, F051, F100, F103, F107 and F4 devices.\n\nThe main introduction and getting started guide can be found at [my website](http://www.andybrown.me.uk).\n\n### Travis CI build status\n\nA representative sample of the stm32plus configurations are configured to automatically build with the Travis CI system. The badge below shows the current state of the builds.\n\n[![Build Status](https://travis-ci.org/andysworkshop/stm32plus.svg?branch=master)](https://travis-ci.org/andysworkshop/stm32plus)\n\nHow to compile the library\n==========================\n\nBefore you can use the library you need to build it because, although much of the library is provided _header-only_ there is a substantial amount of compiled code that you must link to.\n\nPlease see the INSTALL.md file for detailed compilation instructions.\n\nReleases\n========\n\nAfter cloning this repo you are going to have a choice of what to build based on the branches and tags that have been created. Your options are:\n\n* Download a [release](https://github.com/andysworkshop/stm32plus/releases) and build from that. This is the safe option. Every now and then I will create a tag from the current master branch that represents a release. You can be sure that a release will be fully tested against all the supported MCUs.\n\n* Checkout the `master` branch (the default) and build from that. This is the quite-safe option. The `master` branch is guaranteed to build on all MCUs but the examples may not have been fully regression tested.\n\n* Checkout a named feature or bug-fix branch and build from that. This is the hardcore option. Feature branches  that have not been merged back into `master` represent work in progress and should build but may be incomplete and have bugs.     \n\nWhere are the examples?\n=======================\n\nIn the _examples_ subdirectory you will find dozens of examples nearly all of which will work without modification on the F0, F1 and F4 devices. The examples are heavily commented to help you understand what's going on.\n\nThe examples are configured to run out-of-the-box on the following MCUs:\n\n| Device | Flash | SRAM | CPU Clock | External Oscillator |\n|--------|-------|------|-----------|---------------------|\n| F40x | 1024Kb | 192Kb | 168Mhz | 8 MHz |\n| F103 HD | 512Kb | 64Kb | 72 MHz | 8 MHz |\n| F107 | 256Kb | 64Kb | 72 MHz | 25 MHz |\n| F100 MD VL | 128Kb | 8Kb | 24 MHz | 8 MHz |\n| F042 | 32Kb | 6Kb | 48 MHz | none (uses 8MHz internal) |\n| F051 | 64Kb | 8Kb | 48 MHz | none (uses 8MHz internal) |\n| F030 | 64Kb | 8Kb | 48 MHz | none (uses 8MHz internal) |\n\nIf your device is listed but your board has a different oscillator or core clock speed then you may need to adjust `System.c` in the `system` subdirectory\nof the example that you are looking at. If your memory configuration is different then you will need to adjust `Linker.ld` in the `system` subdirectory. \n\nDocumentation\n=============\n\nHTML documentation can be found in the doc/html subdirectory. This documentation is auto-generated by the [doxygen](http://www.doxygen.org/) tool from the comments in the source code.\n\nI freely admit that the documentation lags in both quantity and quality behind the code itself and it's a future task for me to improve it. In the meantime I hope that the heavily commented examples are enough to get you started.\n\nContributing\n============\n\nContributions to stm32plus are welcome. Please follow these steps to ensure a smooth workflow:\n\n* Clone the main stm32plus repo into your personal account and create a branch off `master` for your work. Give it a short meaningful name that allows people to get a good idea _at-a-glance_ of what you've done.\n\n* When you're happy with your code, first do a merge back from the current master to ensure you're still compatible and then send me a pull request. I will code-review the pull-request and when we're all happy I will accept it and do the merge back into `master`.\n\nWorking in Eclipse\n------------------\nI do all my development in Eclipse Kepler using the CDT and the [GNU ARM Eclipse plugin](http://gnuarmeclipse.livius.net/blog/). The `.project` and `.cproject` files for the main library and all the examples are included. You can use Eclipse's import option on the root checkout directory to bring them all into your workspace in one go. I recommend that you create a _working set_ to contain all the stm32plus projects because there's a lot of them.\n\nI have found that the recent updates to the plugin have been stable and non-breaking so you can probably just get the latest version. At the time of writing I am using version *1.10.2.201407190854* of the _Cross Compiler Support_ plugin.\n\nHow do I report a bug?\n======================\n\nIf you think that you've found a bug then please enter an issue against the project on github. It really helps if you can give me enough information to reproduce the bug myself.\n\nAlternatively you can fix it yourself and send me a pull-request.\n\nA short walk around the directories\n===================================\n\n`/INSTALL.md`: The installation guide. This file explains how to build the library. If you read nothing else, read this!\n\n`/SConstruct`: The top level scons build file, broadly equivalent to a Makefile for those that have not used scons before.\n\n`lib/`: The root directory containing the library source code.\n\n`lib/include`: The include files for the library. This directory and the parent stm32plus directory must be on the include path of any programs that you write. As of 2.0.0 the only include files that you need to know about are those in the `config` subdirectory. It should only ever be necessary to include `config/stm32plus.h` and one each for the peripherals that you want to use, for example `config/usart.h` or `config/spi.h`. These high level files take care of including everything else that they need.\n\n`lib/src`: The C++ source files that make up the library. Everything in here is considered internal.\n\n`lib/fwlib`: Source code to the ST Microelectronics standard peripheral libraries for the F0, F1 and F4 processors.\n\n`examples/`: The examples that demonstrate the features of the library. There is one subdirectory for each example. All the examples follow the same general format. There is the main example source code and a `system` subdirectory. The `system` subdirectory is the same for every example and contains the startup and initialisation code required for the F0, F1 and F4 MCUs. The `SConscript` file takes care of selecting the appropriate code for your target MCU. To build modified example, run `scons` again from the root directory. scons is smart enough to only build changed files and their dependents.\n\n`utils/bm2rgbi`: This PC utility is for converting graphics files (jpeg, png, gif etc.) into an internal format suitable for efficient transfer to a TFT. It also supports compression using the LZG format that results in files roughly the same size as a PNG. You'll need this utility if you decide to use the bitmap functions in the graphics library.\n\n`utils/FontConv`: This PC utility is for converting TrueType bitmap fonts such as those you can download for free from www.dafont.com into font files suitable for compiling and using with the stm32plus text output graphics library functions.\n\n`utils/LzgFontConv`: This PC utility is for converting TrueType vector anti-aliased fonts into compressed graphical representations suitable for compiling and using with the stm32plus bitmap text output graphics library functions.\n\nA quick guide to flashing using OpenOCD\n=======================================\n\nAt the time of writing the lastest version of openocd is 0.8.0 and it contains full support for the STM32 connected via JTAG and also via ST-Link (e.g. the STM32F4DISCOVERY  and STM32VLDISCOVERY boards). The following guide assumes that you are using either Linux or Windows with a Unix-like shell (cygwin or mingw) and that you have built the binaries.\n\nFlashing the stm32f4discovery board\n-----------------------------------\n\n`cd` into the openocd directory and run it with the flags required for the discovery board. For me on Windows 7 x64/cygwin this is:\n\n\t$ bin-x64/openocd-x64-0.8.0.exe -f scripts/board/stm32f4discovery.cfg\n\tOpen On-Chip Debugger 0.8.0 (2012-10-07-10:39)\n\tLicensed under GNU GPL v2\n\tFor bug reports, read\n\thttp://openocd.sourceforge.net/doc/doxygen/bugs.html\n\tadapter speed: 1000 kHz\n\tsrst_only separate srst_nogate srst_open_drain\n\tInfo : clock speed 1000 kHz\n\tlibusbx: info [cache_config_descriptors] could not access\n\tconfiguration descriptor (dummy) for\n\t'\\\\.\\USB#VID_0424\u0026PID_2504#6\u0026247B17EE\u00260\u00261':\n\t[31] A device attached to the system is not functioning.\n\tlibusbx: info [cache_config_descriptors] could not access\n\tconfiguration\n\tdescriptor (dummy) for\n\t'\\\\.\\USB#VID_1A40\u0026PID_0101#5\u0026476FB6F\u00260\u00264':\n\t[31] A device attached to the system is not functioning.\n\tInfo : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints\n\nopenocd is now up and running waiting for you to do something. Don't worry about the libusb 'errors', they are harmless.\n\nNow telnet to openocd and flash your hex image:\n\n\t$ telnet localhost 4444\n\tTrying 127.0.0.1...\n\tConnected to localhost.\n\tEscape character is '^]'.\n\tOpen On-Chip Debugger\n\nReset the device and halt it:\n\n\t\u003e reset init\n\ttarget state: halted\n\ttarget halted due to debug-request, current mode: Thread \n\txPSR: 0x01000000 pc: 0x08000b9c msp: 0x20020000\n\nFlash your hex image:\n\n\t\u003e flash write_image erase p:/button.hex\n\tauto erase enabled\n\ttarget state: halted\n\ttarget halted due to breakpoint, current mode: Thread \n\txPSR: 0x61000000 pc: 0x20000042 msp: 0x20020000\n\twrote 16384 bytes from file p:/button.hex in 1.147065s (13.949 KiB/s)\n\nReset the device to run the program:\n\n\t\u003e reset\n\nFlashing an F1 board using JTAG\n-------------------------------\n\nThe procedure is much the same as the F4. We will start openocd and then use a telnet connection to flash the image. First start openocd. I can't give you the exact startup command for openocd because it will vary according to the JTAG dongle that you have purchased. I use the Olimex ARM-USB-TINY-H device that has an OpenOCD configuration file dedicated to it. Here's what openocd reports when I start it up:\n\n\tOpen On-Chip Debugger 0.5.0-dev-00852-gf9feeac-dirty (2011-07-27-21:58)\n\tLicensed under GNU GPL v2\n\tFor bug reports, read\n\t   http://openocd.berlios.de/doc/doxygen/bugs.html\n\tInfo : only one transport option; autoselect 'jtag'\n\t1000 kHz\n\tadapter_nsrst_delay: 100\n\tjtag_ntrst_delay: 100\n\tcortex_m3 reset_config sysresetreq\n\tInfo : device: 6 \"2232H\"\n\tInfo : deviceID: 364511274\n\tInfo : SerialNumber: OLTMERU�A\n\tInfo : Description: Olimex OpenOCD JTAG ARM-USB-TINY-H A\n\tInfo : max TCK change to: 30000 kHz \n\tInfo : clock speed 1000 kHz\n\tInfo : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)\n\tInfo : JTAG tap: stm32.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)\n\tInfo : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints\n\nNow we can telnet to openocd:\n\n\t$ telnet localhost 4444\n\tTrying 127.0.0.1...\n\tConnected to localhost.\n\tEscape character is '^]'.\n\tOpen On-Chip Debugger\n\nAnd now we can reset the device\n \n\t\u003e reset init\n\tJTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)\n\tJTAG tap: stm32.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)\n\ttarget state: halted\n\ttarget halted due to debug-request, current mode: Thread \n\txPSR: 0x01000000 pc: 0x08000a84 msp: 0x2000fffc\n\nFlash the program hex image to the board:\n\n\t\u003e flash write_image erase /tmp/pframe.hex\n\tauto erase enabled\n\tdevice id = 0x10036414\n\tflash size = 512kbytes\n\tPadding image section 0 with 4 bytes\n\nReset the MCU to start the program:\n\n\t\u003e reset\n\tJTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)\n\tJTAG tap: stm32.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)\n\nFlashing the stm32vldiscovery board\n-----------------------------------\n\nWindows users need to ensure that they can connect to the ST-Link V1 debugger on the VL discovery board using OpenOCD. If the instructions below fail then you probably need to replace the default mass storage USB drivers with the WinUSB or libusb drivers using the [zadig](https://sourceforge.net/projects/libwdi/files/zadig) utility.\n\n`cd` into the openocd directory and run it with the flags required for the discovery board. For me on Windows 7 x64/cygwin this is:\n\n\t$ bin-x64/openocd-x64-0.8.0.exe -f scripts/board/stm32vldiscovery.cfg \n\tOpen On-Chip Debugger 0.8.0 (2012-10-07-10:39)\n\tLicensed under GNU GPL v2\n\tFor bug reports, read\n\t        http://openocd.sourceforge.net/doc/doxygen/bugs.html\n\tadapter speed: 1000 kHz\n\tInfo : clock speed 1000 kHz\n\tlibusbx: info [cache_config_descriptors] could not access configuration descriptor (dummy) for '\\\\.\\USB#VID_0424\u0026PID_2504#6\u00263734C893\u00260\u00261': [31] A device attached to the system is not functioning.\n\tInfo : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints\n\nopenocd is now up and running waiting for you to do something. Don't worry about the libusb 'errors', they are harmless.\n\nNow telnet to openocd and flash your hex image:\n\n\t$ telnet localhost 4444\n\tTrying 127.0.0.1...\n\tConnected to localhost.\n\tEscape character is '^]'.\n\tOpen On-Chip Debugger\n\nReset the device and halt it:\n\n\t\u003e reset init\n\ttarget state: halted\n\ttarget halted due to debug-request, current mode: Thread \n\txPSR: 0x01000000 pc: 0x08000b84 msp: 0x20002000\n\nFlash your hex image:\n\n\t\u003e flash write_image erase p:/blink.hex\n\tauto erase enabled\n\tdevice id = 0x10016420\n\tflash size = 128kbytes\n\ttarget state: halted\n\ttarget halted due to breakpoint, current mode: Thread \n\txPSR: 0x61000000 pc: 0x2000003a msp: 0x20002000\n\twrote 3072 bytes from file p:/blink.hex in 0.653037s (4.594 KiB/s)\n\nReset the device to run the program:\n\n\t\u003e reset\n\nFlashing the stm32f0discovery board\n--\nThis is one of the more recent _discovery_ boards from ST and as such it comes equipped with version 2 of the ST-Link debugger on board. Using it with OpenOCD is a very similar procedure to the F4.\n\n`cd` into the openocd directory and run it with the flags required for the discovery board. For me on Windows 7 x64/cygwin this is:\n\n\t$ bin-x64/openocd-x64-0.8.0.exe -f scripts/board/stm32f0discovery.cfg\n\tOpen On-Chip Debugger 0.8.0 (2013-05-05-10:44)\n\tLicensed under GNU GPL v2\n\tFor bug reports, read\n\t        http://openocd.sourceforge.net/doc/doxygen/bugs.html\n\tsrst_only separate srst_nogate srst_open_drain connect_deassert_srst\n\tInfo : This adapter doesn't support configurable speed\n\tInfo : STLINK v2 JTAG v14 API v2 SWIM v0 VID 0x0483 PID 0x3748\n\tInfo : Target voltage: 2.886506\n\tInfo : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints\n\nopenocd is now up and running waiting for you to do something.\n\nNow telnet to openocd and flash your hex image:\n\n\t$ telnet localhost 4444\n\tTrying 127.0.0.1...\n\tConnected to localhost.\n\tEscape character is '^]'.\n\tOpen On-Chip Debugger\n\nReset the device and halt it:\n\n\t\u003e reset init\n\ttarget state: halted\n\ttarget halted due to debug-request, current mode: Thread \n\txPSR: 0xc1000000 pc: 0x080009b8 msp: 0x20002000\n\nFlash your hex image:\n\n\t\u003e flash write_image erase p:/blink.hex\n\tauto erase enabled\n\tdevice id = 0x20006440\n\tflash size = 64kbytes\n\twrote 2048 bytes from file p:/blink.hex in 0.423024s (4.728 KiB/s)\n\nReset the device to run the program:\n\n\t\u003e reset\n\nThat's all, I hope my experience with OpenOCD can help you get started.\n","funding_links":[],"categories":["C++","HardwareBoard","工具、材料"],"sub_categories":["软件：嵌入式操作系统、驱动、GUI 库等"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandysworkshop%2Fstm32plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandysworkshop%2Fstm32plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandysworkshop%2Fstm32plus/lists"}