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.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

MCU Package of STM32f1 series for stm32CubeMX

I am trying to download MCU Package of STM32f1 series for stm32CubeMX from the following link: https://www.st.com/en/embedded-software/stm32cubef1.html But the given link sends this messege that the ...
1
vote
1answer
59 views

NAK in CAN bus for STM32F3 uC

I have a problem with the NAK on the CAN bus. On STM32F303RE I wrote a code for communication via CAN bus with car dashboard (Instrument Panel Cluster). The communication works, I manage to receive ...
0
votes
2answers
98 views

Sine Wave generator with DAC

i want to create a 40KHz sine wave with a STM32 Controller and an external DAC. I created my SPI connection to the MCP4922 and sending a sine wave table to it. The init function of the SPI interface ...
0
votes
1answer
147 views

How to wake STM32F103 by RTC using HAL libraries / Registers?

I've started digging into STM32F103 using HAL Libraries and raw registers. It's the first time to program at such low level. Anyway following a video I've successfully implemented "Standby" mode. ...
0
votes
1answer
111 views

Difference between I2C STM32 HAL functions

I'm using I2C in a project on STM32, and i was wondering what's the difference between HAL_I2C_Master_Transmit and HAL_I2C_mem_write, and the difference between HAL_I2C_Master_Receive and ...
0
votes
1answer
61 views

Accessing MCP4451 Digital Pot with STM32 using HAL for i2c?

I am using an STM32 NUCLEO-F042K6 dev board to interact with a MCP4451 digital pot. I want to be able to adjust the wiper values through i2c. I am using the STM32CubeIDE and the HAL library to ...
0
votes
0answers
32 views

Order of disabling in `HAL_TIM_IC_Stop_DMA` function -STM32 HAL library-

Here is the function body of HAL_TIM_IC_Stop_DMA: ...
5
votes
1answer
90 views

Large delay between I2C messages on STM32F303 - trying to read as fast as possible

I've got a sensor that I'm reading via I2C. My end goal is to be able to maximize the rate at which I can take these readings. In order to read, I have to write an zero-byte I2C message to the slave ...
0
votes
1answer
154 views

Do I really need to learn how to use registers - Programming a microcontroller? [closed]

I have a curious question. Do I really need to learn how to use registers when I program a microcontroller? I have been using Arduino for a long time. I quit using Arduino and starting to use STM32 ...
0
votes
0answers
144 views

HAL Library CAN Bus interrupt sources and callback functions

