Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi, I am using the STM32N6570-DK development kit and I want to flash my FSBL and Application firmware into external flash using USB. Currently, I am able to flash the firmware using ST-LINK, but I want to perform flashing through USB as well. I configured the boot pins as mentioned in the datasheet: BOOT0 = High BOOT1 = Low Current behavior The device is detected in STM32CubeProgrammer when connected via USB. USB connection is successful. Partitions such as FSBL, RSSE_FW, RSSE_BLOB, RSSE_PLUGIN, etc., are visible. However, the Download / Erasing & Programming option is disabled. Questions Is flashing external flash through USB supported on STM32N6570-DK? Do I need to configure any OTP boot source or BOOTROM settings to enable USB flashing? Any guidance or examples on how to enable external flash programming via USB would be very helpful.Thank you.
Hey ST-Community,I’m working with an STM32H7S78-DK board and trying to get Ethernet running. TouchGFX and FreeRTOS are working fine, but I’m stuck with lwIP. The task starts, but DHCP never succeeds (the printed IP is always 0.0.0.0). I also tried with a static IP, but I still can’t ping the board. Deactivating TouchGFX didn't help.I've followed this video: STM32 : How to Get an IP Address via DHCP on STM32H7S78-DK with LwIP using IAR EWARMLwIP has the following memory settings:MEM_SIZE = 14*1024BytesTCPIP_THREAD_SIZE = 4 * 1024BytesI've configured the MPU as well following the given Video.I’m not sure where to look next – maybe I’m missing some configuration step? Has anyone successfully used lwIP with this board and could give me a hint?Thanks a lot in advance!
Hello I am trying to implement I²C slave on a STM32U385RGTxQ in non-blocking mode, on I2C2.To match I²C standard I tried to use the Address macthed interruption but the interruption is never trigged. I used the function HAL_I2C_EnableListen_IT(&hi2c2) to enabled it; My issue is, I don't reach neither the I2C2_EV_IRQHandler(void), the I2C2_ER_IRQHandler(void) or the HAL_I2C_AddrCallback() when sending the slave address. Please found attached my project. And bellow some pictures of my I2C2 init, an oscilloscope capture and my I2C2 register when I am in debugger : Best Regards Thibaud HABRAND
I am not able to erase a section of internal flash of the NUCLEO-H633RE.Using the debugger I see the Flash is all 0x00 before I try to erase. I verify that Flash is not locked i.e.if (*FLASH_NSCR && LOCK) { *FLASH_NSKEYR = 0x45670123; *FLASH_NSKEYR = 0xcdef89ab; }then I try to erase a section of Flash i.e./* ************************************************************************* */ /* */ /* EraseFla - Erases 8K page of Flash, Waits for Flash not busy. */ /* Inputs: uint32_t page holds the page to erase. */ /* Outputs: None */ /* */ /* ************************************************************************* */ void EraseFla(int EraPage) { while (*FLASH_NSCR && BSY){}; n = *FLASH_PRIVCFGR; // just testing n = EraPage >> 7; if (n && 0x0800) { n &= 0x07C0; n |= 0x80000004;} // BKSEL and SER else { n &= 0x07C0; n |= 0x00000004;} *FLASH_NSCR |= n; *FLASH_NSCR |= STRT; while (*FLASH_NSCR && BSY){}; } With the debugg
English language:STM32H7 Ethernet + DMA + Cache Explained + LwIP (EN) One of the most common sources of confusion when working with STM32H7 microcontrollers and Ethernet (via LwIP + HAL ETH) is data cache (D-Cache) behavior.When using DMA (like Ethernet MAC DMA), if D-Cache is enabled (which it is by default in STM32H7 projects), you must manage cache coherency manually. Otherwise, the DMA peripheral and the CPU will not agree on what data is in RAM.I encountered this exact issue myself and spent significant time identifying the root cause. Since many others using STM32H7 are likely to face this same problem, I'm sharing this explanation to help save your time and effort.Problem:If you fill a pbuf->payload buffer with data and send it using HAL_ETH_Transmit() without cleaning the D-Cache, the CPU will still be holding the most recent data in its cache, but the DMA will read stale or uninitialized data from RAM.Result: corrupted Ethernet frames, broken ping replies, UDP iss
Hello, Using STM32F4 USB USB_OTG_HS, PCD_SPEED_FULL for USB Device CDC we are transmitting data to Host.After some minutes the transmission gets stuck. Although the TXFE IRQ is received, no XFRC IRQ happens and consequently TX state is not set back to 0. The DTXFSTS counter stays on 0x40 (empty is 0x80).The USB trace looks normal. When the problem occurs the peripheral answers all IN Transactions with a NAK.Why does the peripheral not transmit the data but does NAK instead?The problem is seen with different types of Hosts (PC or other embedded devices).Attached Log Output and Screenshot of the Trace.HAL 2.4.2 us used. The TxState fix was applied (Enable/Disable IRQ moved to USBD_CDC_TransmitPacket)Many thanks for any help.
Hi@all Curently i was using STM32F407VGTX but i found that there is no support of snmpv3 on this board so i decided to go for stm32H753ZI. Kindly please suggest that does this board supports snmpv3 or not and if not please suggest me the board that supports snmpv3 i want to deploy in my products
Hello,I currently need to transfer ADC data from a nucleo-n657x0Q to a PC. I've configured the stm32n6 using ST's example on GitHub, but I still don't know how to use the `ux_device_class_cdc_acm_write` function to transfer the data.Can anyone guide me on how to transfer data using this USB HS?
Hello Community, I am working on an STM32N657X0H3Q project and have successfully configured both USBX and X-CUBE-FREERTOS (v1.4.0) within the same Application runtime context using CubeMX. My goal is to implement a USB CDC Composite device. Since USBX traditionally relies on Azure RTOS (ThreadX) for its RTOS primitives, I am seeking the recommended best practice for running USBX on a FreeRTOS-based system. Should I configure USBX in standalone mode? If running USBX in Standalone mode, what is the best way to handle thread safety when accessing the USB CDC interface from multiple FreeRTOS tasks? Are there any known issues using the USBX Composite Builder when the underlying kernel is FreeRTOS instead of ThreadX?
I am using STM32H7R7L8H with MX25L12833F external memory. I created a project with has bootloader, application and external memory loader.Before starting this project I opened another to test if I can read/write/erase MX25L12833F. By using XSPI in Quad mode I could do all the operations. Below I shared the configuration: XSPI1: EXTMEM_LOADER: EXTMEM_MANAGER: With this configuration I built the project and it generated external loader. In STM32CubeProgrammer I can read MX25L12833F memory, it can do mass erase too but it can't do sector erase. I created an application hex which is located at 0x90000000 and tried to write this file to external memory by using generated loader. Here is the result: 00:51:51 : Opening and parsing file: Appli.hex 00:51:51 : Memory Programming ... 00:51:51 : File : Appli.hex 00:51:51 : Size : 8.54 KB 00:51:51 : Address &n
Hardware: STM32G473QETXHAL Version: STM32G4 HALI2C Mode: Slave mode using HAL_I2C_Slave_Seq_Receive_IT()Application: DS1307 RTC emulation Issue DescriptionWhen implementing an I2C slave device (DS1307 RTC emulation), we observe that HAL_I2C_ErrorCallback() is consistently called with error code HAL_I2C_ERROR_AF (0x00000004 - Acknowledge Failure) at the end of successful write transactions from the I2C master Transaction FlowMaster sends START + Address (0x68) + WRITESlave ACKs (address match detected)Master sends data bytes (8 bytes total)Slave receives all bytes correctly via HAL_I2C_SlaveRxCpltCallback()Master sends NACK (to signal end of write)Master sends STOPHAL_I2C_ErrorCallback() is called with HAL_I2C_ERROR_AFHAL_I2C_ListenCpltCallback() is also calledExpected BehaviorAccording to I2C protocol, the master sending NACK at the end of a write transaction is normal behavior to signal "I don't want to send more data." This should not be reported as an e
Hello everyone, I’m working on a custom version of the FP-SNS-DATALOG2 firmware and attempting to integrate a new sensor, LSM6DSV320X, which is available on the STEVAL-SensorTile.Box Pro but not on the STEVAL-STWINBX1. To add support for this sensor, I performed the following changes: Added Drivers/BSP/Components/lsm6dsv320x/lsm6dsv320x_reg.c/.h Integrated corresponding PnPL + App Model .c/.h files Added that sensor task Modified: DatalogAppTask.c/.h App.c/.h sysdebug_conf.h SensorManager_conf.h HardwareDetect.c/.h Updated existing DTM(Device Template Model) from stdatalog-pysdk pnpl module(FP-SNS-DATALOG2-9.json) to include the new sensor Removed ism6hg256x from the build With these changes, I’m able to start logging using a custom device template, and the sensor appears to work initially. However, the system becomes unreliable after a reset. Main Issue The board operates correctly until it is reset. After reset, I encounter multiple faults, including: HardFaults Bus faults
I am using the STM32L433 MCU and both the HID and VCP interfaces are not working even though the DFU is.I am simply using the STM32CubeMX software to generate a standard default USB Setup but I keep getting the same Windows USB Error "USB Device Not Recognised" which is the "Device Descriptor request failed".My hardware is a custom design and believe that I have the correct differential impedance or the DFU would not have worked. VBUS is at 3.3V (<4V)D+/D- traces > 2 inches but differential impedance has been matched to 90 Ohms using Altium.I have a 12MHZ Crystal, the MCU can run Crystal-less.USB is 48MHz but runs from RC, also used PLLSA1 from HSE.STM32CubeIDE v2.1.1MX_USB_DEVICE_Init() called. If the DFU is working then why not the other USB Interfaces?
Hi ST Community,,I’m working with the STM32N6570-DK board and trying to implement a USB Video Class (UVC) device.From my exploration in STM32CubeMX, I couldn’t find any native option to enable or generate a UVC class . Based on this, my understanding is:UVC is not directly supported in STM32CubeMXIt may require manual porting (e.g., from X-CUBE-WEBCAM or other examples)Could you please confirm:Is UVC officially supported on STM32N6570-DK?Is there any roadmap to include UVC support in STM32CubeMX?Are there any reference implementations (for STM32N6 or similar series) available?What is the recommended approach:Should we start from a CubeMX-generated USB project and manually integrate UVC class?Or is there a preferred middleware/package for this?Additionally, it would be very helpful if you could outline the high-level steps for implementing UVC on this platform .
Hi,how am I supposed so handle the reinsertion event while using the FileX with an SD card? All the examples I saw assume the SD card cannot be ejected while in use which is obviously unrealistic.I tried to do it according to the official docs and when the ejection is detected I call the fx_media_abort and fx_stm32_sd_deinit. But during the reinsertion when I call the fx_media_open again I get the FX_IO_ERROR. At this point the driver should be in an uninitialized state and the fx_media_open should call the fx_stm32_sd_init function.Can anyone relate to this problem? Here is the code example. The FX_STM32_SD_INIT macro is defined. if(card_insertion_flag.Get(0x03, EventGroup::Access::bit_or_clear, TX_WAIT_FOREVER,flag)) { if(flag & 0x01) { //Card inserted uint8_t cntr = 0; do { status = fx_media_open(&this->sdio_disk, (char* )"SD card", fx_stm32_sd_driver, 0, (VOID *) media_memory, this->media_memory_size); HAL_Delay(50); } while(cntr++ &
in HS, HAL_PCD_Init fails with timeout in USB_CoreReset Hello everyone,I am working with an STM32H7S78-DK and I’m trying to use USBX in standalone mode for a composite USB device (CDC ACM + PIMA) over USB_HS at 480 Mbit/s.At the moment, I have only implemented the CDC ACM class. PIMA will be added later.Situation:If I configure USB as Full Speed, the peripheral initializes correctly.If I switch to High Speed, initialization fails at:MX_USBX_Init() -> MX_USBX_Device_Init() -> MX_USB_OTG_HS_PCD_Init() -> HAL_PCD_Init(&hpcd_USB_OTG_HS)The error occurs at:if (USB_CoreInit(hpcd->Instance, hpcd->Init) != HAL_OK) { ... }Because inside USB_CoreInit, in USB_CoreReset, a HAL_TIMEOUT is returned while waiting for the CSRST bit in GRSTCTL to clear:Core Soft Reset (CSRST) is writtenThe bit never clears and eventually times outTechnical summary:FS works, HS does notThe timeout occurs right after PHY selection and USB core resetThe issue seems related to clock/PHY/HS con
I have looked https://community.st.com/t5/stm32-mcus/implementing-uart-receive-and-transmit-functions-on-an-stm32/ta-p/694926 and https://wiki.st.com/stm32mcu/wiki/Getting_started_with_UART#Configure_UART_Interrupt and tested sending tx data with a Salae Logic analyzer. And I am able to see the data sending. However, I cannot for the life of me get an rx interrupt to trigger. It seems like my code is correct, but something is off. /* 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 LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****
Hello, I am using HAL2 and wrote the basic code below: while (1) { HAL_GPIO_TogglePin(LD1_PORT, LD1_PIN); HAL_Delay(1); } I looked at the pin with an oscilloscope and I see that the signal stays 2ms low and 2ms high. If I change the code to HAL_Delay(0) I get a signal that stays low 1ms and high 1ms. It's as if the delay is actually the HAL_Delay parameter plus 1ms. Any explanation?-Gil
Hello, I used STM32CubeMX2 to configure a timer (timer 2, channel 4) for input capture. I'm starting the timer and then applying the signal on the timer input pin. Since I configured the TIM interrupt, the interrupt callbacks do occur. void HAL_TIM_InputCaptureCallback(hal_tim_handle_t *htim, hal_tim_channel_t channel) { if (htim == mx_tim2_gethandle() && channel == HAL_TIM_CHANNEL_4) { uint32_t value = HAL_TIM_IC_ReadChannelCapturedValue(htim, HAL_TIM_CHANNEL_4); #ifdef DEBUG SWD_printf("ICTIM: %d\n", value); #endif } } The problem that I am having is that HAL_TIM_IC_ReadChannelCapturedValue always returns 0. The number of callbacks is actually correct (it matches the number of positive and negative edges of the signal). The timer frequency is 10,000Hz (the period is 0.1ms) and the signal pulses are between 2ms and 9ms so the timer is not overflowing. I would expect timer readings to be between 20 and 90. I attached the timer configura
Hello,I am working on USB device CDC ACM for STM32N655L0. I found an example about "Ux_Device_CDC_ACM" for NUCLEO-N657X0-Q. Can I use this example for my mcu? How can I find ioc configuration of this example?I also tried to implement this example to my project but when I change some configuration from ioc, new code is not match with this example. On the other hand, I did everything as inside of example but I am getting error during clock initalization.Best Regards,Basri KAYA
e.g. select I2S with "Master transmit" which should only use I2S_CK, I2S_WS and I2S_SDO, yet the I2S_SDI pin is also muxed and blocked for other use (and both DMA directions are available)
Hi Team,We are planning to use an STM32 camera interface over USB using the UVC protocol in our upcoming design. We would like to understand if there are any evaluation or development boards available that can be used for initial testing.Our key requirements are as follows:Image size: up to 5 MB per captureCapture interval: one image every 30 seconds (worst case)Video streaming is not required; we only need still image capture and transferUSB-based camera interface preferredWe would like to know:Whether UVC is suitable for this type of non-streaming, low-frame-rate image transferIf anyone has implemented a simpler or similar design successfullyWhich STM32 controller models support this use caseAvailability of any development or evaluation boards for testing the camera over USBPlease share your recommendations, reference designs, or documentation links if available.Looking forward to your guidance.Regards,Sathiya
Hi I have a project with STM32F446RET6 which has custom bootloader and application in user defined location. This project does UART Bootloader for firmware upgrade - issue faced is if the device loses power while in between the firmware upgrade then the device is neither in UART bootloader/DFU mode nor has a valid firmware. The solution which i want to implement is keeping two image of the application in two slot A and B. Normal working in Slot A and backup in Slot B. Firmware upgrade happens in Slot A and if fails copy the firmware from Slot B otherwise copy Slot A to Slot B. can anyone provide a simple logic which can be implemented to check if the firmware upgrade is completed and successful in SlotA. I would not like to add CRC check.
Hi all, I've noticed that a DHCP client can not get an IP address from the server if both mDNS server and DHCP client are enabled. The reason seems to be in ST Ethernet driver (nx_stm32_eth_driver.c): static UINT _nx_driver_hardware_initialize(NX_IP_DRIVER *driver_req_ptr) { ... FilterConfig.BroadcastFilter = ENABLE; ... } static UINT _nx_driver_hardware_multicast_join(NX_IP_DRIVER *driver_req_ptr) { /* Increase the multicast count. */ nx_driver_information.nx_driver_information_multicast_count++; /* Enable multicast frame reception. */ FilterConfig.PassAllMulticast = ENABLE; HAL_ETH_SetMACFilterConfig(&eth_handle, &FilterConfig); /* Return success. */ return(NX_SUCCESS); } In _nx_driver_hardware_initialize() FilterConfig is just prepared, there is no HAL_ETH_SetMACFilterConfig() call. That's why DHCP works OK if mDNS is not used. If mDNS is active, it calls _nx_driver_hardware_multicast_join() and applies a prepared 
I am using the STM32H733 controller along with the NetXDuo networking stack. The issue started after updating the HAL drivers in my project from version v1.11.0 to v1.16.0 (released on February 24, 2026).After this update, I observed that when the device boots up and no network activity occurs for a certain period (for example, no ping requests are sent to the device or device sending any UDP packet), the Ethernet connection is eventually lost permanently. Once this happens, the device becomes unreachable over Ethernet, and neither a soft reset nor a hard reset restores the connection.However, if the device receives a ping immediately after booting, or if it sends a UDP packet shortly after startup from the device, the Ethernet connection remains stable. In this case, normal operation continues without any issues until the device is reset again and no network activity is observed for a certain period as well.This problem only appeared after updating the HAL drivers to version v1.16.0 a
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.