STM32 HAL (Hardware Abstraction Layer) is a set of high-level peripheral libraries for stm32 MCUs.
Questions tagged [stm32-hal]
36 questions
1
vote
0 answers
How to maintain USB connection in Stop Mode
I have configured a USB CDC peripheral on the STM32F4 which starts automatically. I have also enabled the STOP power mode but the USB device disconnects when it enters STOP and does not reconnect when the device wakes up. What do I need to do in…

b7031719
- 120
- 1
- 2
- 8
1
vote
1 answer
STM32F1 HAL CAN2 Not Recieving
I am using a Custom board with a STM32F107VCT6 controller on it. The main purpose of this board is to interface two can networks, do some calculations and relay some data over SPI to another controller and some to the other CAN network and…

TommyP
- 11
- 2
0
votes
2 answers
SD card issue in SDIO peripheral in Stm32f407VET6 Black Board
I have Stm32f407VET6 Black Board, cant connect the MicroSD card. im using onboard SD slot and a 32GB micro SD card by PNY. The card is okay and its already in FAT32 formatted. f_mount() function returns only FR_NOT_READY. Mounting Formatting wont…

Shams313
- 71
- 6
0
votes
0 answers
STM32 SPI Slave configuration
I'm trying to communicate betwenn two NucleoF303K8 boards via SPI.
One board is Master and is controlled by UART. It can send via SPI 3 kinds of messages:
{0x01 0x00 0x00 0x00} that means 'read value'
{0x81 0x00 0x00 0x00} that means 'set value =…

lazba
- 129
- 9
0
votes
1 answer
STM32 boot to system memory bootloader
I'm trying to use the STM32 system memory bootloader to program the MCU through UART1 without programmer.
I'm using STM32G030C8 on custom board and found this document explaining how to boot to the…

Ou Tsei
- 470
- 7
- 24
0
votes
1 answer
SMT32H7 (H745/H755): ADC "internal Error" with HAL
I'm using an STM32H755 (on NUCLEO-Board) with CubeIDE and trying to set up an ADC with HAL.
Without any changes to the default ADC and clock setup, the ADC goes into "error internal" state when trying to read values. Any Ideas why?
I didn't touch…

DaveR
- 21
- 2
0
votes
1 answer
stm32-h743zi nucleo-144 ADC
i have a problem with getting value from ADC on the nucleo144 board. I connected a potentiometer to the pin A0, but the ADC is stuck in the HAL_PollForConversion function and returns 0 if the delay is set to less then HAL_MAX_DELAY.
enter image…

JanSam
- 1
- 2
0
votes
0 answers
STM32F407ZET6 with freeRTOS HAL_I2C_Mem_Read always returns HAL_TIMEOUT
I am using freeRTOS on STM32F4x. I am reading MPU6050 MEMS sensor on I2C2 peripheral. When I am just in bare metal mode, the HAL_I2C_Mem_Read function works just fine and returns me the ID of the sensor. However, when i am running with freeRTOS this…
0
votes
1 answer
STM32-HAL CAN transmits empty error message only
I'm trying to transmit messages through CAN using HAL library. For test I repeated code from the first part of this video I have the same bluepill so I just did the same. Also I've tried his project, but changing Nucleo RE to ZE model. I've looked…

lazba
- 129
- 9
0
votes
1 answer
VSCode marks GPIO_TypeDef in HAL library as unknown
I have some functions that refer to GPIO_TypeDef struct from STM32_HAL library and in Keil I recieve no errors in compilation, but VSCode marks it as "unknown identificator" error. I fixed it with adding
#include "stm32f103xe.h"
to main.hand both…

lazba
- 129
- 9
0
votes
1 answer
Is HAL_UARTEx_RxEventCallback Size parameter calculated programmatically or by hardware
I'm realizing UART-DMA with STM_HAL library and I want to know if message size is counted by hardware (counting clock ticks till line is idle for example) or by some program method(something like strlen). So if Size…

lazba
- 129
- 9
0
votes
1 answer
What are the methods of having one build for two STM32 MCU?
I have a firmware that supports two builds, stm32f series and stm32g series. To ease selection during deployment, Is it feasible to have one firmware build for both?
The firmware is using HAL from stm and building them into one will have a conflict…
0
votes
1 answer
Transmit and read 16 bit values from magnetic encoder on STM32 with SPI
I am trying to read values from an AMS AS5050A magnetic encoder via SPI on an STM32 NUCLEO F446RE, but I cannot get it to work. When I use the HAL library, the output is always 0. My setup for the peripheral is this:
hspi3.Instance =…

S.vdh
- 1
- 2
0
votes
2 answers
How does STM32 demo USB-DFU boot loader check if user code is loaded?
STM32 HAL demo USB-DFU boot loader contains this code:
/* Test if user code is programmed starting from address 0x0800C000 */
if (((*(__IO uint32_t *) USBD_DFU_APP_DEFAULT_ADD) & 0x2FFC0000) == 0x20000000)
{
/* Jump to user application */
…

T. Jastrzębski
- 145
- 8
0
votes
0 answers
Changing SPI DATA Size Mid Transaction on STM32G474
I've got an LCD screen that I am using that requires the first spi packet that is sent to be 10 bits long and all subsequent packets to be 8 bits long. So commands are 10 bits and data is bits. Sending data to the device must happen after a command…

emg184
- 850
- 8
- 19