Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hello, I am a member of Illinois Institute of Technology's professional organization Drone Development Air Sports Organization (DDAO). We are currently looking for a mentor to teach or assist us in learning how to use the STM32 Nucleo board. First, we are trying to understand how to work with STM32 and how to interact with it. Here is the list related to what we need to do regarding this “milestone”:Learn how to setup the environment , which is STM32CubeIDE, as well as connecting ST-Links etc.Understand the architecture of STM32 and its configurations.Learn how to retrieve data from sensors and users I/O devices ( such as buttons, sliders, etc. ).Learn how to display data on the OLED screen, for debugging OR monitoring purposes.Learn how to communicate with external sensors or modules using I2C, SPI, UART.Second, we want to understand how to control the external devices. We want to use data we get, to control the external devices and then visualize the output on the screen. These
Hello everyone, I'm developing a secondary bootloader (sboot) based on the STM32F429 chip, aiming to achieve "program updates without a programmer" — simply placing the compiled application file on an SD card allows the microcontroller to automatically load and run it upon power-up, greatly simplifying debugging and update processes. Currently, I'm using Cube IDE for development, with the following hardware configuration: Main controller: STM32F429 (internal Flash stores sboot; internal SRAM starts at 0x20000000 with a capacity of 256KB)External storage: Kioxia 64GB SD card (connected via the SDIO bus, used to store the application program boot.bin)External memory: 32MB SDRAM (starts at address 0xC0000000, driven by the FSMC controller, used to load and run boot.bin)Functional Process DescriptionThe sboot is 固化 (burned) in the STM32's internal Flash. Upon power-up, it executes the following steps: Initialize the minimal system (such as basic configurations for clocks, GPIOs,
I am officially confused.I'm trying to use an ADC without the HAL layer, and for some reason I just don't get it to work. With HAL, it works fine.I have tried comparing register contents, and I've now run into a wall. There must be something the HAL function is doing that I am missing or misunderstanding.In this test, I am trying to sample ADC2, channel 16, just once, without DMA or anything. With my own code, ADCSTART never goes low after I've started the ADC.When I check what the HAL code does differently, I simply don't get it.The HAL setup code (which works): ADC2Handle->Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; ADC2Handle->Init.ContinuousConvMode = DISABLE; ADC2Handle->Init.DMAContinuousRequests = DISABLE; ADC2Handle->Init.DataAlign = ADC_DATAALIGN_RIGHT; ADC2Handle->Init.DiscontinuousConvMode = DISABLE; ADC2Handle->Init.EOCSelection = ADC_EOC_SINGLE_CONV; ADC2Handle->Init.ExternalTrigConv = ADC_SOFTWARE_START; ADC2Handle->Init.ExternalTrigConvEdge
Hello, when I was running the code generated by SDK6.4.0 on STM32G431CBT6, I found that my motor was not working properly. So I grabbed the PWM output generated by Timer 1 and I want to know what caused this
Hello,I am working with a BLDC motor in sensorless mode using ST Motor Control Workbench and Motor Pilot.When I press the Start button in Motor Pilot, the motor status changes to Running based on the target speed I set, but the motor shaft/wings do not actually rotate.Additional observations:The motor is not in a locked condition (not drawing stall current).If I try to manually rotate the motor during startup, it still does not continue spinning.On Motor Pilot, the motor state shows Running, but physically it is stationary.My Questions:Why does the motor state show Running while the rotor is not moving?How can I debug this issue further to ensure proper startup in sensorless mode?Any guidance or suggestions will be greatly appreciated. Thank youBest RegardsRahul
Hi,I tried to bring up the USB host on the USB-A connector, but without success.As a starting point, I took the example project:STM32CubeN6\Projects\STM32N6570-DK\Applications\USBX\Ux_Host_DualClass (for the USB Type-C connector), replaced USB1 with USB2 throughout the code, and enabled the USB power switch via GPIO.The device receives 5V, but no USB2 interrupt is triggered.Below is my USB2 initialization. In line 18, I triedRCC_USBPHY2REFCLKSOURCE_HSE_DIRECT, and RCC_USBOTGHS2CLKSOURCE_HSE_DIRECT,but neither case works.It seems I’m missing something else. What could be wrong on my side?void HAL_HCD_MspInit(HCD_HandleTypeDef *hhcd) { if (hhcd->Instance == USB2_OTG_HS) { /* USER CODE BEGIN USB_OTG_HS_MspInit 0 */ /* USER CODE END USB_OTG_HS_MspInit 0 */ /* Enable VDDUSB */ __HAL_RCC_PWR_CLK_ENABLE(); HAL_PWREx_EnableVddUSBVMEN(); while(__HAL_PWR_GET_FLAG(PWR_FLAG_USB33RDY)); HAL_PWREx_EnableVddUSB(); /** Initializes the peripherals clock */ RCC_PeriphCLKInitTypeDef
I am connecting NUCLEO-H743ZI2 to PC via USB, it gives the following error:The interface firmware FAILED to reset/halt the target MCU STM-32List possible solutions to the above error.
Hello,I am using on my board STM32H755XIH6 CPU and I connected the SMPS feature.The board voltage is 3.3V, the SMPS regulate the voltage to 1.8V and supplies the LDO.I am using VOS1 and right now it's working WELL at room temperature.I measured the VLXSMPS and I want to be sure if the overshoot and undershoot is ok?can the component be damaged from this overshoot and undershoot?can you explain to me why I see this?
Hello, I am working on an STM32F446RE with a custom bootloader and FreeRTOS application. Bootloader address: 0x08000000 Application address: 0x0800C000 The bootloader successfully jumps to the application by setting MSP, PC, and SCB->VTOR. In my application, I configured FreeRTOS to use a hardware timer (TIM14) instead of SysTick as the OS tick source. Problem:When I flash the application directly, it runs fine.But when I run through the bootloader, the application stops working as soon as it calls HAL_Delay(). If I comment out HAL_Delay(), the app continues normally. After the RTOS kernel starts, I get a HardFault on the first interrupt. I suspect this is related to SysTick still being dirty from the bootloader, while my application is configured to use TIMx as the tick source. My questions: What is the recommended way to cleanly reinitialize the HAL tick and interrupt system after jumping from a bootloader to an application that uses TIMx instead of SysTick? Should I
I'm already achieved a USBX-MSC class, and also a FileX in MCU local.I know that using two file systems at the same time is not recommended, but still have some questions. 1. I implement the ux_deveice_msc.c as followed. Use PC-Windows to create a file such as my_test.txt to U-DISK, successfully and the local FileX will see the new file immediately. UINT USBD_STORAGE_Read(VOID *storage_instance, ULONG lun, UCHAR *data_pointer, ULONG number_blocks, ULONG lba, ULONG *media_status) { UINT status = UX_SUCCESS; /* USER CODE BEGIN USBD_STORAGE_Read */ UINT fxStatus = FX_SUCCESS; while (number_blocks--) { fxStatus = fx_media_read(sdioDisk, lba, data_pointer); if (fxStatus != FX_SUCCESS) { status = UX_ERROR; break; } data_pointer += sdioDisk->fx_media_bytes_per_sector; lba++; } /* USER CODE END USBD_STORAGE_Read */ return status; } UINT USBD_STORAGE_Write(VOID *storage_instance, ULONG lun, UCHAR *data_pointer, ULONG number_blocks
ST moderator: Thread moved from "STM32CubeIDE" forum to "STM32 MCUs Embedded software" forum. Hello, I am currently working on STM32H755 (dual-core M7/M4) and trying to use the FMC interface to connect to an external SRAM. I have checked the STM32CubeH7 firmware package, but I could not find any ready-made FMC SRAM example for STM32H755 (most examples for STM32H745). I have checked the STM32CubeH7 firmware package,and it seems that for STM32H745 (and STM32H755) there is only an FMC SDRAM example available,located under: STM32CubeH7\Projects\STM32H745I-DISCO\Examples\FMC\FMC_SDRAM_DataMemory Could you please provide: An official or working example project for STM32H755 FMC SRAM Clarification about which core (M7 or M4) should configure the FMC? Best regards,Allen
您好,我已经在STM32G431上成功配置了 6.4.0 SDK 包。 但是,当我按下按钮并开始预充电过程时,报告了硬件故障。 如果我在预充电过程中将上侧 PWM 波的刻度值从 0% 更改为 90%,程序将在 RUN 后进入 STOP 状态,然后进入故障状态。故障代码为 40,定义为 #define MC_BREAK_IN ((uint16_t)0x0040) /**< @brief 错误:紧急输入(过流)。 */ Post edited by ST moderator to follow the community rule which is using English language. So in next time please use English as it's an international community and to let others to understand your post. Thank you for your understanding. Translation: Hello, I have successfully configured the 6.4.0 SDK package on my STM32G431. However, when I press the button to initiate the pre-charge process, a hardware fault is reported. If I change the duty cycle of the upper PWM waveform from 0% to 90% during the pre-charge process, the program enters a STOP state after running, and then enters a fault state. The fault code is 40, which is defined as #define MC_BREAK_IN ((uint16_t)0x0040) /**< @brief Error: Emergency input (overcurrent) */
Good morning everyone,I’ve encountered some unexpected behavior while debugging my application. I’m trying to connect to an MQTT server and publish a message using the embedded Ethernet port, LwIP, and FreeRTOS. I’m developing with CLion IDE and CMake.Issue description:Every time I set a breakpoint somewhere in the MQTT-related code (located in freertos.c) and click the “Step Over” button, the debugger opens a new tab with stm32f7xx_it.c and jumps into the global Ethernet interrupt handler. Before I added FreeRTOS to the project, debugging worked as expected. As a result, I’m no longer able to debug my application properly.Do you have any idea how I can change this behavior?PS: I’m not sure if this issue is related to my IDE, OpenOCD, or another part of the toolchain, which is why I decided to post here.
Hi all,I’m working on a project using an STM32F407 and running into issues with low-power modes. I can put the MCU into STOP mode successfully, but when I try to wake it up with an external interrupt (EXTI line on a GPIO pin), nothing happens. The device just stays stuck until I reset it manually.Here’s what I’ve tried so far:Configured the EXTI line with rising-edge trigger.Verified the interrupt works fine when the MCU is running normally.Enabled the corresponding NVIC interrupt before entering STOP mode.Added __WFI() after setting STOP mode in the power control register.Despite this, the MCU never wakes up when the pin is toggled. I must be missing something in the clock or power configuration, but I can’t figure it out.Has anyone dealt with this before on STM32F4 (or similar STM32 family)? Any pointers on debugging wake-up sources in STOP mode would be a huge help.Thanks!
It seems like the program is getting stuck in the Error_Handler loop and not coming out. Could there be a problem with my code? /* 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 "can.h" #include "usart.h" #include "gpio.h" /* Private includes -------------------------------------------------------
Hi all,I'm trying to use the partial frame buffer feature and I get the first two partial frames (40 lines), but TouchGFX does not seem to update the screen into the partial buffer. Just using TouchGFX no DMA, and no ChromArt. My home screen is :But the LCD only displaysLooking at the partial frame buffer, the rest of the screen is not rendered.Do I need to make some call in frame transfer to update to the next partial frame?ThanksArcher
I have a question, when I jump from the bootloader to application code from internal flash, I didn't have to disable the interrupt and re-enable them in application, however when I do using the external flash I have first disable then re-enable the interrupt in the application code, otherwise the code just get stuck inside the HAL_InitTick() if i do not disable interrupt in bootloader. It is only that I re-enable the interrupt after SystemClock_Config() function in the application code that my code start working properly as I disable the interrupt from bootloader. I'm a bit confused why is this the behaviour even though the jumping function is same with the only reason of disabling interrupt in the case of external flash with the reason mentioned above ?
Hello, I found in the documentation search for STM32U5G9 that some interfaces available for high-speed communication, such as OctoSPI and HexaSPI, do not seem to support slave mode. The device we are making requires two STM32U5G9 chips, each connected to a display, and these displays need to show synchronized content. Additionally, one of the U5G9s will connect to a CYW55513IUBGT for network/Bluetooth communication, while the other needs to acquire data through high-speed communication between chips, so UART may not meet the requirements. Therefore, I would like to understand how I can enable high-speed communication between the two STM32U5G9 chips. ...
Greetings,I have tried lora on STM32 nucleo bards. I want to learn to make custom code for STM-32-WL-E5CCU using cube mx. Is it possible ? I want to implement LORA SubGHz and not LORA WAN. Is there any tutorial pdf or video that teaches or gives some insight for building applications for lora using cube mx ?
Hi,I am working with the STM32WBA62CI MCU and need to communicate with an external SPI-based device by reading 34 registers (16-bit each) periodically. I want to store received data in RAM for 20 such events before overwriting it and continuing indefinitely.Currently, I can successfully perform the DMA based SPI communication using HAL_SPI_TransmitReceive_DMA() triggered by a timer interrupt, incrementing the RX buffer manually by 34 on each transfer. However, I want to eliminate CPU involvement by triggering the SPI DMA transfers via peripheral interconnects and/or GPDMA triggers.From my research, I understand there are two possible approaches:SPI Autonomous Mode (trigger SPI):Configure SPI1 in autonomous mode triggered by LPTIM1_CH1.Start LPTIM1 so that its update event triggers SPI and automatically starts GPDMA channels 6 and 7 transfers as SPI requests them.GPDMA Trigger Mode (trigger GPDMA):Configure SPI1 normally (no autonomous mode) and configure GPDMA channels 6 and 7 to be tr
Hello,I’m working with STM32WB55. I used this example:STM32WB-BLE-HID-Selfie (https://github.com/stm32-hotspot/STM32WB-BLE-HID-Selfie).I have a working Mouse HID over GATT using that project (no .ioc).Now I want to create a new CubeMX (.ioc) project for my product (so I can configure peripherals in CubeMX), and reuse the HID logic from the Selfie example. I’m not sure what the minimal, correct set of files and steps is.EnvironmentMCU/Board: STM32WB55 (my custom board)STM32CubeWB FW pack: v1-23-0STM32CubeIDE: v1.19.0Wireless Coprocessor on CPU2: BLE Full Stack What I triedCreated a new .ioc project with BLE → Custom Template.I can see the middleware and app files in Includes, but I’m unsure which files from the Selfie example I should copy and where.I’m also not certain where to call the HID init functions in the generated code.What I’m askingWhat is the minimal set of files to copy from BLE_HID_Selfie into a .ioc project? (e.g. hids.c/.h, hids_app.c/.h, hid_report_desc.c, Utilitie
Can the STM32WB55 use external SRAM, or can it only use external PSRAM?If external RAM can be used, can it also be used to execute code and run tasks?
Hello, I am working with the STM32H747I microcontroller and using the SPI6 peripheral to interface with an external ADC (MCP3462RT). I have observed that when the system clock (SYSCLK) is set to 120 MHz, SPI6 communication works correctly and the ADC provides valid data. However, when SYSCLK is configured to 480 MHz, the ADC starts giving wrong readings even though SPI6 does not hang. To debug this further, I need clarification: On the STM32H747BIT6, is SPI6 clocked from APB4 (via RCC_APB4ENR) or from another APB domain? If SPI6 is indeed on APB4, does its effective clock depend on D2PCLK1/D2PCLK2 or directly on D3PCLK4? Are there any known limitations when running SPI6 at high system clock frequencies (SYSCLK = 480 MHz)? Understanding the exact clock domain of SPI6 will help me tune the prescaler and ensure reliable ADC communication. Thanks in advance for your support. Best regards,Sai Ganesh CS
void HAL_SMBUS_ErrorCallback(SMBUS_HandleTypeDef* SMBUSHandle) { /** Error_Handler() function is called when error occurs. * 1- When Slave doesn't acknowledge its address, Master restarts * communication. 2- When Master doesn't acknowledge the last data * transferred, Slave doesn't care in this example. */ if (HAL_SMBUS_GetError(SMBUSHandle) != HAL_SMBUS_ERROR_ACKF) { printf("failed\r\n"); /* Turn Off LED2 */ } } /** * @brief Slave Address Match callbacks. * hsmbus : Pointer to a SMBUS_HandleTypeDef structure that contains * the configuration information for the specified SMBUS. * @retval None */ void HAL_SMBUS_AddrCallback(SMBUS_HandleTypeDef* hsmbus, uint8_t TransferDirection, uint16_t AddrMatchCode) { SlaveAddrMatchCode = (AddrMatchCode << 1); HAL_SMBUS_EnableListen_IT(&hsmbus1); uint8_t tx_buff = 0x00; HAL_SMBUS_Slave_Transmit_IT(&hsmbus1, &tx_buff, 1, SMBUS_FIRST_AND_LAST_FRAME_WITH_PEC); // HAL_SMBUS_Slave_Transmit_IT(&hsmbus1, &am
Hello,We try to upgrade the BLE stack to the latest 1.23.0. This version requires FUS v.2. We are unable to do this due to the FUS_STATE_IMG_NOT_AUTHENTIC error. We're using STM32CubeProgrammer v. 2.12.0. We have also tried with STM32CubeProgrammer v. 2.20.0following the steps in the release note of the binary files with the same result. Currently:- FUS version: 1.2.0.0- BLE stack version: 1.8.0.3. We tried on both out custom board and on NUCLEO-WB44 with the same result. Could someone guide us to a solution?Thanks in advance.
ST Community highlights – April to June 2026
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.