Questions tagged [hal]

For questions about hardware abstraction layers (HALs). A HAL is software that provides an interface to a class of similar hardware devices so that applications can access the hardware in a device-independent manner in order to improve portability.

Filter by
Sorted by
Tagged with
1 vote
2 answers
63 views

HAL_TIM_PeriodElapsedCallback firing very prematurely

I am using STM32CubeIDE with an STM32G030 micro. I attempted to implement a simple interrupt-based timeout timer on Timer17 using the HAL driver. See attached file “Screenshot1”for the ...
Brian Dotson's user avatar
0 votes
0 answers
57 views

STM32 L4(Nucleo-144) CAN Tx pin stays high and dosen't transmit any data

I'm new to STM32 and a starting knowledge of C. I'm trying to get some level of CAN communication to be working. I've tried looking up the HAL'S required but for some reason no matter what I do, the ...
George kirby's user avatar
1 vote
0 answers
49 views

Monitoring VREF+ buffer output in STM32L552

I am working with the STM32L552 microcontroller in a critical application where a portion of the external circuit relies heavily on the 2.5 V VREF+. The stability of this reference voltage is ...
tronhawk's user avatar
0 votes
0 answers
27 views

STM32: I2C Master Slave code does not work

I have two board: nucleo U575zi-q & nucleo L432kc u575 is the master board, l432 is slave. I want to transfer data between Them, and below is my two codes. this is my master's code ...
이준표's user avatar
2 votes
1 answer
43 views

Reading and writing from the BMP180 E2PROM

I have been trying to practise writing drivers using the I2C protocol and as a result, I have checked the drivers written for the BMP180 temperature sensor by Adafruit and written my own some time ago ...
Suva23's user avatar
  • 33
0 votes
0 answers
45 views

STM32 STEVAL-Spin3202 Motor control - Issues with driving power MOSFETs with PWM

I've been struggling with my new STEVAL-Spin3202 board from STM. It is using the STSpin32F0a motor driver with STM32F031C6 MCU. The ultimate goal is to control a BLDC motor with six-step sensor-less ...
Martin kala's user avatar
0 votes
0 answers
48 views

STM32 timer encoder mode without overflows

Can I have timer in encoder mode without overflows in either direction ? I would like it to count from 0 to max and stay "tapped" on these min/max values instead of overflowing. So if I am ...
Arkadiusz Rycyk's user avatar
0 votes
0 answers
87 views

STM32H7 HAL read GPIOC13 with DMA into SRAM