Im using STM32F407 Discovery board and HAL library in CAN bus(CAN1) Some receive interrupts used with callbacks (for example receive interrupt...
0
votes
0answers
255 views

STM32H7 on-chip temperature sensor reading stable on 'Y' revision, but unstable on 'V' revision chip

using the STM32H753VIT6, I like to monitor the on-chip temperature sensor. The environmental temperature can become about 50 degrees Celsius, and the board is housed is a small plastic (DIN-rail) ...
0
votes
1answer
138 views

Where does STM32CubeMX generate AF GPIO initialization?

i was wondering where does CubeMX (when you export it to an IDE such as Atollic) generate GPIO initialization for alternate functions such as Timer capture pins, UART pin ect. (we are talking about ...
0
votes
1answer
170 views

Clarification on interrupt triggered DMA transfer in an STM32

I'm trying to learn about DMA and its use in the STM32L4S9VI platform. One thing I'm confused about is what binds the DMA transfer to any one specific interrupt? In the below example, I'm curious ...
1
vote
3answers
3k views

STM32 RTC with HAL libraries

I am working on stm32l053 (nucleo 64) and I want to track time with integrated RTC. Since I am quite new to stm32 development I am using CubeMX and HAL libraries. My problem is that the time is not ...
1
vote
0answers
98 views

USART6 STM32F746NG isn't working

I'm having trouble configuring the USART6 in my STM32F746NG. I am setting up the USART6 to enable UART comunication, using the code below to initiate it and also create an echo function. ...
3
votes
4answers
540 views

How to use libraries with delays inside within a time critical STM32 HAL application?

I want to use a library for an LCD for STM32: LiquidCrystal, and possibly some other libraries. I noticed this library is full of HAL_Delay calls, not only during initialisation but also during ...
1
vote
2answers
384 views

Inconsistent SPI communication between STM32F4 (Slave) and Raspberry Pi (Master)

I've been having a very specific issues with large SPI transaction and after few days of debugging and trying different approaches I haven't progressed anywhere. To briefly explain the system: Slave: ...
0
votes
0answers
328 views

STM32L4 External SPI NOR FLASH WinBond W25Q80DV

I am attempting to communicate with a winbond memory chip over SPI with the STM32L4VG. I am first just trying to read the manufacturing ID and my results are never consistent. Running the same code ...
1
vote
2answers
1k views

STM32F3 I2C hangs on busy flag (interrupts)

I am using two STM32F303K8 Nucleos and hooked up the SDA/SCL (GPIO B PIN 6 & 7) pins to 3.3V across roughly 4.7K resistors to 3V3. When I check the voltage on the pins, both are 3V3 so it's not ...
0
votes
1answer
255 views

STM32F746 - DISCO I2C HAL_TIMEOUT

I am attempting to implement I2C interface on the STM32F7-Discovery Board using the a VEML 6070 UV light sensor (https://www.vishay.com/docs/84277/veml6070.pdf). The 7-bit slave address for the ...
0
votes
2answers
330 views

Reliability of STM HAL driver For Safety Critical Application

I'm working on a project which must be used in an automotive application and act as a node into the multiplex CAN-BUS network. There are number of I/O that must be actuated and some of them had a ...
0
votes
1answer
507 views

STM32CubeMX HAL vs CMSIS

If I generate code using STM32CubeMX then which files are related to CMSIS and which files are related to HAL? My toolchain is Atollic TrueSTUDIO.
1
vote
2answers
381 views

STM32F407 - ADC in Scan mode setting overrun bit

I want to read 4 ADC channels in continuous scan mode. I am using ADC interrupt to read from the ADC data register. Here is my initialization: ...
1
vote
1answer
225 views

STM32L0: Fast processing of an analog sinusoidal signal

I have an embedded system based on a STM32 ARM Cortex M0+ microcontroller (STM32L051K6) and want to use it to convert an analog sinusoidal input signal into a digital pulse signal and do some SW ...
0
votes
1answer
147 views

CubeMX HAL Libraries state or stateless [closed]

I wonder if the STM32F4 CubeMX peripheral HAL libraries saves the internal state of the peripherals OR if they are stateless? I am concerned about this because I want to know the possibility and ...
0
votes
3answers
748 views

STM32 HAL driver for register value update

I am new to HAL drivers and STM32 MCUs. Can anyone tell me how to use HAL drivers to update register values of STM32F407 MCU? I have to programatically update the values of ARR and CCR registers of ...
0
votes
0answers
954 views

STM32 HAL UART receive timeout interrupt

I'm developing a software for the STM32l432KC (NUCLEO-L432KC) which uses 2 UARTS with DMA (RX DMA mode to DMA_CIRCULAR) using HAL. My problem seems to be quite common: the UART buffer length is ...
0
votes
1answer
664 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 ...
3
votes
2answers
312 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
381 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
169 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
215 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
199 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
1k 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
556 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
522 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
318 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
571 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. ...
3
votes
1answer
468 views

Coding style in STM32 HAL code

While I was reading the STM32 HAL drivers for timers I found this macro: ...
2
votes
1answer
903 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
1k 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
1answer
673 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
2k 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: ...
4
votes
4answers
3k 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
509 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
7k 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
3answers
2k views

__HAL_TIM_GetCounter with STM32F103

I found a lot of tutorial to get counter value from an interrupt timer something like: ...
1
vote
1answer
212 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
360 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
1k 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 ...