Giter VIP home page Giter VIP logo

stm32g4xx_hal_driver's Introduction

STM32CubeG4 HAL Driver MCU Component

latest tag

Overview

STM32Cube is an STMicroelectronics original initiative to ease developers' life by reducing efforts, time and cost.

STM32Cube covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series.

  • The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product.
  • The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio.
  • The BSP drivers of each evaluation, demonstration or nucleo board provided for this STM32 series.
  • A consistent set of middleware libraries such as RTOS, USB, FatFS, graphics, touch sensing library...
  • A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series.

Two models of publication are proposed for the STM32Cube embedded software:

  • The monolithic MCU Package: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name STM32Cubexx, xx corresponding to the STM32 series).
  • The MCU component: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions.

Description

This stm32g4xx_hal_driver MCU component repo is one element of the STM32CubeG4 MCU embedded software package, providing the HAL-LL Drivers part.

Release note

Details about the content of this release are available in the release note here.

Compatibility information

In this table, you can find the successive versions of this HAL-LL Driver component, in line with the corresponding versions of the full MCU package:

It is crucial that you use a consistent set of versions for the CMSIS Core - CMSIS Device - HAL, as mentioned in this table.

HAL Driver G4 CMSIS Device G4 CMSIS Core Was delivered in the full MCU package
Tag v1.0.0 Tag v1.0.0 Tag v5.4.0_cm4 Tag v1.0.0 (and following, if any, till next new tag)
Tag v1.1.0 Tag v1.1.0 Tag v5.4.0_cm4 Tag v1.1.0 (and following, if any, till next new tag)
Tag v1.1.1 Tag v1.1.1 Tag v5.4.0_cm4 Tag v1.2.0 (and following, if any, till next new tag)
Tag v1.2.0 Tag v1.2.0 Tag v5.6.0_cm4 Tag v1.3.0 (and following, if any, till next new tag)
Tag v1.2.1 Tag v1.2.1 Tag v5.6.0_cm4 Tag v1.4.0 (and following, if any, till next new tag)
Tag v1.2.2 Tag v1.2.2 Tag v5.6.0_cm4 Tag v1.5.0 (and following, if any, till next new tag)

Details about the content of this release are available in the release note here.

The full STM32CubeG4 MCU package is available here.

Troubleshooting

Please refer to the CONTRIBUTING.md guide.

stm32g4xx_hal_driver's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stm32g4xx_hal_driver's Issues

HAL driver always asserts when full assert is activated and i2c speed is set to Fast Mode Plus

Caution
The Issues are strictly limited for the reporting of problem encountered with the software provided in this project.
For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post a topic in the ST Community/STM32 MCUs forum

Describe the set-up

  • Custom STM32G491 board.
  • STM32CubeIDE 1.15.0 and STM32G4xx HAL Driver 1.2.3

Describe the bug
When I2C Speed is set to Fast Mode Plus AND Full Asserts are enabled the Driver always asserts.

How To Reproduce

  1. Open ioc file

  2. Activate checkbox "Enable Full Assert" under Project Manager -> Code Generator -> HAL Settings

  3. Set I2C3 Speed Mode to "Fast Mode Plus" under "Pinout & Configuration" -> Connectivity -> I2C3 -> Parameter Settings -> Timing Configuration

  4. Save ioc file and let generate code

  5. Add a "while (1) {}" in the User Code section into the function assert_failed() in main.c

Additional context
The code generator adds the following line to MX_I2C3_Init() in i2c.c:
__HAL_SYSCFG_FASTMODEPLUS_ENABLE(I2C_FASTMODEPLUS_I2C3);

This macro is in stm32g4xx_hal.h and includes an assert that leads to:
assert_param(IS_SYSCFG_FASTMODEPLUS(I2C_FASTMODEPLUS_I2C3))

The problem is, that this macro checks for
I2C_FASTMODEPLUS_PB6, I2C_FASTMODEPLUS_PB7, I2C_FASTMODEPLUS_PB8, I2C_FASTMODEPLUS_PB9
but misses
I2C_FASTMODEPLUS_I2C1, I2C_FASTMODEPLUS_I2C2, I2C_FASTMODEPLUS_I2C3, I2C_FASTMODEPLUS_I2C4

