Skip to main content

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
0 votes
1 answer
41 views

Problem with STM32MP1 SPI using DMA

When running some simple code to test the SPI communication using DMA, the program only works as expected after stopping and restarting the microcontroller. The first time it runs, instead of sending ...
Fábio Silva's user avatar
0 votes
0 answers
43 views

stm32H7 SDMMC1 Falling and rising edge

I'm trying to make my sdmmc1 project read cmd data by rising edge, what i have tried: Tried both hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING; and hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_FALLING ...
KlimDuda's user avatar
0 votes
2 answers
607 views

HAL_SPI_TransmitReceive not working properly

I am trying to use HAL function to drive SPI to read analog voltage from external ADC (adc128s102). I see what I expect to see in first 16 CLK with MISO(Blue) and MOSI(Yellow) line. But what's causing ...
Alia Sana's user avatar
1 vote
2 answers
159 views

How can I get roll, pitch, and yaw data from an ISM330DLC sensor?

I have code to receive data from both the accelerometer and the gyroscope in X,Y Z axis. According to the datasheet, those are two's complement data. The data read by registers. Can you make sure that ...
Nimms's user avatar
  • 11
1 vote
2 answers
615 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
110 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
154 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
  • 229
0 votes
0 answers
112 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
76 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
77 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
193 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
382 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
  • 43
0 votes
0 answers
116 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
213 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
518 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,217
4 votes
1 answer
1k 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,508
0 votes
1 answer
127 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,811
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,811
1 vote
1 answer
941 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
5 votes
3 answers
4k 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
1k 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
  • 160
0 votes
0 answers
66 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
  • 69
3 votes
2 answers
845 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
779 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
823 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
3k 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
  • 61
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
638 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
104 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
150 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
448 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
  • 29
0 votes
1 answer
710 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
  • 77
3 votes
2 answers
890 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
963 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
1k 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
5k 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
799 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
817 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,106
0 votes
0 answers
4k 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
3k 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
570 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
2k 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
992 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