{"id":19296773,"url":"https://github.com/fcayci/stm32f4-bare-metal","last_synced_at":"2026-01-21T13:37:32.426Z","repository":{"id":50233233,"uuid":"166012891","full_name":"fcayci/stm32f4-bare-metal","owner":"fcayci","description":"Bare metal STM32F4 examples for various modules","archived":false,"fork":false,"pushed_at":"2021-05-02T12:11:18.000Z","size":449,"stargazers_count":126,"open_issues_count":0,"forks_count":49,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-09T23:02:18.511Z","etag":null,"topics":["arm","bare-metal","cortex-m4","stm32f4","stm32f4-discovery"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fcayci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-16T09:33:26.000Z","updated_at":"2024-10-30T19:20:58.000Z","dependencies_parsed_at":"2022-09-03T23:10:17.127Z","dependency_job_id":null,"html_url":"https://github.com/fcayci/stm32f4-bare-metal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcayci%2Fstm32f4-bare-metal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcayci%2Fstm32f4-bare-metal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcayci%2Fstm32f4-bare-metal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcayci%2Fstm32f4-bare-metal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fcayci","download_url":"https://codeload.github.com/fcayci/stm32f4-bare-metal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250206120,"owners_count":21392189,"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","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":["arm","bare-metal","cortex-m4","stm32f4","stm32f4-discovery"],"created_at":"2024-11-09T23:00:32.293Z","updated_at":"2026-01-21T13:37:32.414Z","avatar_url":"https://github.com/fcayci.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# stm32f4-bare-metal\n\nBare metal STM32F4 examples to serve as starting points for projects. Educational purposes.\n\nSome of the STM32F4xx family based processor headers are added in the `include` folder to get register locations. CMSIS library is added for a general support. No extra HAL libraries is used except the selected projects described below.\n\nCommon startup functions are located in the `include/startup_stm32f407vgtx.s` and `include/system_stm32f4xx.c` files to be included in all projects.\n\n## Installation\n\nFirst, clone the project using `git clone --recurse-submodules https://github.com/fcayci/stm32f4-bare-metal`. The repository includes other repositories such as `CMSIS` as submodules under `lib` folder. You can alternatively clone the repository, then initialize and update the submodules with `git submodule init` and `git submodule update` commands.\n\n## Development\n\nThere are two options for development. First one is to use [STM32CubeIDE](https://www.st.com/en/development-tools/stm32cubeide.html) from ST. Second one is the setup your own development environment. Both options are supported with relevant project settings or makefiles.\n\n### Option 1 - STM32CubeIDE\n\n- Download and install [STM32CubeIDE](https://www.st.com/en/development-tools/stm32cubeide.html). Select workspace on the root folder, then import existing projects to workspace. (File -\u003e Import -\u003e General -\u003e Existing Projects into Workspace)\n- You do not need any additional tools. It comes with the compiler and debugger pre-installed.\n- Rest of the sections are for Option 2.\n\n### Option 2 - Custom development environment\n\n- Get **toolchain** (for compiler and binutils) from [GNU Arm Embedded Toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads)\n- *For windows only*, install **make** tool. You can just get the make tool from [gnuwin32](http://gnuwin32.sourceforge.net/packages/make.htm). Alternatively you can install the minimalist GNU tools for windows from [mingw](https://mingw-w64.org/) and [MSYS](https://www.msys2.org/)\n- For the **programmer/debugger**, you can use - [stlink](https://github.com/texane/stlink) or [OpenOCD](http://openocd.org/). Though only stlink utility support is added.\n- You can use your favorite code editor to view/edit the contents. Here is an open source one: [Visual Studio Code](https://code.visualstudio.com/).\n\n#### Compile\n\n[makefile](projects/armf4.mk) contains necessary build scripts and compiler flags for all projects. Individual settings can be changed from local makefiles from projects such as [blinky makefile](projects/blinky/makefile)\n\nBrowse into any directory and run `make` to compile.\n\n```\ncd projects/blinky\nmake\n```\n\nIf everything is setup correctly, you should see the completed message.\n```\nCleaning blinky\nBuilding blinky.c\n   text    data     bss     dec     hex filename\n    852\t      8\t   1568\t   2428\t    97c\tblinky.elf\nSuccessfully finished...\n```\n\nIf you see any errors about command not found, make sure the toolchain binaries are in your `PATH`. On Windows check the *Environment Variables* for your account. On Linux/macOS run `echo $PATH` to verify your installation.\n\n#### Program\n\nRun `make burn` to program the chip.\n```\n...\n.. Flash written and verified! jolly good!\n```\n\nInstall the [ST LINK](https://www.st.com/en/development-tools/st-link-v2.html) drivers if you cannot see your board when `make burn` is run.\n\n#### Disassemble\n\nRun `make disass` / `make disass-all` to disassamble.\n\n#### Debug\n\nIn order to debug your code, connect your board to the PC, run `st-util` (comes with stlink utility) from one terminal, and from another terminal within the project directory run `make debug`. You can then use general **gdb** commands to browse through the code.\n\n## Projects\n\n* [blinky](projects/blinky/) - Good old blink LEDs example\n* [clock](projects/clock/) - Shows how to change clock frequencies on the fly\n* [math](projects/math/) - A simple sine function to test math library operation\n* [systick](projects/systick/) - Blinks LEDs using systick timer.\n* [timer](projects/timer/) - Blinks LEDs one at a time using the Timer module and Timer interrupt\n* [pwm](projects/pwm/) - Fades an LED using pwm functionality using Timer module\n* [external](projects/external/) - External interrupt example using the on-board push-button\n* [dac](projects/dac/) - On-chip digital to analog converter operation\n* [dac-timer](projects/dac-timer/) - On-chip digital to analog converter operation with timer trigger\n* [uart](projects/uart/) - UART example to show how to send data over\n* [uart-tx-int](projects/uart-tx-int/) - UART example with tx interrupt\n* [uart-dma](projects/uart-dma/) - UART tx example with DMA transfer\n* [spi](projects/spi/) - SPI example that is customized for on-board motion sensor (lis302dl version)\n* [i2c](projects/i2c/) - I2C example that communicates with the on-board Audio DAC\n* [wwdg](projects/wwdg/) - Window Watchdog example\n* [itm](projects/itm/) - Message sending through CoreSight ITM port 0\n* [dma](projects/dma/) - Example DMA transfer using memory-to-memory mode\n* [sleepy](projects/sleepy/) - Low Power mode operations (sleep and stop)\n* [flash](projects/flash/) - Example to show how to write/erase internal flash memory\n* [i2s-beep](projects/i2s-beep/) - I2S example that plays a couple notes using the internal beep generator from on-board Audio DAC through audio jack. It does not send any I2S data.\n* [pendsv](projects/pendsv) - Example project on a non-OS use of PendSV exception\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcayci%2Fstm32f4-bare-metal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffcayci%2Fstm32f4-bare-metal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcayci%2Fstm32f4-bare-metal/lists"}