A possible fix could be to change both macros __HAL_SYSCFG_FASTMODEPLUS_ENABLE and __HAL_SYSCFG_FASTMODEPLUS_DISABLE to use different asserts:
assert_param(IS_SYSCFG_FASTMODEPLUS((__FASTMODEPLUS__)) -> assert_param(IS_I2C_FASTMODEPLUS((__FASTMODEPLUS__))

HAL_FMAC_FilterStop does not terminate DMA transfer

Caution
The Issues are strictly limited for the reporting of problem encountered with the software provided in this project.
For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post a topic in the ST Community/STM32 MCUs forum.

Describe the set-up

  • Custom STM32G431 board.
  • STM32G4xx HAL Driver 1.5.2.

Describe the bug
A wrong behavior of subsequent HAL_FMAC_FilterStart() -> HAL_FMAC_FilterStop() -> HAL_FMAC_FilterStart().

How To Reproduce

  1. FMAC is configured as FIR with output buffer access mode DMA.
  2. The software periodically starts and stops FMAC, by calling HAL_FMAC_FilterStart() / HAL_FMAC_FilterStop().
  3. The second call of HAL_FMAC_FilterStart() fails with DMA related HAL error.

Additional context
Follow the issue debugging, DMA transfer starts from within HAL_FMAC_FilterStart().
However, complementary DMA stop is missing in HAL_FMAC_FilterStop().

I2C Hal driver in DMA mode is broken

Describe the set-up

  • STM32G491RE custom board
  • STM32CubeIDE Version: 1.13.2 Build: 18220_20230914_1601 (UTC)

Describe the bug
When using the I2C hal driver with DMA the communication to an OLED display doesn't work. When using the I2C driver in IT mode the display works fine. The project firmware is found here https://github.com/olliw42/mLRS and the board schematics here https://github.com/olliw42/mLRS-hardware/tree/master/olliw-stm32-based/tx-module-02, if this should be of any help.

Tests have confirmed that the issue is specifically related to the I2C hal driver, that is, is located in the file stm32g4xx_hal_i2c.c

The board including OLED was working fine since ca 1.5 years, up to using commit @75ce54b. The issue appeared recently with upgrading to commit @74ce67c, and remains also after upgrading to the latest commit @7c2e15e. Downgrading back to @75ce54b resolves the issue.

Lack of FLASH_OB_BootConfig Functionality in STM32G4 HAL Library

Board: STM32G474RET6 or STM32G474RCT6
IDE/Compiler: [Keil µVision 5.36]

Issue Description
The STM32G4 series, specifically the STM32G474RET6 and STM32G474RCT6 chips, are designed to support firmware updates via serial communication by utilizing a dual BANK configuration. In this context, a mechanism to identify the current bank, write to the alternate bank, and subsequently switch between banks is crucial for seamless firmware updates.

For similar chip designs, such as the STM32F4 series, the HAL library provides the FLASH_OB_BootConfig function to facilitate this process. However, it appears that the STM32G4 HAL library lacks this essential functionality.

Invalid define LL_AHB2_GRP1_PERIPH_CCM when using a STM32G473xx controller

We are using an STM32G473VCT6 and the STM32 low level library (not the HAL) version 1.5.2.

The define LL_AHB2_GRP1_PERIPH_CCM in file stm32g4xx_ll_bus.h is invalid. If one uses it, one will get a compiler error.

The current define is the following:

#define LL_AHB2_GRP1_PERIPH_CCM RCC_AHB2SMENR_CCMSMEN

But the value RCC_AHB2SMENR_CCMSMEN is nowhere set. The most obvious fix for this controller would be:

#define LL_AHB2_GRP1_PERIPH_CCM RCC_AHB2SMENR_CCMSRAMSMEN

as RCC_AHB2SMENR_CCMSRAMSMEN is defined in file stm32g473xx.h.

The used toolchain is irrelevant to this failure, but we are using Visual Studio Code as IDE with (custom) CMake which uses gnu-tools-for-stm32 with gcc v11.3.

One can reproduce the compiler error if using the following line somewhere in the code:
LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_CCM);

RCC_CRS_HSI48CALIBRATION_DEFAULT wrong value for G4 and L4

Describe the set-up
HAL driver V1.2.2 / 10-November-2021 for STM32G4

Describe the bug
In stm32G4xx_hal_crs.h:
#define RCC_CRS_HSI48CALIBRATION_DEFAULT 0x00000020U
https://github.com/STMicroelectronics/stm32g4xx_hal_driver/blob/master/Inc/stm32g4xx_hal_rcc_ex.h#L518

In stm32G4xx_ll_crs.h:
#define LL_CRS_HSI48CALIBRATION_DEFAULT ((uint32_t)0x40U)

Both claim that:
The default value corresponds to the middle of the trimming interval.

In G4 the TRIM field of CRS_CR is 7 bits, so the right value is 0x40. The HAL value is wrong.

How To Reproduce
Look at the files

Additional context

Screenshots

HAL_FDCAN_GetRxMessage doesn't check for buffer size

HAL_StatusTypeDef HAL_FDCAN_ActivateNotification(FDCAN_HandleTypeDef *hfdcan, uint32_t ActiveITs,

HAL_FDCAN_GetRxMessage doesn't check for buffer size. Since there is no function in this header file to request the size of the message before reading you are forced to allocate an array of 64 bytes to be sure. A bounds check would prevent buffer overflow and reading the size of the message before copying it would be helpful too,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.