Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I am using STM32F407VE Black Board. It contains the STM32F407VET6 chip. It has a microSD slot but the slot's CD pin is not connected. Due to this f_mount() is always returning faults. I don't know if this hardware miss connection is the primary problem why f_mount() returns faults or there are more problems. Please help me out with this. I am stuck since 2-3 days. I tried modifying the dist_status and dist_initialize functions to bypass this hardware check but when I upload the code, the board does nothing for 20-30sec and f_mount again returns error. I have attached my code changesDSTATUS disk_status ( BYTE pdrv /* Physical drive number to identify the drive */ ) { // DSTATUS stat; // // stat = disk.drv[pdrv]->disk_status(disk.lun[pdrv]); // return stat; return 0x04; } // Inside diskio.h: /* Disk Status Bits (DSTATUS) */ #define STA_NOINIT 0x01 /* Drive not initialized */ #define STA_NODISK 0x02 /* No medium in the drive */ #define STA_PROTECT 0x04 /* Write protected */0x04
Hello ST Community,I'm working with the STM32G0B1CCT6 microcontroller and implementing a custom bootloader located at the beginning of flash memory. The bootloader handles firmware updates over FDCAN.:wrench:Flash Layout:Bootloader start address: 0x08000000Application start address: 0x08008000Total flash: 256 KBFlash page size: 2 KBIn my bootloader code, I handle a specific FDCAN message with ID 0x555 as a signal to erase the entire application area (from 0x08008000 to 0x080FFFFF).:white_heavy_check_mark:What works:The bootloader receives the erase command correctly from FDCAN.It calls HAL_FLASHEx_Erase() and returns HAL_OK.The UART debug log confirms the erase was “successful”.:cross_mark:The problem:After erasing, when I read back the flash content at address 0x08008000, I still see the previous application data (e.g., 0x20024000, 0x08008859, etc.), not 0xFFFFFFFF as expected.:magnifying_glass_tilted_left:Debug output example: bash ERASE command received! Flash Erased
Hi all!I am developing a midi pedal using the USB functionalities of the STM32F411. I want to use a software toggle to switch between Host and Device. I am having this issue: I can't use OTJ Dual mode because it uses pin PA10, which I use for the UART (I actually only use sending for this UART, but for some reason, both pins are reserved anyway). I can toggle between Device_Only and Host_Only within STM32CubeIDE. How can I achieve that on the go in software? I don't mind if the device needs restarting in between. Any help will be greatly appreciated!
Hi everyone,I’m working with a custom board that uses the STM32H733VGT and the LAN8742AI Ethernet PHY. I’ve configured the MPU and middleware following the ST example for the STM32H75_DISCO board. The board responds to ping in release mode and after a watchdog reset in debug mode—but it fails to respond on the first run after flashing or power-up.Please find attached my .ioc and ETH Init function file in the attachments. Any comment or advice would be highly appreciated.Tnx,Amir
Hi all,I’m trying to use the external NOR flash (MX66UW1G45G) on the STM32U5G9J-DK2 board as the storage backend for a FAT filesystem using FileX.I came across the example “Fx_NoR_Write_Read_File” from STM32CubeIDE (STM32U5G9J-DK2 package), which appears to be doing exactly this — creating a FAT filesystem using FileX and LevelX on the external NOR via XSPI. However, it’s .ioc file is missing, so I can’t see how the XSPI interface and pins are configured.I built and flashed the example as-is, but the fx_media_format() call returns FX_IO_ERROR (0x90 in Hex and 144 in decimal). Could someone please guide me on the correct steps to:How to properly configure XSPI for the MX66UW1G45G in CubeIDE.The correct steps to use FileX and LevelX with external NOR flash as the filesystem backend.Thanks in advance!
Hello, I am using the STMH753ZI chip on the nucleo 144 board. I cannot figure out why my UART code will not show what I am typing in my putty terminal. Attached is my main.c. Thanks. /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2025 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. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "uart.h" /* Private includes --------------------
Post edited to follow the community rules: Please review how to share a code in this post.Using the stm32g030k8 and the Version: 1.18.1 STM32CubeIDE I just recently applied an optimization in order to get more space for my application firmware. And then I realize that the HAL_ADC_ConvCpltCallback has been optimized away. I use the -Og (debug optimization) to use the less agressive and more debug friendly optimization. __attribute__((used)) void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc1) { ADC_Average_Buff[CHANNEL_VREF] = ADC_DMA_Buff[CHANNEL_VREF]; ADC_Average_Buff[CHANNEL_VBAT] = ADC_DMA_Buff[CHANNEL_VBAT]; ADC_Average_Buff[CHANNEL_CURRENT] = ADC_DMA_Buff[CHANNEL_CURRENT]; ADC_Average_Buff[CHANNEL_TEMPERATURE] = ADC_DMA_Buff[CHANNEL_TEMPERATURE]; ADC_Average_Buff[CHANNEL_VREF] += ADC_DMA_Buff[CHANNEL_VREF]; ADC_Average_Buff[CHANNEL_VBAT] += ADC_DMA_Buff[CHANNEL_VBAT]; ADC_Average_Buff[CHANNEL_CURRENT] += ADC_DMA_Buff[CHANNEL_CURRENT];
Hi everyone, I’ve been struggling with this for several days and could really use some guidance. I’m working on a project with the Nucleo-H743ZI, using LwIP’s built-in MQTT client over Ethernet. The basic MQTT setup on port 1883 works perfectly — I can publish and subscribe without any issues. But now I need to secure the connection with TLS (MQTTS), and I’m stuck. I haven’t been able to find a clear example or step-by-step guide to make this work. Here’s what I’m trying to figure out: How to run MQTT over TLS using LwIP + mbedTLS. How to load and manage certificates (CA/root, and possibly client certs). How to wrap or replace the default TCP socket used by the LwIP MQTT client with a secure TLS layer. If anyone has done this before, or has a working example project or even just the key integration steps, I’d really appreciate your help. Thanks in advance
I use the STM32CubeIDE Version: 1.18.1 and the stm32g030k8.I have a hardware that uses a firmware. This firmware correctly returns the values of the ADC. The ADC is linked to a DMA. Channel 4 == 2545 (this is a voltage divisor) 12.5 voltsChannel 10 == 1 (this is connected to a current shunt resistor) No current, then almost 0. Channel Temperature == 929Channel Vreference == 1506 I develop a new firmware with the very same hardware (not just same design but same device). I apply debug optimization. I use ADC1 with the DMA, first I use the ioc file to set up the ADC and then I copy the MX_ADC1_Initfrom the other stm32cubeide project. Yet It does not return the same value from the external pins. Why is that? Thanks for all.
I'm trying to build a STM32U5 (THREADX_ARCH = cortex_m33) project that use FileX (https://github.com/STMicroelectronics/stm32-mw-filex) with CMake.I encounter an error that say "FileX/ports/cortex_m33/gnu" is not an existing directory.Why Cortex m33 is not supported by FileX ?
when running the QSPI_Executeinplace example code on the stm32f769i_eval board,the program enters HardFault_handler() after executing GpioToggle().i just remove the QSPI_DummyCyclesCfg(),in GpioToggle() the GPIO Not Taking effect,so How can I solve this problem? thanks
Hi all, I'm using ThreadX with NetX Duo and running a Modbus TCP server on an STM32 platform. The system works fine under normal conditions, but I encounter a hang when the following sequence occurs: A Modbus TCP client is actively communicating with the board. The client is closed or a Telnet session is opened. The client reconnects — at this point, the system hangs. From the ThreadX-aware debugger: Main Ip instance and Packet Monitor Thread are suspended, waiting on a mutex. The mutex is owned by my App Modbus TCP Thread, even though I don’t explicitly use any mutexes. It seems like the NetX internal mutex is being held too long. Can I trace or monitor the internal NetX mutex usage to better understand where the contention is happening?
Hello All, Need your support regarding flushing of RX FIFO buffer in STM32H747.I am using a barcode reader which is connected to USB HS port . And i want to clear the received data from the buffer at particular instance. And after that instance want to read the buffer again. Can anyone please suggest how can i do it. I have tried multiple method ,and i have mentioned all of them below:- 1. Using Inbuild function in STM32 USB Library file. USB_FlushRxFifo(hhcd_USB_OTG_HS.Instance); 2.Masking the RXFLVLM bit from GINTMSK Register. hhcd_USB_OTG_HS.Instance->GINTMSK &=~ ((0x1UL << (4U))); 3.Disabling the GINTMSK bit in GAHBCFG Register hhcd_USB_OTG_HS.Instance->GAHBCFG &=~ ((0x1UL << (0U))); 4. Setting Core soft reset bit in GRSTCTL hhcd_USB_OTG_HS.Instance->GRSTCTL |= USB_OTG_GRSTCTL_CSRST; 5. Deiniting & initing the USB device using inbuild functions from STM32. USBH_DeInit(&hUSBHostHS); USBH_Init(&h
Hi,I am testing an application between multiple MCUs, I have an H573, an F756 and an F439.I am testing multiple things at a time, so the code generation is helping me.In the H573 I have the flag for using the webserver without FileX, and it will define "NX_WEB_HTTP_NO_FILEX"On the F756 I don't have that. I can define it manually in the file "nx_web_http_server.h", but at code regeneration it will disappear.I don't know where to define it manually, everywhere I define it is deleted at code generation or is not defined in time.Thanks for any helpcoso2
Hi Team,Currently I am working with STM32U575ZIT6 SOC and I am using Timer for counting external clock pulses,Below is my requirement :1. I have a requirement to count external pulses using timer for 6 channels, All those channels are connected to spin rate of a physical system; a wind-turbine RPM or something similar.2. The maximum frequency of the incoming signal To ensure the timer can handle it without missing counts is up to 100 kHz and probably closer to a max of 3600.3. The counter will roll over and is expected to reset on reboot.4. Also noticed that a single timer can support only one counting element to count its pulses, Can anyone suggest How I can add a support to count 6 external pulses coming from wind turbines ? Thanks and Regards,Ram Jan
Hi all, I try to use the HAL lib in Zephyr. Anyone knows, why I cant select the hal_st modules/drivers? Best regards Lukas
Hello ,I am working with nucleo-H743Vitx. I have created Shtml pages which has different tags. When I executed the code, it is working fine.I want to display some more dynamic data . So, I added few more tags to the shtml file and I included these tags in ssi handler function as well as in ssi tags like I did for working ssi tags. When I run this code, I can see my project is working fine but the webpage is not loading and it is giving error but my other hardware is working fine. I checked the console window but there is no error related to shtml file.Then, I commented the another tag which was working and executed the code, Then the code with new tag is working fine. Again I tried with all the tag and the webpage is not displayed. I found all the tags are working fine indepenedtly but not together.I checked the tag length and it is fine . I think the issue is with number of tags or memory. Do we have any limitations on adding number of tags? if yes, Could yo
Hello everyone! BackgroundWe are working on STM32G474VET6 based custom board for some specific motor control application. Project demands to have a custom bootloader on FD-CAN with 500kbit/s arbitration baudrate and data rate with 2Mbit/s with BRS option turned ON. Bootloader is done and working fine.Board has a support for three CAN buses, therefore using FDCAN1, FDCAN2 and FDCAN3 periphery. All CAN buses has the same bus configuration and are not inter-connected. Everything works perfectly with running only application on uC. As soon as we add bootloader that runs on FDCAN1, that same application (adjusted to be bootloadable ofcourse - offseted in flash, vector table adjusted) that was running all three CANs, now hangs if any message is received/transmitted on eihter FDCAN2 or FDCAN3. If there is no traffic on FDCAN2 or FDCAN3 everything is working as expected. Beside CAN periphery we're running also ADC1&2 with injected and regular channels, triggered by cent
Split from this thread, as it's a different question.Hi @ASEHST,the example projects are made for the NUCLEO-N657X0-Q board. I tried to adapt one of that for the STM32N6570-DK board but keep on getting stuck during the DHCP resolution. Checking the schematics I realised that the pin assignment is different. But even changing the pins does not fix my problem and I keep getting stuck in the following section of "app_nextduo.c". printf("Looking for DHCP server ..\n"); /* wait until an IP address is ready */ if(tx_semaphore_get(&DHCPSemaphore, TX_WAIT_FOREVER) != TX_SUCCESS) { /* USER CODE BEGIN DHCPSemaphore get error */ Error_Handler(); /* USER CODE END DHCPSemaphore get error */ } I checked the network traffic and can confirm that the DHCP server does not receive discover package. Do you have an idea what might the problem be and if there are any known issues regarding ethernet/the tcp stack?Kind regards
Hi everyone,I'm currently working on a custom board featuring an STM32H747, and my goal is to implement a firmware update mechanism via the I2C interface. Since I'm a beginner when it comes to bootloaders (especially with dual-core microcontrollers), I'm reaching out for some help.I don't have physical access or the ability to control the BOOT0/BOOT1 pins of the MCU. This means I must rely exclusively on a custom bootloader residing in the internal Flash. This bootloader will need to handle receiving the new firmware via I2C and subsequently programming the Flash.Can anyone help me out? I'm not sure where to start.Thanks a lot for your time and support!
Hello ST Community,I’m currently developing a project on the STM32U5G9J-DK2 board and working to implement a FileX + LevelX-based file system on the external NOR flash via XSPI.I found the example project Fx_NoR_Write_Read_File in the STM32Cube firmware package, and while it’s functionally suitable, it does not include the .ioc file. This has made it challenging to fully understand and replicate the setup, especially regarding the XSPI (OctoSPI) peripheral configuration and the use of the lx_stm32_xspi_driver_glue.c for flash communication.Why This Is Important:The CubeIDE (latest version) does not provide this driver (lx_stm32_xspi_driver_glue.c) and configuration by default, making manual recreation risky and error-prone.Without the .ioc or clear documentation, it’s difficult to ensure correct XSPI timings, GPIO assignments, and memory-mapped mode settings.My current development progress is blocked until I can correctly mirror the peripheral and middleware configuration from this exa
Hello,I am trying the sleep example for the development board B-U585I-IOT02A, called PWR_SLEEP. I decided to add a channel from ADC1 module and I want to test, but I do not see any header file on the project. I enabled ADC1, channel 1 on pin PC0 in the .ioc file. Is it allowed to modify and add modules there?How do i see the complete code? Furthermore, I see the file from hal_adc contains #ifdef HAL_ADC_MODULE_ENABLED and currently the whole file is in grey as if the ADC module has not been enabled. I am not sure it should be like that.Regards,Gergana
Hi everyone,I faced a frustrating issue with lwip_connect() hanging forever when trying to use an STM32 as a TCP client (FreeRTOS V1 + LWIP stack). 🧠 Problem SummaryCalling lwip_connect() inside my STM32 TCP client code caused the system to hang indefinitely.It was getting stuck at this internal LWIP line: sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0);This only happens when the TCP/IP stack is waiting for the connection to complete, and never gets a response.🧪 Observations- I could ping the server (PC) from STM32 successfully.- My STM32 TCP server mode worked perfectly.- But when STM32 tried to connect to Hercules TCP server on port 503 — it hung forever.- LWIP debug logs showed that:- tcp_connect() was called- But the TCP state machine never moved forward- The stack kept calling tcp_slowtmr: polling application LWIP Debug Logslwip_socket(PF_INET, SOCK_STREAM, 0) = 0 lwip_connect(0, addr=192.168.1.1 port=503) tcp_connect to port 503 tcp_slowtmr: processing active pcb tcp_slow
Hello,Could someone please help me?After writing the following code to my custom board using the STM32H725, I can no longer connect to CubeIDE or CubeProgrammer.I believe the issue is due to accidentally enabling the MPU in CubeMX.I would like to recover the MCU by initializing the flash or using another method.Thank you in advance.#include "main.h" #include "stm32h7xx.h" #include "stm32h7xx_hal_flash.h" #include "stm32h7xx_hal_flash_ex.h" #include "stm32_hal_legacy.h" void SystemClock_Config(void); static void MPU_Config(void); static void MX_GPIO_Init(void); int main(void) { MPU_Config(); HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } } void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; /** Supply configuration update enable */ HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY); /** Configure the main internal regulator output volt
I have a u5 dev board running a usbx msc reference design , which works fine. I'm trying to disable the usbpd side of things within the reference example. I've disabled the usbpd midlewear and peirphal port for the 2 pd pins aswell as disabling the adc input. The design compile fine, after removipng the bsp however the usb msc doesn't work. Is there something I'm missing? There was one post mentioning about removing threadx messageing ques, I did try tweaking some of the threadx code but couldn't get anything working Any ideas on how to fully remove the pd code as I'm just using usb+and usb- ldata pins.
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.