Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
F. U. I.: I would like to read sensor data from my accelerometer (MPU 6050) with the I²C-protocol.My aim is to present the sensor data on my laptop via /dev/ttyUSB0, but no data reached my USB TO TTL-Adapter.Attached you will find the code snippet and a photo. (1)I get no sensor data via I²C to my STM32F411.What is wrong there?The init-functions seems to be right, but the I2C_byteRead() gives no data back.(2)I would like to send my sensor data to PA2 (USART2, TX).How can I realize this per code? Thank's a lot. GreetingsTIMBO#
Hi I am trying to read a report of USB HID device from my STM32 USB Host code.I am able to read the report descriptor successfully from USBH_HID_GetHIDReportDescriptor call.I wanted to read the 0xD0 report value using if(USBH_HID_GetReport (phost, 0x01, 0x07, HID_Handle->pData, HID_Handle->length) == USBH_OK)However, I see only 4 bytes of data in HID_Handle->pData while all others are zeros.Please find the attached the report descriptor data.Can someone tell me the correct way to use USBH_HID_GetReport function and expected
So where exactly does the documentation say that different FIFOs can't be accessed simultaneously?In dervice mode, an In endpoint was configured to transmit one 16-byte-long packet, and then 16 bytes (i.e. 4 words, 72 43 70 A4 D9 99 55 2E 19 7F 32 37 13 EB B6 7E) were being written to the endpoint's Tx FIFO, in "main" (and instrumentation and logging confirmed they were indeed written to the FIFO all, as 4 words), when the USB interrupt kicked in and it read from the Rx FIFO. The result on the bus was:So what we see here? The USB core decided to transmit the first 5 bytes, 72 43 70 A4 D9, and appended the CRC calculated from the first 4 bytes of these 5. Naturally, host refused to ACK this. Core retried 2 more times, and the apparently gave up, inserting a zero-length DATA0 packet at 475 607 517ns (not expanded on that view, sorry). Then the USB core skipped 3 bytes (I'd say, in the first case it took 2 words, but used only one byte of the second word) and then transmitted one byte, wi
I have used followingProjects/NUCLEO-H563ZI/Applications/USB_Device/CDC_Standalone/USB_Device library.for STM32U575 Series controller (USB OTG FS) which is easily enumerated and running data at 1 mbps speed with good stability. But same library I used for "NUCLEO-U5A5", (USB OTG HS) , configured clock and PHY for OTG HS - which is getting enumerated successfully also but not stable , and sometimes getting disconnected and PCD_IRQ is not triggering sometimes. Is OTG_HS has something different or missing something or core difference , when compared to OTG_FS used in stm32u575 ? kindly guide.
Hi i am using Nucleo - F413ZH i need to work on the QSPI protocol i found this device supports QSPI but in the repository i doesn't find any example code for this one is this device supports QSPI? or is there any similar sdk so that we can import projects form other repositoryI tried with the example code present in the STM32F413H-Discovery repository but i doesn't got output
"I configured my STM32F429 with USB HID class communication in CubeMX. After generating the code, I'm having trouble detecting the USB connection on my PC. I've tried debugging and the MX_USB_Device_Init function works correctly, but in the condition that checks if the dev_state has reached 3 for proper configuration, the code gets stuck. How could i solve it?"
Hello, I am currently working on an audio project involving an STM32-based audio player and sound card, utilizing the STM32H723ZGT6 microcontroller, USB3320 USB PHY, and ES9039Q2M DAC. Inspired by impressive projects seen on DiyAudio and GitHub, such as OpenUAC2, and finding a wealth of useful information within the STM32 community, I still have some questions that I hope someone can help answer. To implement the UAC 2.0 protocol, I need to calculate the asynchronous feedback endpoint. Based on my research, this can be done by monitoring the remaining capacity of the FIFO buffer (as TinyUSB does) or by using a timer peripheral in conjunction with the USB_SOF signal. Specifically, a common approach is to connect the external ETR pin of the timer to the WS (FS/LRCK) or audio clock source/MCLK and then calculate the time difference between the SOF and ETR signals. After reviewing the STM32H723ZGT6 reference manual, I found that the USB_SOF signal is an internal interrupt for TIM
Hi Pascal, We have designed a custom PCB, and I’m attaching the schematic for your reference. Since we don’t have a dedicated UART, we have not enabled trace embedding. We are using X-CUBE FreeRTOS 1.3 with STM32U575VGT6. The USB dual-role functionality worked correctly when tested on the Nucleo board (STM32U575), but it is not working on our custom board. We encountered the following errors: OS_CAD_PRIORITY OS_PE_PRIORITY DPM_Sleep_start I have attached the error message and code files. Please check and guide us on resolving this issue. Thanks & Regards, Rajkumar.
What causes the HAL_ADC_PollForConversion to return a HAL_TIMEOUT?
Hi,I am having a lot of issues trying to port MbedTLS in my board B-l462e CELL1. I am trying to use the cellular project from X-Cube-Cellular and integrate MbedTLS to be able to connect to AWS. I can't find it in the CubeMX so I figured I need to port it manually. However, I am not sure what I am doing wrong. I can install WolfSSL from cubeMX and was considering that after failing to port MbedTLS. I have imported coreMQTT and coreJSON from AWS embedded C SDK as well.I have enabled AES and RNG in the CubeMX and not sure if I have configured things properly. I tried to follow the documentation from MbedTLS on how to port in another OS or environment but I must be missing some things. Attaching my project below for reference. Any useful link or guidance will be appreciated.Thanks & Regards,
Hi All,I wanted to implement functionality for the volume up/ volume down/ mute etc.I Got the keycodes for those buttons in USB HID Usage table .volume up = 128volume down = 129mute = 127 but it wont works in My USB HID keyboard code How to implement this functionality Regards,STAR
STM 32L 051 use HAL_RTCEx_SetWakeUpTimer_IT() to wake up standby mode,it is work well.when the wake up source is not RTC(maybe wkup pin or NRST pin) ,how get the remaining time of RTC timer?The value of HAL_RTCEx_GetWakeUpTimer() is not change.it is the value of HAL_RTCEx_SetWakeUpTimer_IT() set.
Hi,I configured the STM32U5G9 DSI Host peripheral in Video mode (with Burst) using CubeMX. Next, I need to send display-specific commands to configure the DSI display registers (not the DSI Host peripheral) using HAL_DSI_ShortWrite(). Does the DSI Host peripheral on the STM32 require any specific configuration in CubeMX to allow the transmission of LCD controller initialisation commands to the display using HAL_DSI_ShortWrite() (commands like 0x11 for SLEEP_OUT or 0x29 for DISPLAY_ON)? For example does the DSI Host need to be configured in Command mode first to send the configuration commands and then switch to Video Mode? Or does HAL_DSI_ShortWrite() work even when the mode is set to Video With Burst? Thank you :)
Good day,I've been working on getting an external adc on the nucleo H755ziq to work at max speed. The adc can reach up to 1 million samples a second with a clock cycle time of 10ns. Problem is that it's only seeming to go at a speed of 60ns per clock cycle. Spi is set at 200mhz with a /2 prescaler on an external 48mhz crystal. Any idea why it's getting this 60ns speed instead of 10ns? Ive set the GPIO for spi to very high speed as well encase that was the issue.
I have 3 boards of stm32 customized boardFrom one board iam using uart to flash IAP code and application code.By uart I take data for other data and transmit through CAN PROTOCOL and that data (application code) I need to flash code to the other board .is it work or notBy can communication Is it work Plz help me
In my setup, I’m using Comparator 6 (COMP6) on the STM32G474 microcontroller. The non-inverting input of the comparator is connected to a burden resistor from a current transformer, which measures current flow. The inverting input is tied to a fixed 1.5V reference created by a voltage divider. The goal is for the comparator to disable all PWM signals (generated by HRTIM TimerA) when the burden resistor voltage reaches 1.5V, indicating an overcurrent condition (e.g., 10A).Issue: Despite the burden resistor voltage hitting 1.5V at 10A, the comparator does not trigger, and the PWM remains active.
Currently, I am trying to display the time in hours and minutes via a 4 digit7-segment common cathode display however I am running into a problem. For example, when I try to display the time "4:09" the UART output is correct from the DS2321 RTC module I'm using but the 7-segment display only shows the last digit 9 across all 4 segments. My issue is with my function "void Display_7Segment where even when testing two segments at a time it still displays the same number for both segments despite writing to different pins (pin7 is digit 1, 8 is digit 2, etc.).I'm using a Nucleo L476RG with an internal clock PLLCLK of 80mHZ, all segments and digits are set as GPIO pins, I2C is used for the RTC, and USART2 TX and RX is used for the PuTTy terminal output: #include "main.h" #include "uart.h" #include <stdio.h> #define DS3231_ADDRESS 0xD0 // Address of the DS3231, see page 16 of the datasheet. I2C_HandleTypeDef hi2c1; UART_HandleTypeDef huart2; void SystemClock_Config(void); sta
@MM..1 @Tesla DeLorean Hi! I am getting this error and not being able to find out why. I've looked online and haven't found an answer either.I have some #defines in my header file and for some reason I it is like my source file can't see these definitions. I've done just the same for all my other files and all of them work, however this one gives me: Type 'Button' could not be resolved.I checked if there is a type, but everything seems to be correct. Any chance someone could help me? Thank you!! (I am using STM CUBE IDE)
So,I've been trying to get the STM32 Lwip example working on a custom board ( STM32H723VGTX ) but could not get it working. My custom board uses KSZ8081RNB.I referred to the link : https://community.st.com/t5/stm32-mcus-embedded-software/stm32h745-not-works-with-ksz8081rna/m-p/95822#M4006Can you please help confirm if everything is configured correctly from the software side? Here is what I did so far :I took the LWIP example ( Link here )and ran it on Nucleo H723ZG BOARD and it worked solid. Great!The same project, I modified the .ioc file to change the MCU name, model and pin to 100. Because, it's literally the same chip with difference only in the number of pins. The .ioc settings is literally the same. (See below screenshot) when I compared the .ioc file. The above project is set up to run a tcp echo server. in the custom board, I can the Lwip initiaises succesfully, so I believe the hardware is okay and can see in the software break points that it is listening
Hello, Good morning all,I am doing a project with STM32F407VGT6 and DP83848 Ethernet Controller using LWIP stack. My requirement is UART/USB to Ethernet. I have enabled global interrupt and IRQ Handlers for both USB & UART, but when I send data from UART/USB RX interrupt is not enabling by MCU. Please suggest me the solution to enable USB/UART interrupt for receiving data.Thanks and regardsSatyanarayana
Hi all, I was able to make the qdec on timer1 run and read pulses from an external encoder. Now I wanna generate an interrupt after let's say 100 pulses. That interrupt should toggle a led I mean the timer has interrupts, but i don't know how to use them in Zephyr. That is my timerconfig in the devicetree: tim: &timers1 { compatible = "st,stm32-timers"; reg = <0x40012c00 0x400>; clocks = <&rcc STM32_CLOCK(APB2, 11U)>; resets = <&rctl STM32_RESET(APB2, 11U)>; interrupts = <44 0>; interrupt-names = "cc"; st,prescaler = <0>; status = "okay"; qdec: qdec { compatible = "st,stm32-qdec"; status = "okay"; pinctrl-0 = <&tim1_ch1_pe9 &tim1_ch2_pe11>; pinctrl-names = "default"; st,input-polarity-inverted; st,input-filter-level = <15>; // FDIV32_N8-->15: Fs = F_clk/32, N=8 st,counts-per-revolution = <700>; st,encoder-mode = <1>; //??????? }; }; Code to read the pulses: c
Moved from MPUs section - STM32F103 is an MCU.Hello,Are there any Application Notes in STMicroelectronics on the use of the Universal serial bus full-speed device interface (USB) at the register level (without HAL or other libraries) in STM32F103 microcontrollers?
Hi everyone,I’m working on two different projects, one using STM32H747IIT6 and the other using STM32H723 series. I want to implement a firmware update mechanism for both. Both of them have webserver LWIP interfaces. I can implement update mechanism to webserver.One of my projects has an SD card slot, while the other does not. Both designs include external flash memory.I'm looking for guidance on:Best practices for implementing a robust and safe bootloader.Recommended approaches for handling updates with and without an SD card.How to minimize failure risks during firmware flashing.Any insights or references would be highly appreciated. Thanks!
Is it possible to synchronize two separate pairs of HRTIMER channels using the HRTIMER Master?My goal to is to synchronize HRTIMER_E with HRTIMER_C and HRTIMER_F with HRTIMER_A. Each HRTIMER pair needs to operate independently of each other.The reason for this is as follows: HRTIMER_E1 and E2 control a resonant converter. A fault coming from COMP6 (hrtim_flt3) needs a blanking source, which can only come from HRTIMER_C, therefore these timers need to work in sync. HRTIMER_F1 and F2 control another resonant converter, where a fault coming COMP2 (hrtim_flt1) needs a blanking source that can only come from HRTIMER_A.The two resonant converters work independently, so the syncing of the timer pairs needs to be independent.A workaround is to use external event capture instead of the faults to keep the blanking source within the timers driving the converters. I like the faults because they can turn the outputs off in hardware.
Entering low-power modes, especially the Standby and Shutdown modes, is another mostly software related disaster from ST. Additionally there also seems to be one or two hardware bugs and/or undocumented conditions. This topic provides an example of how to do it correctly and reliably and an explanation of the issues present in the current ST provided code and documentation. Correct example code based on L43x devices: void Power_Off(void) { // Configure wake-up features // WKUP1(PA0) - active high, WKUP4(PA2) - active low, pull-up PWR->PUCRA = PWR_PUCRA_PA2; // Set pull-ups for standby modes PWR->CR4 = PWR_CR4_WP4; // Set wakeup pins' polarity to low level PWR->CR3 = PWR_CR3_APC | PWR_CR3_EWUP4 | PWR_CR3_EWUP1; // Enable pin pull configurations and wakeup pins PWR->SCR = PWR_SCR_CWUF; // Clear wakeup flags // Configure MCU low-power mode for CPU deep sleep mode PWR->CR1 |= PWR_CR1_LPMS_STANDBY; // PWR_CR1_LPMS_SHUTDOWN (void)PWR->CR1; // Ensure t
ST Community highlights – April to June 2026
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.