I am trying to read GPIO pins (on row C) with DMA into SRAM, using TIM1 as clock. I am using an STM32H750B-DK When TIM1 goes high, DMA should read from GPIO to SRAM continuously (until it's stopped by ...
LaCalienta's user avatar
1 vote
1 answer
166 views

STM32F4 ADC+DMA wrong values

I try to setup STM32F407ZGT6 chip to work with ADC throught DMA, currently I'm using HAL lib for fast prototype but have some problem. I set up ADC as 3 chanel Scan Continous mode using DMA in ...
Alexey's user avatar
  • 33
0 votes
0 answers
90 views

HAL_DELAY stuck after pvPortMalloc

Environment: STM32F103ZET6 FreeRTOS Kernel V10.3.0 MDK or arm-none-eabi-gcc My program stopped working when I added a queue to receive messages from RS232. I managed to reproduce the problem with the ...
Nugnikoll's user avatar
5 votes
0 answers
2k views

STM32 - I²C Slave HAL Callback ACK

Objective: implement a single byte I²C slave on STM32. Materials: STM32L452RE Nucleo-64 board, HAL Library, CH341 USB-I²C adapter(1), Artix Linux with Runit, Rhode & Schwarz RTB2004 oscilloscope ...
tweak's user avatar
  • 51
1 vote
1 answer
161 views

STM32F746 I2S clock fails

I have discovery board STM32f746NG In first try I've set this: Activate I2S2 with piout: PB4->WS - PI3->SD - PI1->CK. Instantly after activating I2S periferal with command ...
mohammadsdtmnd's user avatar
0 votes
1 answer
330 views

HAL_SPI_Transmit does not send the bit pattern expected way

As a beginner, to test HAL_SPI_Transmit function for this Nucleo board, I wanted to send 0b10101010 on MOSI line and observe it on scope. But I don't see that bit pattern on scope, instead I see the ...
cm64's user avatar
  • 2,059
4 votes
1 answer
735 views

STM32F030 High current in stop mode

I would like to put STM32F030K6T6 into STOP mode (low power mode), in which there should be current consumption around 5 μA. But whatever I do the current consumption is around 450 μA in stop mode. ...
Chupacabras's user avatar
  • 5,414
0 votes
1 answer
92 views

A question about types of STM32 HAL initializations

For a peripheral PPP(), there is an initialization function in HAL as: HAL_PPP_Init(); and there is also the following which is a called a callback: ...
GNZ's user avatar
  • 1,618
0 votes
3 answers
1k views

Why are MSPs in STM32 HAL defined as callback functions?

Please see my edit: I asked this question stackoverflow and no one answered. In STM32CubeMX MSP stands for MCU Support Package and of all here is what it basically about: MSPs are user callback ...
GNZ's user avatar
  • 1,618
1 vote
1 answer
638 views

stm32f7 QSPI (QUADSPI) in indirect mode can't read/write on NOR flash memory

I'm using STM32F746G-Discovery included Micron NOR flash memory n25q128a. In CUBE example we can see this (ReadWrite_IT, Automatic polling): ...
mohammadsdtmnd's user avatar
4 votes
3 answers
2k views

What is the meaning of the keyword "__weak" in this callback function in HAL GPIO function?

I have started learning STM32 programming in HAL and I am confused about what this function exactly does: ...
user8737703's user avatar
1 vote
1 answer
857 views

STM32 HAL SPI communication issue

I have two STM32F407VET6 boards and I want to use one as master and second as slave and connect them with SPI. I connected the master's SCK to the slave's ...
Alatriste's user avatar
  • 131
0 votes
0 answers
51 views

Why is the buffer continue to be filled even when the CODEC is not receiving an input?

I am currently using the HAL function HAL_I2S_Receive(I2S_HandleTypeDef * hi2s, uint16_t * pData, uint16_t Size, uint32_t Timeout) in order to collect an input ...
Diego C's user avatar
  • 39
3 votes
2 answers
657 views

STM32 and dreaded HAL: something wrong with only using HAL for basic setup and skip it for the application part?

Many have a hate relationship with ST's HAL. I have a like/hate one and was wondering if my approach will bite me later on. I like the peripheral and clock setup of current CubeMx. The code generated ...
JeromeBu1982's user avatar
0 votes
0 answers
571 views

HAL_Delay fails after flashing code

My code runs differently if reset vs. power-cycle. My board has a status LED. My program flashes an LED on and off. When I flash my code via my STLink V2 and hit my reset button, the light turns on, ...
Schuyler Horky's user avatar
0 votes
1 answer
689 views

UART doesn't work with ADC enabled

I'm trying to send some data through UART using DMA. I'm also using DMA to control ADC and DAC. When ADC is enabled and I try to send data I get a HardFault error. The HardFault occurs exactly during ...
blankMCU's user avatar
0 votes
1 answer
2k views

What if you enable both DMA and Interrupt for a STM32 ADC

Imagine this scenario: You are using a timer driven ADC in DMA mode, nothing special. Now, because you are interested in having a Watchdog, you also enable the ADC Global Interrupt in CubeIDE (...
sauz's user avatar
  • 41
0 votes
0 answers
1k views

STM32F103C8 I2C BUSY flag reset

I'm using HAL to use I2C and somemtimes I'm getting HAL_BUSY flag, I read STM32F103 errata and added BUSY flag clear according this, i2c busy flag clear But I changed error handling little bit and is ...
user3473485's user avatar
1 vote
1 answer
545 views

STM32 with encoder

I'm using STWINKT1 board connected to encoder to timer 3. I want to get a interrupt every time that the encoder count is 300, so the code in the interrupt is: ...
Finci's user avatar
  • 11
0 votes
1 answer
87 views

Pointer to a reception buffer seems to have zero in all the other elements differents but the zero index , why with an STM32F401VE

how are you?. I'm having some trouble analizing streamed data. Recently I made a program that analizes streamed data and works for the first message of the stream as you can see in the following post ...
vram's user avatar
  • 158
1 vote
1 answer
99 views

Problem managing streamed data with struct pointers, some of the streamed data seems to be stored, some not with an STM32F401VE

I've recently been teached about how to manage streamed data in this case for managing commands, then my code is like the following explanation: I've programmed the uart2 to receive the streamed data ...
vram's user avatar
  • 158
0 votes
1 answer
388 views

Problems reading correct data from AD7746 using STM32 I2C HAL library

I am trying to read capacitance and temperature from the AD7746 capacitance-to-digital converter, using STM32F103 and HAL I2C library (SDA and SCL pulled up with 2k and Vcc = 3.3 V). I did it before ...
saleh's user avatar
  • 19
0 votes
1 answer
646 views

si7060 I2C temperature sensor with STM32 CubeIDE?

I am trying to read an SI7060. It's my first time using i2c and it doesn't seem to work. Do I make something wrong here? SI7060 datasheet ...
Tardief's user avatar
  • 67
3 votes
2 answers
649 views

Last address of program in STM32 HAL?

Is there a way to find the last address or last page of the program which is stored in an STM32(F1) using a HAL (or LL?) function? Background: I'm using EEPROM emulation in Flash and this works great....
Michel Keijzers's user avatar
0 votes
1 answer
1k views

STM32F103 bxCAN not working

I'm trying to make use of the bxCAN of STM32F103C8 on a bluepill but it doesn't work and I don't know what is the problem.I'm using the hal API here is the main code in the while loop ...
Jwdsoft's user avatar
  • 155
1 vote
3 answers
874 views

Boot problem with STM32 HAL, I2C HDD44780 and 1602 LCD

I'm using the following (relevant) combination: STM32F103C8T6 devboard (bluepill) 1602 LCD with I2C (HDD44780) STM32CubeIDE HAL Also I have a keypad and some other components attached, but these are ...
Michel Keijzers's user avatar
1 vote
1 answer
973 views

CMSIS without HAL

Is it possible to create a project in System Workbench for STM32 with CMSIS but without HAL library? My target microcontroller is STM32L053R8 on a Nucleo board. When I create a with HAL and delete all ...
Marco Svizzeri's user avatar
2 votes
1 answer
2k views

STM32 - HAL SPI receive interrupt not entering EXTI callback

I designed a breakout board for the STM32F401CEU6. (Schematic attached) I am using it to receive data from an ADC chip over SPI. The ADC chip has a data ready output which should be used as an ...
markos14's user avatar
3 votes
3 answers
4k views

STM32 L4 HAL_FLASH Writes in one function but not another

I am working with an STM32 L476RG evaluation board on a project. The goal currently is to utilize STM's mass storage library to write data to flash over USB. I've got the USB library working properly (...
kbrown323's user avatar
0 votes
0 answers
763 views

HAL SCCB Commuincation via I2C: HAL_ERROR Status

I am using an STM32f4 Discovery board to interface with an OV2640 Camera. When attempting to set the SCCB registers, I am using I2C. However, when doing a simple test I cannot connect to the device. ...
user avatar
2 votes
0 answers
1k views

stm32 does not exit sleep

When trying to implement sleep mode it appears the code enters and exits sleep mode once and then gets stuck in sleep mode after and will not wake back up. I posted some code below of what I believe ...
happyhappyhappy's user avatar
1 vote
0 answers
714 views

STM32 ADC & HAL - EOC selection for polling continiously

I will ask my question via linking some other question asked by someone. S/he got his/her answer on how to solve, but I am more interested on WHY? Thanks in advance. Link to the question: STM32 ADC ...
muyustan's user avatar
  • 2,056
0 votes
0 answers
3k views

Why HAL_I2C_Master_Transmit always returns HAL_BUSY?

I'm trying to use I2C between an STM32F103C8T6 development board and an Arduino Uno. However, I always get a HAL_BUSY error when I call HAL_I2C_Master_Transmit in ...
Michel Keijzers's user avatar
1 vote
1 answer
1k views

PWM output on pin using STM32F030K6T6, CubeMX, Attolic and HAL libraries

...
Eduardo's user avatar
  • 49
5 votes
4 answers
2k views

STM32 USB CDC: packet loss with active PC usage

I got a strange error in the USB CDC on the STM32F2. I use HAL implementation of the driver. The size of the buffer transferred in USBD_CDC_SetTxBuffer () is 4096 bytes. On the PC side, I accept the ...
Foxek's user avatar
  • 61
0 votes
1 answer
485 views

Why I can't change variable in it.c?

I have stm32vldiscovery project. I want to use external interrupt by PA0 (user button). When I press the button (PA0), then function EXTI0_IRQHandler must set ldOn equal 0. But ldOn always is 1. ...
Noisy88's user avatar
  • 31
2 votes
0 answers
3k views

STM32 HAL PWM output with DMA misbehavior

I use the Blue pill STM32F103C8T6 to generate variable duty cycle PWM with DMA and using HAL library. And stuck with undesired results. First, I generated code with STM32CubeMX v5.0.1, HAL v1.7.0, ...
Boroda's user avatar
  • 21
0 votes
1 answer
1k views

Reading STM32F timer value

I am trying to implement a hardware timer for STM32F and read the value from it. So far, this is my implementation: ...
Nil's user avatar
  • 3
1 vote
2 answers
2k views

Questions about DMX512 protocol/STM

I want to make a DMX512 transmitter with a STM32F103 using HAL, CubeMX. I found some documentation like here about the protocol: Lighting-Control-using-DMX512-protocol-on-STM32. Sadly it does not ...
Michel Keijzers's user avatar
1 vote
0 answers
939 views

driving WS2812B using DMA and timers

I am trying to port the octoWS2811 for STM32F103c8T6. This guy hubmartin has already done the heavy lifting and created a library using STM32 HAL. But the problem is that i am unable to get it to ...
Rejin Jacob's user avatar
0 votes
1 answer
633 views

CAN via SPI over STM32F103C8T6

Since I could not get CAN to work with the internal CAN of an STM32 (F103C8T6), I bought a few CAN boards working with SPI, like these: However, when I send something I get the following results ...
Michel Keijzers's user avatar
0 votes
1 answer
6k views

SMT32 HAL UART crash on possible overrun

I increased my baud rate from 56000 to 115200 and my serial communication stops working when pinging continuously after 10-20 seconds. I am running at 16 MHz. As far as I know HAL driver will handle ...
Carlos's user avatar
  • 133
0 votes
1 answer
2k views

How to get a Timer started without interrupt?

I use an STM32F103c8t6. What I want is to measure time between several statements. I found out HAL_getTick does not work since the resolution is too small (1 ms). However, I cannot seem to initialize ...
Michel Keijzers's user avatar