{"id":20841347,"url":"https://github.com/zephyrproject-rtos/hal_stm32","last_synced_at":"2025-04-12T14:56:33.955Z","repository":{"id":37822357,"uuid":"190779298","full_name":"zephyrproject-rtos/hal_stm32","owner":"zephyrproject-rtos","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-01T09:59:24.000Z","size":123758,"stargazers_count":113,"open_issues_count":4,"forks_count":122,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-04-03T15:08:21.350Z","etag":null,"topics":["hal","module"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"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/zephyrproject-rtos.png","metadata":{"files":{"readme":"README.rst","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":"2019-06-07T16:54:35.000Z","updated_at":"2025-04-01T09:59:31.000Z","dependencies_parsed_at":"2025-02-24T16:20:09.805Z","dependency_job_id":null,"html_url":"https://github.com/zephyrproject-rtos/hal_stm32","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/zephyrproject-rtos%2Fhal_stm32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrproject-rtos%2Fhal_stm32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrproject-rtos%2Fhal_stm32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrproject-rtos%2Fhal_stm32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zephyrproject-rtos","download_url":"https://codeload.github.com/zephyrproject-rtos/hal_stm32/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586244,"owners_count":21128996,"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":["hal","module"],"created_at":"2024-11-18T01:19:45.286Z","updated_at":"2025-04-12T14:56:28.946Z","avatar_url":"https://github.com/zephyrproject-rtos.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"This module provides the required STM32cube packages, dtsi files and libraries\nneeded to build a Zephyr application running on STM32 silicon.\n\nPackages, dtsi files and libraries are updated regularly in order for STM32\nusers to benefit from the latest STM32Cube versions, features and bug fixes.\nUpdates are generally done once in each Zephyr release, preferably soon after\nthe opening of the merge window to give time to users to use it, potentially\nreport issues if some are faced and get them fixed before the new version in\nreleased.\n\nSTM32Cube packages\n******************\n\nHow to introduce a new version of stm32cube:\n============================================\nOriginal STM32Cube tree structure has been modified to a minimum\nstructure for a better fit into Zephyr.\nSTM32Cube is divided into drivers and soc section, with:\n\n.. code-block:: none\n\n   drivers/\n       include/ contains Cube HAL/LL files from: Drivers/STM32YYxx_HAL_Driver/Inc/*\n       src/ contains: Drivers/STM32YYxx_HAL_Driver/Src/*\n   soc/ contains STM32 CMSIS files from\n       *Drivers/CMSIS/Device/ST/STM32F1xx/Include/*\n       *Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c\n\nAdditionally ``driver/include/stm32f1xx_hal_conf_template.h`` is renamed into\n``driver/include/stm32f1xx_hal_conf.h``\n\nIf there are changes in the number of *.c files the Kconfig file in the\nstm32cube directory and the ``CMakeLists.txt`` files in the stm32yyxx/ directories\nwill have to be updated. If *.c have been removed drivers that used them will\nalso have to be updated.\n\nIMPORTANT:\n----------\nSTM32Cube, as an external library, is not supposed to be modified.\nIn practice, it might be required to patch it.\nWhen updating a STM32Cube package to a new version, please have a look\nto the patch list in dedicated README file, to make sure you don't overwrite\nsome earlier modifications of the package. Furthermore, make sure to run the\n``genllheaders.py`` script in order to make sure generic LL API headers are\nup-to-date.\nIn case of doubt, contact Zephyr code owner for stm32cube.\n\n\nHow to use STM32Cube:\n=====================\nIn order to enjoy ST CMSIS definitions, ``CONFIG_HAS_STM32CUBE`` should be defined\nand ``stm32yyxx.h`` should be included in ``soc.h``\n\n.. code-block:: c\n\n   #include \u003cstm32f1xx.h\u003e\n\nAdditionally, in order to use STM32Cube LL, you should include the provided\ngeneric LL headers ``stm32_ll_foo.h`` directly in the file using the LL API:\n\n.. code-block:: c\n\n   #include \u003cstm32_ll_usart.h\u003e\n\nDrivers and applications that need functions from the STM32Cube HAL/LL C-files\nwill need to add the appropriate select entries in their Kconfig files.\nFor example when functions from ``stm32f4xx_hal_uart.c`` are used, the following\nentry should apear in driver's Kconfig file.\n\n.. code-block:: none\n\n\tselect USE_STM32_HAL_UART\n\nshould be added to the Kconfig file.\n\n\nAnd if the driver for example needs functions from the LL I2C C-files, the\ndriver Kconfig file should include the following entry\n\n.. code-block:: none\n\n\tselect USE_STM32_LL_I2C\n\n\nSimilar to Zephyr, STM32Cube HAL and LL APIs embed asserts which are\nprovided for parameters checking. You can benefit from these by enabling\nthe following symbols:\n\n.. code-block:: none\n\n     CONFIG_USE_STM32_ASSERT=y\n     CONFIG_ASSERT=y\n\n\nUse STM32Cube in your application:\n==================================\nIt may happen that you want to access STM32Cube APIs in your application,\neither because it is not available as a zephyr API or because you want to\nby-pass use of existing Zephyr API.\nIn this case, you need to create a Kconfig file in your application which\ncontains the following:\n\n.. code-block:: none\n\n   mainmenu \"MYAPP\"\n\n   source \"Kconfig.zephyr\"\n   config MYAPP_STM32\n     default y\n     bool\n     select USE_STM32_HAL_FOO\n     select USE_STM32_LL_BAR\n\nAdditionally, you need to add the following includes:\n\n.. code-block:: c\n\n   #include \u003csoc.h\u003e\n   #include \u003cstm32_ll_bar.h\u003e\n\n.dtsi files\n***********\n\nIn order to provide STM32 boards pin configuration using device tree,\n*-pinctrl.dtsi are made available under dts/st directory. For each STM32 SoC\npackage a complete and correct -pcintrl.dtsi is available. Generation use as\ninput the `STM32 Open Pin Data \u003chttps://github.com/STMicroelectronics/STM32_open_pin_data\u003e`_\ndatabase.\n\n*-pinctrl.dtsi files are generated using generation scripts available in this\nrepo under scripts/genpinctrl and can be generated by running::\n\n   python3 scripts/genpinctrl/genpinctrl.py -p /path/to/stm32-open-pin-data-repository\n\nNew set of -pinctrl.dtsi files could be generated following availability of a\nnew version of STM32 Open Pin Data or a change in the generation script\nconfiguration files.\n\nSTM32Cube based libraries:\n**************************\n\nFor some specific features, in order to benefit from already available and\nvalidated code. Libraries from STM32Cube packages are extracted and made\navailable in this module under `lib` folder.\n\nThese libraries are updated automatically by the ``ble_library.py`` script in a separate commit\ndirectly after their STM32Cube package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephyrproject-rtos%2Fhal_stm32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzephyrproject-rtos%2Fhal_stm32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephyrproject-rtos%2Fhal_stm32/lists"}