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.

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.

See Wikipedia's article on Hardware Abstraction Layers for more information.

52 questions
5
votes
0 answers

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 Question How can I control the slave ACK…
tweak
  • 51
  • 3
5
votes
4 answers

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 data in the terminal. The problem is as follows. I…
Foxek
  • 61
  • 4
4
votes
1 answer

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. There is basically nothing else on the PCB, it's as…
Chupacabras
  • 5,394
  • 2
  • 23
  • 50
4
votes
3 answers

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: __weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { /* Prevent unused argument(s) compilation warning */ UNUSED(GPIO_Pin); /* NOTE:…
3
votes
2 answers

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 is so much more readable than my own bare metal…
JeromeBu1982
  • 315
  • 2
  • 9
3
votes
2 answers

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. I changed the library from a hardcoded page to…
Michel Keijzers
  • 13,867
  • 18
  • 69
  • 139
3
votes
2 answers

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 (simply reading and writing data from/to RAM as a…
kbrown323
  • 61
  • 1
  • 8
2
votes
1 answer

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 while making some changes and tinkering. The…
Suva23
  • 33
  • 5
2
votes
1 answer

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 interrupt pin to tell the MCU know there is data…
markos14
  • 21
  • 5
2
votes
0 answers

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 affects the sleep function. I want the code to…
2
votes
0 answers

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, with TIM1 configured to generate PWM on channel 1…
Boroda
  • 21
  • 1
  • 2
2
votes
1 answer

STM32F4 I2C Address Timeout

I have here a Problem with an I2C bus configuration, that runs in a timeout after a certain time. The I2C slave is a fujikura ap4/ag4 pressure sensor and the master a STM32F4. I read continiously the pressure and after around 5-10min, a timeout…
Hans
  • 51
  • 1
  • 3
1
vote
0 answers

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 essential, that is if the VREF+ should go above 2.5 V, it…
tronhawk
  • 23
  • 5
1
vote
1 answer

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 circular mode with Peripheral-to-Memory mode with length…
Alexey
  • 33
  • 4
1
vote
1 answer

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 __HAL_I2S_ENABLE(&hi2s2); the clocks must begins, but I sense 0v at CK and…
mohammadsdtmnd
  • 545
  • 3
  • 17
1
2 3 4