{"id":20910508,"url":"https://github.com/ziteh/stm32-examples","last_synced_at":"2025-05-13T07:31:47.387Z","repository":{"id":41856350,"uuid":"426206242","full_name":"ziteh/stm32-examples","owner":"ziteh","description":"Simple examples for STM32 LL, HAL and LibOpenCM3","archived":false,"fork":false,"pushed_at":"2024-05-26T04:48:53.000Z","size":699,"stargazers_count":8,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T06:08:20.884Z","etag":null,"topics":["libopencm3","nucleo-board","platformio","stm32","stm32f103"],"latest_commit_sha":null,"homepage":"https://blog.ziteh.dev/categories/%E7%B0%A1%E5%96%AE%E5%85%A5%E9%96%80-lib-open-cm-3-stm-32-%E5%B5%8C%E5%85%A5%E5%BC%8F%E7%B3%BB%E7%B5%B1%E9%96%8B%E7%99%BC","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/ziteh.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-09T11:41:15.000Z","updated_at":"2025-04-19T10:06:03.000Z","dependencies_parsed_at":"2024-11-18T14:16:04.887Z","dependency_job_id":"8492aa18-720f-4ec2-a1f4-81ad0603bdc2","html_url":"https://github.com/ziteh/stm32-examples","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/ziteh%2Fstm32-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziteh%2Fstm32-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziteh%2Fstm32-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziteh%2Fstm32-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziteh","download_url":"https://codeload.github.com/ziteh/stm32-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253894826,"owners_count":21980406,"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":["libopencm3","nucleo-board","platformio","stm32","stm32f103"],"created_at":"2024-11-18T14:15:33.152Z","updated_at":"2025-05-13T07:31:46.438Z","avatar_url":"https://github.com/ziteh.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# STM32 Examples\n\nThis repo contains some basic examples for STM32.\n\n## LibOpenCM3\n\n[LibOpenCM3](https://github.com/libopencm3/libopencm3) is an open source ARM Cortex-M microcontroller library.\n\nMy blog posts: [簡單入門 LibOpenCM3 STM32 嵌入式系統開發](https://ziteh.github.io/series/%E7%B0%A1%E5%96%AE%E5%85%A5%E9%96%80-libopencm3-stm32-%E5%B5%8C%E5%85%A5%E5%BC%8F%E7%B3%BB%E7%B5%B1%E9%96%8B%E7%99%BC/)\n\n| Examples                                                                    | F103RB | F446RE | F401RE | F302R8 | L432KC | G431KB |\n| :-------------------------------------------------------------------------- | :----: | :----: | :----: | :----: | :----: | :----: |\n| [Blinking LED](./libopencm3/blink/)                                         |   ✔️    |   ✔️    |   ✔️    |   ✔️    |   ✔️    |   ✔️    |\n| [GPIO input](./libopencm3/gpio_input/)                                      |   ✔️    |   ✔️    |   ✔️    |   ✔️    |   ✔️    |        |\n| [EXTI button](./libopencm3/exti_button/)                                    |   ✔️    |   ✔️    |   ✔️    |   ✔️    |   ✔️    |        |\n| [USART with printf()](./libopencm3/usart_printf/)                           |   ✔️    |   ✔️    |        |   ✔️    |   ✔️    |        |\n| [USART receive interrupt](./libopencm3/usart_receive_interrupt/)            |   ✔️    |   ✔️    |        |        |        |        |\n| [Timer](./libopencm3/timer/)                                                |   ✔️    |   ✔️    |        |        |        |        |\n| [SysTick delay](./libopencm3/systick/)                                      |   ✔️    |   ✔️    |        |        |        |        |\n| [PWM](./libopencm3/pwm/)                                                    |   ✔️    |   ✔️    |        |        |        |        |\n| [IWDG](./libopencm3/iwdg/)                                                  |   ✔️    |   ✔️    |        |        |        |        |\n| [WWDG](./libopencm3/wwdg/)                                                  |   ✔️    |   ✔️    |        |        |        |        |\n| [ADC (Regular single channel)](./libopencm3/adc_single_channel_regular/)    |   ✔️    |   ✔️    |        |        |        |        |\n| [ADC (Injected multi channel)](./libopencm3/adc_multi_channel_injected/)    |   ❌    |   ✔️    |        |        |        |        |\n| [ADC (Interrupt)](./libopencm3/adc_interrupt/)                              |   ✔️    |   ✔️    |        |        |        |        |\n| [ADC (External trigger by timer)](./libopencm3/adc_external_trigger_timer/) |   ✔️    |   ✔️    |        |        |        |        |\n| [SPI (Master mode)](./libopencm3/spi_master/)                               |   ✔️    |   ✔️    |        |        |        |        |\n| [SPI (Slave mode)](./libopencm3/spi_slave/)                                 |   ✔️    |   ✔️    |        |        |        |        |\n| [I2C (LCD 1602)](./libopencm3/i2c_lcd1602/)                                 |   ✔️    |   ✔️    |        |        |        |        |\n| [I2C (EEPROM 24C256)](./libopencm3/i2c_eeprom_24c256/)                      |   ✔️    |   ✔️    |        |        |        |        |\n| [CRC](./libopencm3/crc/)                                                    |   ✔️    |   ✔️    |        |        |        |        |\n\n## STM32 LL\n\nSTM32 Low Layer.\n\n| Examples                                                        | G431KB |\n| :-------------------------------------------------------------- | :----: |\n| [ADC (Injected TRGO)](./stm32_ll/adc_inj_trgo/)                 |   ✔️    |\n| [UART Printf](./stm32_ll/uart_printf/)                          |   ✔️    |\n| [UART Printf (Ring buffer/kfifo)](./stm32_ll/uart_printf_ring/) |   ✔️    |\n| [UART Printf (tiny)](./stm32_ll/uart_printf_tiny/)              |   ✔️    |\n\n\u003e Check the code under the `User` folder in each project.\n\n## STM32 HAL\n\nSTM32 Hardware Abstraction Layer.\n\n| Examples                           | F103RB | F446RE | G431KB |\n| :--------------------------------- | :----: | :----: | :----: |\n| [Blinking LED](./stm32_hal/blink/) |        |        |   ✔️    |\n\n## Usage\n\nClone the repo:\n\n```bash\ngit clone --recursive https://github.com/ziteh/stm32-examples.git\n```\n\nor\n\n```bash\ngit clone https://github.com/ziteh/stm32-examples.git\ngit submodule update --init --recursive\n```\n\n### LibOpenCM3 \u0026 STM32 HAL\n\n1. Install [VSCode](https://code.visualstudio.com) and [PlatformIO IDE](https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide).\n2. Open example project folder (e.g. [blink example](./libopencm3/blink/)) in VSCode.\n3. Selecte environment (STM32 board). [Ref](https://docs.platformio.org/en/stable/integration/ide/vscode.html#task-explorer)\n4. Build project and upload to STM32 board. [Ref](https://docs.platformio.org/en/stable/integration/ide/vscode.html)\n\n### STM32 LL\n\nDownload STM32CubeIDE and open the project.\n\n## References\n\n### Code\n\n- [libopencm3/libopencm3-examples](https://github.com/libopencm3/libopencm3-examples)\n- [platformio/platform-ststm32](https://github.com/platformio/platform-ststm32)\n\n### STM32 Documentation\n\n- [STM32F103RB](https://www.st.com/en/microcontrollers-microprocessors/stm32f103rb.html)\n    - Datasheet: [DS5319](https://www.st.com/resource/en/datasheet/stm32f103rb.pdf)\n    - Reference Manual: [RM0008](https://www.st.com/resource/en/reference_manual/rm0008-stm32f101xx-stm32f102xx-stm32f103xx-stm32f105xx-and-stm32f107xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf)\n- [STM32F446RE](https://www.st.com/en/microcontrollers-microprocessors/stm32f446re.html)\n    - Datasheet: [DS10693](https://www.st.com/resource/en/datasheet/stm32f446re.pdf)\n    - Reference Manual: [RM0390](https://www.st.com/resource/en/reference_manual/rm0390-stm32f446xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf)\n- [STM32L432KC](https://www.st.com/en/microcontrollers-microprocessors/stm32l432kc.html)\n    - Datasheet: [DS11451](https://www.st.com/resource/en/datasheet/stm32l432kc.pdf)\n    - Reference Manual: [RM0394](https://www.st.com/resource/en/reference_manual/rm0394-stm32l41xxx42xxx43xxx44xxx45xxx46xxx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf)\n- [STM32G431KB](https://www.st.com/en/microcontrollers-microprocessors/stm32g431kb.html)\n    - Datasheet: [DS12589](https://www.st.com/resource/en/datasheet/stm32g431kb.pdf)\n    - Reference Manual: [RM0440](https://www.st.com/resource/en/reference_manual/rm0440-stm32g4-series-advanced-armbased-32bit-mcus-stmicroelectronics.pdf)\n- STM32 Nucleo board user manual\n    - Nucleo-64 MB1136: [UM1724](https://www.st.com/resource/en/user_manual/um1724-stm32-nucleo64-boards-mb1136-stmicroelectronics.pdf)\n    - Nucleo-32 MB1180: [UM1956](https://www.st.com/resource/en/user_manual/um1956-stm32-nucleo32-boards-mb1180-stmicroelectronics.pdf)\n    - Nucleo-32 MB1430: [UM2397](https://www.st.com/resource/en/user_manual/um2397-stm32g4-nucleo32-board-mb1430-stmicroelectronics.pdf)\n\n## License\n\nMy code is licensed under the [MIT License](./LICENSE). Other code is licensed under their own licenses (e.g., CMSIS under Apache 2.0, STM32 HAL/LL under BSD-3-Clause), which can be identified at each level of the folder or at the beginning of each file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziteh%2Fstm32-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziteh%2Fstm32-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziteh%2Fstm32-examples/lists"}