Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [hal-library]

The HAL drivers include a complete set of ready-to-use APIs which simplify the user application implementation. It was developed by STMicroelectronics for STM32 microcontrollers.

0
votes
1answer
46 views

STM32L476 Discovery ADC output is not changing even though the input voltage is

The output value of the ADC seems to flicker between 539-549 (in a range of 0-4095) no matter what voltage is on the input pin. The voltage on the input is usually between 0V - 4V. This might be a ...
0
votes
0answers
24 views

STM32F072 TIMER PWM + DMA : Not working as expected

I am using TIMER2 + CHANNEL 2 PWM to generate 800 Khz wave. The idea is to vary the duty cycle of this wave as per a statically generated pixel bit array (1 SK6812 pixel = 32 bit GRBW = 32 bytes of ...
3
votes
2answers
132 views

Multiple(five) alarm time setting in stm32f0 mcu

I am working on my hobbyist project and need to develop the alarm timings. And RTC and Timer are new for me and I am confused in RTC Alarm time setting. I need to make alarm with RTC for five ...
0
votes
1answer
33 views

STM32F091 timer as a prescaler for another timer

I would like to chain two 16-Bit timers to each other to make a 32Bit timer. Just like the example in the datasheet [RM0091 figure 147 page 429] but with different timers. I found these two sites: ...
0
votes
1answer
49 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: ...
1
vote
0answers
60 views

STM32F4 ADC oscillating

I am trying to read the ADC of a STM32F4. The code skeleton was generated by CubeMX, the HAL library is used. The read values are feasible but have periodic noise, as seen here: The plot was ...
0
votes
1answer
54 views

strange RFM95 SPI behaviour with STM32L4 [closed]

I am using CubeMX and HAL to program an STM32L4. I am trying to communicate with RFM96 module using SPI, but I am getting nonsensical results. According to the RFM96 datasheet, in order to read a ...
0
votes
2answers
111 views

STM32F103 PC13 on Output mode not work

I using STM32F103C8, I want to use PC13 in GPIO mode (RTC is active). The register ODR13 changes, but the logical value of the PIN does not change. ...
0
votes
1answer
124 views

STM32 UART character encoding issues (can't decode using either ASCII or UTF-8)

first some specifics: STM32F411 Nucleo board, Atollic TrueSTUDIO v9.1.0, Debian linux 9.6. I am sending a telemetry string over the UART using the HAL. I am using the following code to construct ...
2
votes
2answers
144 views

STM32F722ZE SPI communication with LSM6DS33 using HAL

For a long time I can not read the correct data from the LSM6DS33 control register (accelerometer + gyroscope). As I read in the datasheet, the control register address WHO_I_AM is 0x0f. In order to ...
0
votes
1answer
88 views

STM32F4 struct unnamed has no field brr

I'm a newbie to STM32 coding and struggling with the following: I used to code a little bit with STM32F103C8T6, using cubeMx and HAL libraries. I made a code using the following code to set the pin ...
0
votes
1answer
176 views

STM32F103 USB CDC [closed]

I have a strange problem with USB CDC mode in STM32F103. I have designed PCB with STM32F103 microcontroller and an accelerometer which streams data through USB to PC. I have used STM32CubeMX wizard. ...
0
votes
0answers
369 views

STM32L433 Idle + DMA UART Receive not receiving the expected number of bytes

I am currently having an issue with receiving long packets over UART using DMA on a STM32L433 MCU. The UART is set up to interrupt when the line goes IDLE and I then process the newly received byte ...
3
votes
1answer
144 views

Coding style in STM32 HAL code

While I was reading the STM32 HAL drivers for timers I found this macro: ...
1
vote
1answer
123 views

STM32: Difference between HAL_xxx_Init() and HAL_xxx_MspInit()

When using the HAL (Hardware Abstraction Library) for any of the STM32 micro controllers: For a given peripheral, why do you have to call an HAL_...init() , as well as a HAL..._MspInit() - why are ...
0
votes
1answer
364 views

STM32 I2C Read Variable Length message from Slave

I have two devices that must communicate over I2C. The master writes some data to the slave, and then it must read back a response from the slave. Neither the slave nor the master knows the length ...
0
votes
0answers
163 views

Changing PWMs parameters on STM32 board

I am trying to change the values of Prescaler, Autoreload and Pulse of PWM using Serial communication on a stm32 Nucleo-F091RC. For the most part I am able to do so since the below code works fine: ...
0
votes
1answer
229 views

STM32F1 Flash erase not erasing

Hello everyone, I am trying to write in the FLASH of my STM32F1, but for some reason it is not working ... Whenever I am programming something, it wil return an error : HAL_FLASH_ERROR_PROG which ...
1
vote
2answers
416 views

Timer1 on stm32f4

Im giving a try to stm32 after a long time programming on avr, and seems like im struggling with timer. I want to use timer for handling freezes: ...
3
votes
3answers
910 views

CAN communication not working

I made the following circuit. STM32's are STM32F103C8T6 (Blue Pills). I left out the obvious wires: All four components grounded together Supplied 5V to RX TJA 1050 from RX STM32 Supplied 5V to TX ...
1
vote
1answer
356 views

Difficulty in reading the registers using the I2C

It is necessary to obtain the values of angular velocity of the gyroscope module on "Amperka" board. But even to read the identifier register, returned incorrect answers. Already the day is spent and ...
1
vote
1answer
2k views

How to receive bytes from SPI with interrupts using HAL on STM32?

Background I am trying to make a SPI connection between two STM32F103C8T6's. Measurements According to my logic analyzer I get a signal that looks ok (sending 10 bytes with values 0x55): Results ...
1
vote
2answers
262 views

__HAL_TIM_GetCounter with STM32F103

I found a lot of tutorial to get counter value from an interrupt timer something like: ...
0
votes
0answers
394 views

MPU6050 Interfacing with STM32

I m trying to interface MPU6050 Gryo+Accelerometer to STM32F303RE but I can't figure out how to program it using the HAL Drivers and CubeMx.Can some suggest some literature or material which I can ...
1
vote
1answer
113 views

LTC4015 variable i2c speed operation

I am planning to use LTC4015 IC for buck charger application . I have to interface the IC with my host MCU. LTC4015 PRODUCT PAGE I have other charge controlller ICs connected over same I2C bus. ...
0
votes
1answer
158 views

PWM on Nucleo-STM32F103RB

I'm trying to just get timer based PWM output working on the F103 Nucleo board and I can't get the MCU to output anything. I spent a decent amount of time looking through the examples in the related ...
1
vote
1answer
388 views

STM32L1xx HAL_GPIO_Init Problem

I am developing an application for a University project on my STM32L1DISCO board with the STM32L152RC MCU. I have configured the pins and generated the init code via STM32CubeMX. I am using Atollic ...
0
votes
0answers
161 views

STM32F0 interfacing with ISL29125 using I2C

I've been trying to interface the ISL29125 sensor with STM32F0 using the HAL library with I2C and have had no luck. All I am trying to do is to read the device ID, but I keep receiving an AF error. ...
3
votes
3answers
226 views

PIC32 GPIO pins Hardware Abstraction Layer question

I am attempting to write a Hardware Abstraction Layer (HAL) for a PIC32 (PIC32MX664F128H to be precise), in which I can use generic defines for the ports in question without having to use the exact ...
0
votes
1answer
351 views

MPU9255 without lib on STM32

I have a code on Arduino to read the data from MPU9255 with no libraries, using it direct through I2C. I am trying to do the same on Keil uVision with Bluepill, just to learn how to use I2C with HAL ...
0
votes
0answers
2k views

STM32 - SPI Slave - Using Hal Drivers - Unreliable TXRX and Slow Initialization

I will first describe what I am trying to accomplish, what I have tried, and how it is not working; any help/advice is greatly appreciated. I have an external MCU (Particle Photon) acting as the SPI ...
1
vote
1answer
1k views

HAL I2C hangs, cannot be solved with standard routine use to unlock I2C

I have a problem with an I2C bus on a STM32F4, that get locked pretty fast after startup. The SDA line get hold low the whole time and the SCL line high. So this looks like a standard I2C bus lock to ...
0
votes
1answer
71 views

Does STM32CubeMX assist in creating STM32L0 firmware for communication with smartcards?

I need to create STM32L0 firmware for communication with a smartcard (ISO 7816). I will use Tx pin from USART2. Is STM32CubeMX helpful for setting smartcard related stuff?
0
votes
0answers
649 views

How to stop and restart USB device for STM32

I'm trying a project using stm32f103 with cubemx as usb hid device. What I want to do looks really easy: once a button is pressed, the chip works as a different hid descriptor. something like this: ...
1
vote
0answers
319 views

interfacing tcs3200 color sensor with STM32f746zg

I want to interface TCS3200 color sensor with STM32f746ZG. Since the TCS3200 outputs a frequency based on the amount of light received, I need some way to count the number of pulses for different ...
0
votes
3answers
563 views

STM32 SPI SCLK stops ticking

I have STM32L052K8T6 (master) and I am trying to communicate with AD7124-4 ADC (slave) via SPI. My problem is that STM stops transmiting clock pulses on SCLK immediately after it transfers all data ...
0
votes
0answers
330 views

Output voltage with DAC (via I2C) - stm32

I would like to have an output from my DAC programmed by the STM32, using the I2C protocol. I have some problems.. mC: Nucleo-F303RE DAC: MCP47FEB11A0-E/ST datasheet: http://www.mouser.com/ds/2/268/...
1
vote
0answers
551 views

STM32F103 reading value from lightsensor by I2C

I'm trying to read value from sensor GY-30 BH1750 by I2C but when I check variables in STM Studio, they don't change. Sensor address is 0x23 when addr connected to GND POWER_ON 0x01 RESET 0x07 ...
0
votes
0answers
1k views

STM32 HAL SPI DMA multi read sensor

I would like to read out a sensor over SPI using the DMA. Since the sensor has some noise, I would like to take the average and so I need to read out the sensor several times. For this I decided to ...
1
vote
0answers
1k views

Getting UART Overrun Error with HAL_UART_Transmit() vs HAL_UART_Transmit_IT()

On my main board I have a STM32F103ZET6 and I use HAL library V1.6 in order to program it.There is also a sensor board which is connected to my main board and this sensor sends me data through UART ...
1
vote
1answer
15k views

STM32 HAL Implementing UART receive Interrupt

I have trouble in implementing the USART RX on a stm32f303k8t6 with the HAL libraries. What I actually want to achieve is, that I can send a variable length string over the uart bus and decode the ...
2
votes
1answer
312 views

Can you measure the frequency via interrupts when the pins are used by an encoder? SMT32F4

In order to calculate the current speed, one option is to read the current position every 20ms. The average speed is position_old minus position_current. This works well if there are many pulses per ...
4
votes
1answer
3k views

STM32 HAL UART Transmit DMA problem

After setting up my project for a custom STM32F7 board which includes a FT2232H UART<->USB converter I got multiple problems when sending (and receiving data). The code I use is mostly generated by ...
2
votes
2answers
833 views

Why Cubemx use 0x32F2 as an indicator for the RTC configuration?

I've created a program with activated RTC peripheral by cubemx. After analyzing the code and searching in the internet, I found out that the reason of writing 0x32F2 in RTC_BKP_DR1 is for checking ...
0
votes
2answers
515 views

How to check overrun?

I'm using an STM32F103C8T6 (aka blue pill) with Eclipse/System Workbench and HAL. The following code: ...
1
vote
1answer
1k views

STM32 interrupt does not fire

I'm using an STM32F103C8T6 (aka blue pill). GPIO Init and interrupt handler: ...
0
votes
1answer
903 views

STM32F103. How to use PB4 as normal GPIO? NJTRST remap not working

I need to use PB4 as a normal GPIO digital output pin. I have a custom designed board where this pin is connected to the CS of a SPI device, so just using another pin isn’t possible. I’m using the ...
-2
votes
2answers
1k views

where can I found STM32L4 DSP and standard peripherals library? [closed]

I want to use standard peripherals library for stm32l476rg(stm32-nucleo). But I could not find it. I dont want to use HAL Library. Do you any suggestion?
1
vote
1answer
383 views

I get the same value, when read via i2c - stm32 + hih6030

I want to use my HIH6030 humidity and temperature sensor with my STM32F4 board, but I have the following problem: I turn my board on and start debugging. The first time when I try to read out it's ...
0
votes
1answer
6k views

How to use SysTick_Handler (an HAL library function) in order to have a time base

In actual I need to measure speed of motor. I have followed a procedure, i.e use Encoder mode to get pulses from sensor. count number of these pulses in 1 sec~1000msec using SysTick_Handler(ISR). ...