Giter VIP home page Giter VIP logo

stm32f0xx_hal_driver's Introduction

STM32CubeF0 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 stm32f0xx_hal_driver MCU component repo is one element of the STM32CubeF0 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

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

The full STM32CubeF0 MCU package is available here.

Troubleshooting

Please refer to the CONTRIBUTING.md guide.

stm32f0xx_hal_driver's People

Contributors

alabstm avatar aselstm avatar hbostm avatar rjmstm avatar rkoustm avatar tounstm avatar

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  avatar  avatar  avatar  avatar

stm32f0xx_hal_driver's Issues

FLASH_OB_GetRDP has 32-bit return type but HAL_FLASHEx_OBErase implicitly converts it to 8-bits

Describe the set-up

  • Hardware agnostic (encountered while compiling program for STM32F072)
  • STM32CubeIDE v1.14.0 (build 19471_20231121_1200 (UTC))

Describe the bug
Compiling stm32f0xx_hal_flash_ex.c results in (conversion related) warnings at build-time like this:

...
arm-none-eabi-gcc "../Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c" -mcpu=cortex-m0 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F072xB -c -I../Core/Inc -I../Drivers/STM32F0xx_HAL_Driver/Inc -I../Drivers/STM32F0xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F0xx/Include -I../Drivers/CMSIS/Include -Og -ffunction-sections -fdata-sections -Wall -Wconversion -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.d" -MT"Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.o"
../Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c: In function 'HAL_FLASHEx_OBErase':
../Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c:317:12: warning: conversion from 'uint32_t' {aka 'long unsigned int'} to 'uint8_t' {aka 'unsigned char'} may change value [-Wconversion]
  317 |   rdptmp = FLASH_OB_GetRDP();
      |            ^~~~~~~~~~~~~~~
../Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c: In function 'HAL_FLASHEx_OBGetConfig':
../Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c:449:23: warning: conversion from 'uint32_t' {aka 'long unsigned int'} to 'uint8_t' {aka 'unsigned char'} may change value [-Wconversion]
  449 |   pOBInit->RDPLevel = FLASH_OB_GetRDP();
      |                       ^~~~~~~~~~~~~~~
...
13:52:02 Build Finished. 0 errors, 2 warnings. (took 4s.966ms

How To Reproduce

  1. Application agnostic.
  2. Suspect is HAL (stm32f0xx_hal_flash_ex.c)
  3. No need to make any calls to reproduce -- problem is warning at compile time.
  4. Can reproduce by compiling stm32f0xx_hal_flash_ex.c with conversion warnings enabled.

Additional context
My suggested solution is to simply change the return type from uint32_t to uint8_t since result must be one of OB_RDP_LEVEL_0, OB_RDP_LEVEL_1, or OB_RDP_LEVEL_2

diff --git a/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c b/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c
index 7ea91b9..34068c7 100644
--- a/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c
+++ b/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c
@@ -102,7 +102,7 @@ static HAL_StatusTypeDef FLASH_OB_RDP_LevelConfig(uint8_t ReadProtectLevel);
 static HAL_StatusTypeDef FLASH_OB_UserConfig(uint8_t UserConfig);
 static HAL_StatusTypeDef FLASH_OB_ProgramData(uint32_t Address, uint8_t Data);
 static uint32_t          FLASH_OB_GetWRP(void);
-static uint32_t          FLASH_OB_GetRDP(void);
+static uint8_t           FLASH_OB_GetRDP(void);
 static uint8_t           FLASH_OB_GetUser(void);

 /**
@@ -899,7 +899,7 @@ static uint32_t FLASH_OB_GetWRP(void)
   *            @arg @ref OB_RDP_LEVEL_1 Read protection of the memory
   *            @arg @ref OB_RDP_LEVEL_2 Full chip protection
   */
-static uint32_t FLASH_OB_GetRDP(void)
+static uint8_t FLASH_OB_GetRDP(void)
 {
   uint32_t tmp_reg;

USB HID Keyboard stopped working on STM32Cube FW_F0 V1.11.3

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 board with STM32F042K6U6
  • STM32CubeMX + Clion

Describe the bug
A clear and concise description of what the bug is.
Custome board simulate keyboard keep pressing CapLock preventing PC from entering sleep.

Programming following this post https://controllerstech.com/how-to-use-stm32-as-a-keyboard/

It was working all good by utilising STM32Cude FW_F0 V1.11.2 but stopped working on V1.11.3

The key was pressed but never released.

How To Reproduce

  1. Indicate the global behavior of your application project
      keyboardhid[3] = 0x39;
      USBD_HID_SendReport(&hUsbDeviceFS, (uint8_t *) &keyboardhid, sizeof(keyboardhid));
      HAL_Delay(50);
      keyboardhid[3] = 0x00;
      USBD_HID_SendReport(&hUsbDeviceFS, (uint8_t *) &keyboardhid, sizeof(keyboardhid));
      HAL_Delay(1000);
  1. The modules that you suspect to be the cause of the problem (Driver, BSP, MW ...)
    Recent updates on stm32f0xx_hal_pcd.c and stm32f0xx_ll_usb.c
  2. The use case that generates the problem
    https://controllerstech.com/how-to-use-stm32-as-a-keyboard/
  3. How we can reproduce the problem
    Just follow the post above

I will utilise a logic analyser to compare traffic between the two versions.

I can provide a video but don't know where I can upload it.

Some errors of comment

Some errors of comment in the stm32f0xx_hal_gpio_ex.h file.

#define GPIO_AF0_USART3 ((uint8_t)0x00U) /*!< AF0: USART2 Alternate Function mapping */

#define GPIO_AF1_I2C2 ((uint8_t)0x01U) /*!< AF1: I2C1 Alternate Function mapping */
#define GPIO_AF1_TSC ((uint8_t)0x01U) /*!< AF1: I2C1 Alternate Function mapping */

#define GPIO_AF1_I2C2 ((uint8_t)0x01U) /*!< AF1: I2C1 Alternate Function mapping */

Question about the HSI48RDY bit in RCC->CR2

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

  • STM32F072xb
  • arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10.3-2021.10) 10.3.1 20210824 (release)

Additional context
RCC_CR2_HSI48RDY_BitNumber is now set to 16:

#define RCC_CR2_HSI48RDY_BitNumber 16

But bit 16 actually represents HSI48ON according to the reference manual. Maybe RCC_CR2_HSI48RDY_BitNumber should be set to 17?

Screenshots

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.