Questions tagged [stm32-hal]

STM32 HAL (Hardware Abstraction Layer) is a set of high-level peripheral libraries for stm32 MCUs.

36 questions
6
votes
1 answer

Why does D2 RAM work correctly even when clock is disabled?

TL;DR: documentation states I have to enable a specific memory region in the microcontroller before I can use it. However, I can use it before enabling it, or even after disabling it. How is this possible? I'm currently developing an application…
wovano
  • 4,543
  • 5
  • 22
  • 49
6
votes
1 answer

How to write to STM32 Flash

I want to write to flash Sector 11 of STM32F407VGT from my user code to store some data. I have used the stm32f4xx_hal_flash.c library. I first erase the sector using this code: void Flash_Init(void) { FLASH_EraseInitTypeDef…
b7031719
  • 120
  • 1
  • 2
  • 8
5
votes
1 answer

Why does UART transmit interrupt fail to work in this case?

I am using stm32f0 MCU. I have a simple UART echo code in which every byte received will be transmitted out. I tested that it works. Here it is; uint8_t Rx_data[5]; uint32_t tx_timeout = 0; //Interrupt callback routine void…
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
4
votes
3 answers

Cannot transmit every characters through UART

I am using stm32f0 MCU. I would like to transmit every single byte received from the uart out of the uart. I am enabling an interrupt on every byte received from uart. My code is quite simple. uint8_t Rx_data[5]; //Interrupt callback routine void…
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
3
votes
1 answer

ST Micro HAL, stm32f7xx_hal_crc.c How to solve [Warning] dereferencing type-punned pointer will break strict-aliasing rules

In STM32Cube_FW_F7_V1.3.0 and still in STM32Cube_FW_F7_V1.11.0 I get the following warning when the compiling the stm32f7 HAL library with -Os or -O2. Note: -O1 compiles without warnings. [Warning] dereferencing type-punned pointer will break…
iamJP
  • 386
  • 1
  • 12
3
votes
1 answer

STM32 - How to trigger interrupt after a certain PWM ON time?

I'm new to ARM MCUs (STM32F411), and I have been trying to find my way around the peripherals using STM's HAL library and STM32Cube. I've already configured my board in order to use some peripherals: Timer 2 for running an interrupt with a certain…
starscream
  • 741
  • 2
  • 11
  • 23
2
votes
1 answer

I get an Error when setting PCROP STM32H7 (STM32H743)

Goal I'm trying to set a PCROP area on my STM32H743VI microcontroller, but I'm getting the error code HAL_FLASH_ERROR_OB_CHANGE when executing HAL_FLASH_OB_Launch() and my PCROP area is not set. The relevant part of the code I'm using should be the…
Dugnom
  • 342
  • 1
  • 5
  • 12
2
votes
2 answers

STM32L476 flash Page erase has no effect

I have an issue where I try to write a value to a flash page (page 256 @ 0x08080000) in the STM32L476. However, I get a PROGERR error set in the flash Status Register. This means that a non-zero value was attempted to be written into a flash…
Louis Cloete
  • 421
  • 3
  • 16
2
votes
3 answers

STM32 ADC DMA Double/Multi Buffer example

According to documentation, many of STM32's supports DMA in Double-Buffer (or also known as Multi-Buffer) mode. In HAL, there are two functions for this feature: HAL_DMAEx_MultiBufferStart and HAL_DMAEx_MultiBufferStart_IT in stm32xxxx_hal_adc_ex…
GAMELASTER
  • 1,071
  • 1
  • 12
  • 23
2
votes
5 answers

STM32F HAL Library too large

I just ran out of flash on my microcontroller project. How can I reduce the size of the HAL library or otherwise make it take less of a huge percentage of my project?
tarabyte
  • 17,837
  • 15
  • 76
  • 117
2
votes
3 answers

multiple string transmit over USART using CubeMx

I was trying USART using a STM32F407VGT6 and CubeMX. I am able to send and receive data using Interrupts. But I am getting a problem which I am not able to understand: I am using HAL_UART_Transmit_IT to send the data. I have enabled…
Ehsan Habib
  • 135
  • 1
  • 5
  • 12
2
votes
3 answers

UART Transmit failing after UART Receive thread starts in STM32 HAL Library

I am using STM32F1 (STM32F103C8T6) in order to develop a project using FreeRTOS. The following is my GPIO and USART1 interface configuration: __GPIOA_CLK_ENABLE(); __USART1_CLK_ENABLE(); GPIO_InitTypeDef GPIO_InitStruct; …
mozcelikors
  • 2,582
  • 8
  • 43
  • 77
1
vote
0 answers

STM32L496 - FLASH Page Erase No Effect

I have a project originally built for the STM32L432 that I am porting to the STM32L496. However, I am having an issue where the HAL_FLASHEx_Erase function provided by ST as part of the HAL works on one device but not the other. The two FLASH spaces…
nobby
  • 373
  • 1
  • 3
  • 15
1
vote
2 answers

Should I use xSemaphoreGiveFromISR() or xSemaphoreGive() in STM32 HAL interrupt callbacks?

I've implemented a fault task in the FreeRTOS which is taking a binary semaphore used as a fault flag. That fault flag is triggered by the STM32 HAL error callback functions, such as HAL_I2C_ErrorCallback or HAL_UART_ErrorCallback. If an error…
Ivan Vnucec
  • 604
  • 1
  • 5
  • 17
1
vote
1 answer

Does HAL_NVIC_SetPendingIRQ call the ISR to execute?

I am really new to STM32 world so I came across this while reading: void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn); This will cause the interrupt to fire, as it would be generated by the hardware. A distinctive feature of Cortex-M processors it that…
Tilak Sai
  • 21
  • 3
1
2 3