Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello,I created a STM32F446 host project using STM32 CubeMX to receive data from a wireless mouse.This project works, but only with Lenovo mice. Other wireless mice are perceived as multifunctional devices.I get debug information when I start:USB Device ConnectedUSB Device Reset CompletedPID: 18hVID: 32c2hAddress (#1) assigned.Manufacturer : HS6209Product : 2.4G Wireless ReceiverSerial Number : No.161-0047-5Enumeration done.This device has only 1 configuration.Default configuration set.Device remote wakeup enabledSwitching to Interface (#1)Class : 3hSubClass : 0hProtocol : 0hDevice not supporting HID class.Is it possible to receive data from these wireless mice?
On the STM32C542CC in LQFP48, none of the Port C pins that support I2S MCLK output are available. Despite this, enabling the "Master Clock Output" under "Advanced Features" in the MX2 Peripherals tab is still possible and reports no warnings or errors.
I’m about to start a new embedded project that is probably outside my skill set (as usual) and I’m hoping to get some recommendations on what STM MCU might have a reasonable learning curve to build up the MCU part of this system. It’s another autonomous oceanographic observing platform like I’ve built in the past with a lot of help from people on this forum. That system used a STM32H7 MCU. For this case, I need a few more serial ports and an ethernet connection to a new sensor. And I’ll need a file system and lots of Flash and SRAM. Low power matters, but the MCU is pretty low on the power consumption histogram.The STM32H5 looks like a good choice since it has lots of serial ports and the Nucleo STM32H563 has an Ethernet phy and a USB-C connector that theoretically could support a USB Flash driver.. Here are a few specific questionsQ0 Is there a better MCU choice with an easier learning curve that might meet my requirements?Q1. It looks like the H5 and STMCubeMX/IDE now use FileX which
Hello,First time posting here so I apologise in advance to admins if this is in the wrong area.I’m attempting to use a DP838xx series PHY with an STM32H7xxx series chip in MII mode and I’m running into this odd issue where whenever the ETH_MDC pin is initialized, the TX_CLOCK completely drops out. I believe my PHY is reset when I set the MDC pin. I can’t seem to get around this at the moment and wonder if perhaps there is something quirky or unusual that I’m not aware of?I have this crazy idea that perhaps the pin is being pulled low just at the right time as to send something to the PHY to tell it to reboot or shutdown but I’m not able to look into that much detail.Things I have tried:1. Full setting up my PHY by writing to it’s registers for MII mode and the correct physical medium2. The same but in RGMII mode and then attempting to switch3. Completely fresh project without LWiP stack, manually enabling the ethernet pins one at a time (this is where I discovered that the MDC pin was
Hardware: STEVAL-MKI109D (STM32H563ZI)CubeMX: 6.17.0CubeIDE: 2.1.0Connection: USB-C directly to STM32H563 USB OTG (no ST-LINK chip)PROBLEM:I need USB CDC Virtual COM Port in a bare-metal application(no RTOS). CubeMX 6.17.0 for STM32H563 only offers:- USBX (requires ThreadX)- ThreadX- FileX- LevelXClassic USB_Device middleware (usbd_cdc_if.h / CDC_Transmit_FS)is NOT available for STM32H5 series in CubeMX 6.17.0.USBX requires ThreadX RTOS. Without ThreadX running,MX_USBX_Init() causes the board to crash silently —after DFU flash the board is completely invisible on USB(no lsusb entry, no /dev/ttyACM*).QUESTIONS:1. How do I implement USB CDC on STM32H563 WITHOUT ThreadX?2. Is there a way to enable classic USB_Device stack for STM32H5in CubeMX 6.17.0?3. Is there a bare-metal USBX CDC example that does NOT requireThreadX for STM32H5?4. Can I manually add usbd_cdc_if.c and USB Device library filesto an STM32H5 project without CubeMX support?I have a working SPI sensor application (ISM330DHCX
Hello, I have been having a ton of trouble setting up a simple ADC + DMA on the new STM32N6 Nucleo board. I have confirmed that my adc is sampling by looking into the data register of my ADC. However, the only way I got the HPDMA to write in my adc buffer was through DTCM as I followed the reccomendation of this topic, in order to avoid the hassle with S and NS domains. However I wish to sample at 2.5 MSPS and through DWT and the Cplt_Callback of the HPDMA I found that my data actually came through at 1.44MSPS. The ADCs of this STM are rated for 5MSPS.Can anyone help me make it so that I can sample at the desired rate and actually get a hold on that data at the desired rate. Also if you know of a better fix than cranking the CID to 11 I’d happily take it. Thanks, Lorenzo
I just upgraded to Cube 2.0.0 components. I did my first build in CubeIDE 2.0.0 with a previously working project and I got strange errors. It appears the HAL objects for the peripherals are getting garbled. When pointers to the objects are passed to functions, the compiler says that the pointer is of another peripheral type. In the output below, the pointers to ADCs are treated like they are of the timer typedef.What could cause this? arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32G473xx -c -I../Core/Inc -I../Drivers/STM32G4xx_HAL_Driver/Inc -I../Drivers/STM32G4xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32G4xx/Include -I../Drivers/CMSIS/Include -I../USB_Device/App -I../USB_Device/Target -I../Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/main.d" -MT"
Hello,I am developing an external flash loader for an IS25LP512MJ QSPI flash on my custom board. However, I am encountering an issue where programming always fails with the following error:Error: failed to download Sector[0]The complete log is attached below.I have verified the following: The QSPI flash is initialized correctly. I can successfully read, write, and erase the flash from my application. The flash loader builds without any errors. The issue only occurs when STM32CubeProgrammer (or STM32CubeIDE via the GDB server) attempts to program the external flash. The relevant part of the log is:Memory Programming ... File : ST-LINK_GDB_server_a19388.srec Size : 1.60 MB Address : 0x08000000Erasing memory corresponding to segment 0:Erasing internal memory sectors [0 109]Erasing memory corresponding to segment 1:Erasing external memory sectors [0 191]Download in Progress:Error: failed to download Sector[0]Error: failed to download the FileHas anyone expe
Hi, I am using a STM32U375KEU on a custom PCB and I am trying to enter STOP2 mode. When flashing the code i the error: Target is not responding, retrying… and the current draw is the same as running the MCU normally at around 2mA. Here is the mainint main(void){HAL_Init();SystemClock_Config(); HAL_DBGMCU_DisableDBGStopMode(); // 3. KILL SYSTICK SO IT CAN'T WAKE THE CPUHAL_SuspendTick();SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk; // 4. ENTER DEEP SLEEP__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SBF);HAL_PWR_EnterSTOPMode(PWR_LOWPOWERMODE_STOP1, PWR_STOPENTRY_WFI); // 5. IF IT WAKES UP, TRAP IT HEREwhile (1){}}}Does it have something to do with the Clock?
Hello Everyone please guide me in the stm32h7xx_hal_eth.c file a function which name is HAL_ETH_ReadData() is not properly working in this function while loop is not working the main specific this part => “ (READ_BIT(dmarxdesc->DESC3, ETH_DMARXNDESCWBF_OWN) == (uint32_t)RESET)”isn not working and i ma getting output is host unreachable => PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.From 192.168.1.10 icmp_seq=1 Destination Host Unreachablei am using NUCLEO-H723ZGT6 board HAL_StatusTypeDef HAL_ETH_ReadData(ETH_HandleTypeDef *heth, void **pAppBuff){uint32_t descidx;uint32_t descidx_next;ETH_DMADescTypeDef *dmarxdesc_next;ETH_DMADescTypeDef *dmarxdesc;uint32_t desccnt = 0U;uint32_t desccntmax;uint32_t bufflength;uint8_t rxdataready = 0U; if (pAppBuff == NULL){heth->ErrorCode |= HAL_ETH_ERROR_PARAM;return HAL_ERROR;} if (heth->gState != HAL_ETH_STATE_STARTED){return HAL_ERROR;} descidx = heth->RxDescList.RxDescIdx;dmarxdesc = (ETH_DMADescTypeDef *)heth->R
Hi everyone,I am learning STM32 bootloader development and I would appreciate some guidance.Hardware STM32 Nucleo-G431RB Windows PC USB-to-TTL UART converter UART communication RequirementI already have an application HEX file.My goal is to update the firmware through UART using a custom bootloader.I do not want to use: STM32CubeIDE ST-LINK STM32CubeProgrammer Any IDE during firmware update The complete firmware update should happen only through UART.What I want to achievePC↓Application (my own program)↓UART (TTL)↓Custom Bootloader↓STM32 Flash Memory↓Jump to ApplicationQuestions What should be my first step to implement this? Should my PC application send the HEX file directly, or should it first convert it into BIN? Should the bootloader parse Intel HEX records, or is it better to send binary data? What communication protocol is commonly used for custom UART bootloaders? Packet format Start byte Length CRC ACK/NACK What is the recommended fl
Hello,We are using an STM32H743 MCU with the LI10600T070IA3098-TCF LCD panel (1024×600 resolution) through a 24-bit RGB LTDC interface. We are experiencing display flickering, as shown in the attached video.Could you please help us identify the possible root cause? Kindly let us know what additional information (schematic, LTDC timing parameters, oscilloscope captures, PCB layout, etc.) would be required from our side to assist in debugging this issue.Any guidance or recommendations would be greatly appreciated.https://drive.google.com/file/d/1wClnXqdIc8OI-4y19CmWxJERnSnIYUK-/view?usp=sharing
Some applications have the need to use an external interrupt from an GPIO input that is already configured as alternate function. My use case is to use EXTI on a rising edge of SPI_NSS input to detect a terminated SPI transfer on a slave.So I need the combination of MODE_AF and EXTI_IT when configuring the GPIO input pin. Unfortunately, HAL does not support this and asserts on IS_GPIO_MODE(__MODE__) for this combination.However, STM32 MCUs usually support this combination, so it makes sense to support this in HAL.To allow this, I added some definitions in stm32g4xx_hal_gpio.h:#define GPIO_MODE_AF_IT_RISING (MODE_AF | EXTI_IT | TRIGGER_RISING) /*!< Alternate Function with External Interrupt Mode with Rising edge trigger detection */ #define GPIO_MODE_AF_IT_FALLING (MODE_AF | EXTI_IT | TRIGGER_FALLING) /*!< Alternate Function with External Interrupt Mode with Falling edge trigger detection
I am trying to make the ADC channels sample the current through some motor channels synchronised to the center of the center aligned PWM waveform to avoid switching noise.The microcontroller I am using is the STM32F411 series, and I am using the first 3 channels of Timer 2 for PWM. The 4th channel is set to "Output compare no output", and I also set the timer trigger output event selection to Output compare (OC4REF). I set the pulse of channel 4 to the TOP value of the timer so it triggers when the counter counts to the TOP (midpoint of PWM). For the ADC, i am trying to sample 4 inputs (2 phases for 2 motors) and shift the data into a buffer using DMA. I enabled scan conversion mode as well as DMA continuous requests, and set the trigger source to Timer 2 capture compare 4 event, triggered on the rising edge. The ADC global interrupt is also enabled.In code, I started timer 2 using:HAL_TIM_Base_Start(&htim2); HAL_TIM_OC_Start(&htim2, TIM_CHANNEL_4);Then, I start the ADC us
Hello ST Community,I am currently working on a hardware integration project where a Xilinx ZCU104 FPGA acts as the SPI Master, and an STM32F446RE acts as the SPI Slave. We are attempting to establish a stable full-duplex SPI communication using DMA, but we are consistently encountering a "Communication Timeout" on the Master side, and the STM32 RxBuffer remains empty (all zeros).Here are the implementation details and the troubleshooting steps we have already verified:### 1. Configuration & Code Snippet* Data Size: 8-bit SPI data size, but grouped into 4-byte (32-bit) transfers to match the FPGA's 32-bit register data width.* STM32 SPI Configuration: Slave Mode, 2 Lines Full-Duplex, CPOL=0, CPHA=0 (Mode 0), MSB First.* NSS Management: Hardware NSS Input (SPI_NSS_HARD_INPUT) on PB12.* DMA Configuration: DMA1 Stream 3 (RX) and Stream 4 (TX) enabled with circular or normal transfer.In `main.c`, we initialize the peripheral and start the listening process as follows:```c#define BUFFER_
Hello,I’m working on a stm32h753 MCU and trying to use LwIP. I followed a lot of topics on that but I’m still not able to make it work.When I’m using debugger to identify issue, I’m always falling in unaligned access issue.backtrace in debugHere is my configuration :MPU_configvoid MPU_Config(void){ MPU_Region_InitTypeDef MPU_InitStruct = {0}; /* Disables the MPU */ HAL_MPU_Disable(); /* Configure the MPU as Strongly ordered for not defined regions */ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.BaseAddress = 0x00; MPU_InitStruct.Size = MPU_REGION_SIZE_4GB; MPU_InitStruct.AccessPermission = MPU_REGION_NO_ACCESS; MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE; MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE; MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE; MPU_InitStruct.Number = MPU_REGION_NUMBER0; MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0; MPU_InitStruct.SubRegionDisable = 0x87; MPU_InitStruct.DisableExec = MPU_INSTR
..
I am currently using the NUCLEO-H7S3L8 CN2 Type-C port as a USB_OTG_HS embedded PHY host/source.The TCPP03 source path opens successfully, and both the USB stick attachment and port reset are working. After the reset, HPRT reads 0x00001005, which seems to indicate speed=HS and that the port is enabled.However, during the first EP0 SETUP GET_DESCRIPTOR request: HAL_HCD_HC_SubmitRequest() = HAL_OK HAINT = 0x00000001 HCINT = 0x00000080 TXERR = 1 xfer_count = 0 The exact same issue occurs even during a raw HAL EP0 smoke test, prior to involving USBX/FileX.I would like to verify the following points: What is the mandatory clock/power initialization sequence when using the USB_OTG_HS embedded PHY host on the H7S3L8? Is it acceptable to use HSI → PLL3Q for the USBPHYC clock, or is an HSE strictly required? What are the necessary settle/wait conditions after enabling USBHSREG? Are there any required CC/UCPD configurations for the CN2 Type-C/TCPP03 source setup, apart from the PM9
i am using stm32h753zi and stmcubeide is 1.10.1 .the eth dx and rx is 30000000 and 30000200 and heap is 30044000 and rcc- bypass and used tim6 .i did it like the examples and i got no out and finally got a working code from claude, but it works only untill the power line is connected after i remove and reconnect it stopped working or works for one ping and stops .i thought may be it was beacause i used ramd2 and used ramd1 it also stops working when this stops.someone pls help me fix this i am willing to start from scratch lwip i used static ip address and pc is in same subnet/* USER CODE BEGIN Header *//** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2026 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICEN
Hi , Subject: i need to reduce the log write time what to do I have an STM32H503 logging ~20 bytes per line (HH:MM:SS , X.X) to a 24Cxx EEPROM over I2C @ 400 kHz, with FAT12 + USB MSC.Blocking time = the main loop stalls ~100–200 ms on each append while EEPROM writes finish.Each line only adds ~20 B of text, but my FAT code does full 512 B sector read-modify-write on the data sector, again on the root directory (file size), plus metadata read/write.That’s ~1 KB+ programmed per line (many 64 B page programs), so EEPROM ACK/program time dominates — not the 20 B payload or I2C speed alone.Basic issue: small appends through sector-based FAT on page EEPROM → huge writes per line.I’m thinking: defer root/meta to session end (back button), RAM cache, write only dirty 64 B pages.Is that the right fix? Can others get ~20–50 ms/line on 24Cxx without dropping FAT?
As per my custom board pins(I am using single QUADSPI STR) I have selected and i tried to flash via Cube-Programmer CLIVEONE - MT25QL512_STM32H7XX-PB2-PB10-PF8-PF9-PF7-PF6.stldrhttps://github.com/cturvey/stm32extldr/blob/main/h7_mt25ql512a/CLIVEONE-MT25QL512_STM32H7XX-PB2-PB10-PF8-PF9-PF7-PF6.stldrISSUE : flash protection enabled https://github.com/cturvey/stm32extldr/tree/main/h7_mt25ql512aISSUE: I have tried with this external loader but i am not able to erase memory
When I compile my code, I get strange errors that make no sense.#define ADC_BUFFER 1000 gives error "expected declaration specifiers or '...' before numeric constant"even though the line above it #define ADC_HIGH_THRESHOLD 3500 doesn't generate an error.HAL_TIM_Base_Start(&htim3); and HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc_buffer, ADC_BUFFER); both generate "Syntax error".The TIM and ADC Start errors expanded error message is: error: expected declaration specifiers or '...' before '&' token /* USER CODE END Header *//* Includes ------------------------------------------------------------------*/#include "main.h"/* Private includes ----------------------------------------------------------*//* USER CODE BEGIN Includes */#include <stdlib.h>#include <stdio.h>#include <stdbool.h>#include <stdint.h>#include <inttypes.h>#include "globals.h"/* USER CODE END Includes *//* Private typedef -----------------------------------------------------------*//
Environment & hardware:STM32F722RET6:LQFP64USB3300EZKSTM32CubeIDE v2.1.1STM32CubeMX v6.17.0Windows 11 OS Description of problem:I am trying to use ULPI with external HS USB phy with the follwing schematic:when calling MX_USB_DEVICE_Init(), it will be stuck at /* Required few clock cycles before accessing USB PHY Controller Registers */for (volatile uint32_t i = 0; i < 10; i++) { __NOP(); // No Operation instruction to create a delay} /* Core Soft Reset */ USBx->GRSTCTL |= USB_OTG_GRSTCTL_CSRST; do { count++; if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; } } while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST); return HAL_OK;}in USB_CoreReset(), eventually returning HAL_TIMEOUT. Images of USBx and RCC:USBx before core soft resetUSBx after soft core resetRCC before & after soft core resetMy clock configuration, everything not included in this image is greyed outULPI pins: /**USB_OTG_HS GPIO Configuration PC0
Could you please let me know when STM32 CubeMX 2 is expected to support USB device and host middleware?Also, will STM32H, STM32F, and other STM32 series continue to be supported in CubeMX 2?
Implementation: STM32F405, using Timer 2 to synchronously trigger ADC1 and ADC2 acquisition with DMA.Problem: The sampling frequencies of ADC1 and ADC2 are correct, but the phase difference keeps changing for each acquisition – they are not sampling synchronously, and the captured waveform does not match what is observed on the oscilloscope.Question: 1,How can I debug and resolve this issue?2, I found that I must call HAL_ADC_Start(&hadc2) before HAL_ADCEx_MultiModeStart_DMA(&hadc1, ...); Is this correct? HAL_ADC_Start(&hadc2); HAL_ADCEx_MultiModeStart_DMA(&hadc1,(uint32_t*)adc_dma_buf,POINTS_PER_CH);Specific code: /* USER CODE BEGIN Header *//** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2026 STMicroelectronics. * All rights reserved. * * This
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.