Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
In this code I want IDs 0x100 and 0x200 should only be accepted but in my code all IDs are accepted. How to resolve this?/* 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" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includ
Hello,I have a question regarding the STM32WBA55G-DK1 board I have on hand.On my board, R42 is not populated. Could you please confirm whether R42 is not mounted by default?R42 is a 0 Ω resistor located on the control line of the general-purpose LED (LD3), and according to the schematic it appears to be mounted.I would appreciate it if someone could clarify this.Thank you in advance.
Hi, I've created a project with cubemx, copying the configuration generated with touchgfx designer for this board with the only change being that I wish to use threadx instead of FreeRTOS. I'm able to compile and flash to the board and after hours of debugging I can't seem to find what the issue might be, everything seems to be working fine but all I get is a blank screen. I've updated the linker script to use external ram (just as it is when generating the project via touchgfx designer) and when debugging I can step through the boot and application program no issue, no errors or faults. Has anyone run into this before and got out of it? I tried just about everything that I can think of at this point. Additional info:-Stm32CubeIDE Version: 1.18.1-Stm32CubeMX Version: 6.14.1-Touchgfx Designer Version: 4.25.0-Threadx version: 6.4.0-Touchgfx generator version: 4.25.0Thank you.
To get my first sensor project done and after selecting my board, I enabled I2C1 which triggered pins PB6 and PB7 as shown below: Then used code below (in main.c) with the purpose that the LED is on when the temperature is higher than 40 degrees and off otherwise. #include "main.h" extern I2C_HandleTypeDef hi2c1; // I2C handle from CubeMX #define HTU21D_ADDR (0x40 << 1) // 7-bit address shifted for HAL #define TRIGGER_TEMP_MEASURE_HOLD 0xE3 I2C_HandleTypeDef hi2c1; UART_HandleTypeDef huart2; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_USART2_UART_Init(void); static void MX_I2C1_Init(void); float HTU21D_ReadTemperature(void) { uint8_t cmd = TRIGGER_TEMP_MEASURE_HOLD; uint8_t data[2]; // Send temperature measurement command HAL_I2C_Master_Transmit(&hi2c1, HTU21D_ADDR, &cmd, 1, HAL_MAX_DELAY); // Receive 2 bytes (temperature) HAL_I2C_Master_Receive(&hi2c1, HTU21D_ADDR, data, 2, HAL_MAX_DELAY); // Combi
I'm using the STM32F401RE in a new design and trying connect the USB CDC device interface to FreeRTOS_CLI. I modified its _write function to call CDC_Transmit_FS, but I don't see a received data callback where I can add a xTaskNotifyFromISRfor to send data to the CLI task.It looks like I call CDC_Receive_FS to get the data, but I need an interrupt to trigger the call to that function. Where can I hook in a callback function?
Hello,I am developing an embedded project using the STM32H7 microcontroller, integrating FreeRTOS, FatFs file system, USB mass storage device (USB flash drive) functionality, SD card reading/writing,UART communication, and ADC sampling. My system uses LVGL as the graphical user interface (GUI) library and drives the LCD through LTDC.Core issue phenomenon:I observed that the system's functional behavior has a direct and consistent correlation with the on/off state of the LVGL screen:DISPLAY_ENABLE is a macro definition I created to control whether to use the screen.When the screen is off (DISPLAY_ENABLE = 0):All functional modules (USB mass storage mounting and writing, UART communication, ADC sampling, SD card reading/writing, database operations) work normally.When the screen is on (DISPLAY_ENABLE = 1), two different phenomena occur:Phenomenon 1: When test buffers (writeBuffer/readBuffer, 512 bytes each) are located in the data segment:USB mass storage device fails to mount (output lo
Hello there, I'm using a STM32G431KBU and programming it using STM32 Cube IDE.There are 2 pins, PB4 and PB6, both digital inputs, I'm having problem with. On both, I apply 5V with a 10K pull-up resistor, while the MCU is working is at 3V3, this should work fine, as both are five-volts tolerant (FT), as per datasheet. When connected to the pull-up resistor, the voltage on the pin drops to 1V7 - 1V6, while there is 3V3 on the pull-up resistor. It looks like there is a pull-down resistor configured on these pins, and according to the DS, these pull-down resistors are controlled by the level on PA9 and PA10:I've tried to disable these before GPIO init, but it did not work:Any recommendations on how to properly disable these internal pull-down resistors on PB4 and PB6?
Hi,I recently started working on a custom board using the STM32U5G9ZJT6Q microcontroller. I'm planning on using TouchGFX with LTDC, DMA2D and GPU2D to implement a graphical user interface and AzureRTOS as rtos.I am encountering a problem when, in the main function, the microcontroller hard faults during the MX_TouchGFX_PreOSInit function, in particular at the FrontendHeap& heap = FrontendHeap::getInstance() call.I am using STM32CubeIde 1.19.0 with STM32CubeMX 6.15.0 and TouchGFX 4.25.0. I also tried with TouchGFX 4.24.2 with no luck unfortunately.Here are the screenshots of the hard fault info, stacktrace, and disassembly as shown by STM32CubeIde:I also attached a minimal project in which I only configured the relevant intefaces and middlewares and in which the problem still occurs.I already made sure that the CRC peripheral is enabled as suggested in other posts I found. Sorry if I made some mistakes as it is my first time posting, and thank you for any help you ca
Hello ST Community,I'm working on an STM32N6570-DK project where I've merged two example codes from the STM32CubeN6 repository:1 . DCMIPP_ContinuousModehttps://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/STM32N6570-DK/Applications/DCMIPP/DCMIPP_ContinuousMode Used for capturing data from the IMX335 camera and displaying it on LTDC.2 . Nx_WebServerhttps://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/STM32N6570-DK/Applications/NetXDuo/Nx_WebServerModified to set a static IP and transmit packets over Ethernet and not using the SD card part and FileX.The merged code compiles successfully in STM32CubeIDE. I've attached a ZIP file containing the full merged project for reference.Initially, I used the linker script (STM32N6XX_AXISRAM2_fsbl.ld) , which allocates 512KB of RAM (255K + 256K) and manages Ethernet buffers, I attached .txt file named WORKING.Camera image is visible on the LCD.Ethernet packets (with static data) are sent at ~900
Hi all, I am working on a project based on the STM32WB55MMG, where I want to use the AES module to encrypt data using a previsouly programmed key in the FUS.I have downloaded the corresponding key with the command STM32_Programmer_CLI.exe -c port=JTAG -wusrkey XXX_key.bin keytype=1 but it would seem that the key has been written in index 1, not 0 as I was expecting. If I try to load the key using SHCI_C2_FUS_LoadUsrKey(0) it returns SHCI_FUS_CMD_NOT_SUPPORTED but if I try with index 1 instead it returns SHCI_SUCCESS.I cannot confirm the written index as the command line did not return the actual index where the key was written. In fact, I think this is a known issue when downloading a key using SWD.My question is if index 0 is reserved for another purpose and actually the first slot that can effectively be written with a general user key is 1. Thanks in advance.
Hello,I am running a BLDC motor in sensorless mode using Nucleo-F101RE with the X-Nucleo-IHM16M1 board. The motor starts successfully when I press the Start button from the Motor Pilot GUI.However, I am facing the following issues:When I suddenly increase the speed to high RPM, I get a speed feedback fault.When I suddenly decrease the speed, I also get a speed feedback fault.Sometimes I also encounter an overvoltage fault during these speed changes.Any guidance on how to resolve or tune the parameters properly would be very helpful.Thank youBest RegardsRahul
I am using stm32 303e eval , i want to display an image on the in built lcd mounted on the mcu . i am using touchgfx,cubemx and IAR workbench. In touch gfx this mcu does not appear so i started with cubemx with initial peripherals then i go to touch gfx and then to IAR workbench my code is running but nothing appears on the lcd.psi am using stm32 303e eval mcu with touchgfx,cubemx,IAR workbench. since this board is not available on touch gfx i started my project with cube mx selected this board then went to touch gfx.During debugging it is not stepping into if statement provided in gpio pin configuration lcd pin is low i am using non rtos path and nothing is appearing on the screen but there is no error in the code Title edited by ST moderator to reflect the content of the post.In next time please use relevant title reflecting the question/request.
We are testing the STM32F407G-DISC1 development board and trying to use an external 32.768 kHz LSE oscillator for RTC clock source. Since the onboard crystal footprint was empty, we manually soldered the following components on the LSE pins (PC14 and PC15):Crystal oscillator: ABS25-32.768KHZ-4-T from Abracon(Product link: https://robu.in/product/abs25-32-768khz-4-t-abracon/#tab-specification)Load capacitors: CC0603CRNPO9BN6R8 (Recommended value per crystal datasheet)Despite carefully soldering the components and verifying the connections, RTC initialization (HAL_RTC_Init) always fails with error code 1 (HAL_ERROR).I have attached my main.c source code here for your reference/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All right
Hello,I’m testing a motor with integrated Hall sensors for which I don’t have the datasheet and that I can’t disassemble. From the tests I’ve done, it appears to be a 4-pole motor with Hall sensors spaced 120 mechanical degrees apart.I first tested the motor in voltage mode without using the Hall sensors: it runs smoothly, doesn’t overheat, and spins correctly, so the pole count seems right. Then, I moved jumpers 5, 6, and 7 to connect the Hall signals to the microcontroller, powered them at 5 V with jumper 3, and checked the H1, H2, H3 sequence with an oscilloscope. The signals are present and in sequence.However, when I try to start the motor, it needs a manual push to get going and then it immediately ramps up to maximum speed. Also, I don’t see any speed feedback on the Motor Pilot, and I can’t change the target speed. If I try enabling polling of HALL_SPEED or HALL_EL_ANGLE from the registers, I get the following log error:[WARNING] - MotorControlRegistersBank: Accessing register
Hi, just looking to learn the best way to do this. We're aiming to create a system for STM32H7R/S where the bootloader acts as USB MSC device to store a number of different app binaries to a permanently-mounted SD card. At system restart, the booloader needs to let the user chose which of the binaries to load from the SD card (the system has a small touch screen). The bootloader would then load the binary from the SD card into the fast internal RAM and run it there. Is the External Memory Loader a good way to do this? Is this use case supported by CubeMX? Is there a good set of examples or "howto" documents?
Guys currently I am working on STM 32 H7 board and trying to achieve 3.6MSPS as per mentioned in an datasheet, after many tries currently I can able to take 175k samples/second as 12 bit resolution ADC values using an USB FS but if they claimed to be 3.6MSPS is achievable means then we can achieve it right?? here I have attached my code that can get max of 175 samples only but I have to achieve more, help me to get out this problem
Hello STM Community,I am developing a custom board based on the MB997E reference design. In this design, the EMIF02-USB03F2 (USB ESD/EMI protection device) is used, but since this part is now obsolete, I am migrating to the USBDF01W5.I have updated the schematic accordingly (attached). The design also uses:STMPS2141STR (USB power switch)USBDF01W5 (replacing EMIF02-USB03F2)Standard USB connector (475900001)I would like to request the STM experts and community to please review my schematic connections with focus on:Correct integration of USBDF01W5 in place of EMIF02-USB03F2.Any impact on EMI/EMC test compliance due to this migration.Whether additional filtering (e.g., common-mode choke, RC filters) is required for better EMI performance.Placement/grounding recommendations to ensure ESD robustness.Review of the series resistors (22 Ω on D+/D– lines) and overall USB signal integrity.Since EMIF02-USB03F2 included EMI filtering while USBDF01W5 mainly provides ESD protection, I am concerned
Today I bought a new NUCLEO-H563ZI board and downloaded the STM32CubeH5 main software package from www.st.com. But when I compile the example "STM32CubeH5 main \ Projects \ NUCLEO-H563ZI \ Applications \ NetXDuo \ Nx_UDP_Cho_Server" with IAR, it prompts that some files is missing. I had to download the missing files from elsewhere and put them in. Finally, the compilation passed, but after burning the out file into the board, the program could not run properly. After debugging, it was found that there was a DMA error in the Ethernet. I changed an other example to compile, burn, and debug. the same mistake. I don't know how to solve it. By the way the net cable and the led of the ethnet socket CN14 is ok. Can ST provide a complete examples package for the NUCLEO-H563ZI board? Title edited by ST moderator to reflect the content of the post.
I did not understand the significance of the number 65536 in the below codepHandle->OvfFreq = (uint16_t)(pHandle->TIMClockFreq / 65536U); /* Set fixed to 150 ms */ pHandle->HallTimeout = 150U; /* Compute the prescaler to the closet value of the TimeOut (in mS )*/ pHandle->HALLMaxRatio = (pHandle->HallTimeout * pHandle->OvfFreq) / 1000U ; /* Align MaxPeriod to a multiple of Overflow.*/ pHandle->MaxPeriod = pHandle->HALLMaxRatio * 65536UL;My main confusion is how the OvfFreq with division of 65536 help the code to reduce the calculations. According to my understanding if TIMClockFreq = 170MHz then the time is T = 1/170Mhz i get overflow after 65535, so if the number of overflows are OverflowCnt then the total time elapsed will be 65535*1/170MHz*OverflowCnt + Input capture timer registers.
Hi all,Please help to point me where I did a wrong. I have different widget on the main screen, and when I switched back and forth, the main screen (where there are most widgets implemented) intermittently not display all the widgets. Sometime I got text box not display, sometime I got the toggle button not display but just show the rectangular box showing the button box. For example, in this picture, the whole square box (this is the area for the toggle button) dis empty showing the gray area.The behaviors seems like the widgets not display are the one toward the end of the widgets list.
Hi everyone. I have a STM32H745I-Disco board and I am using both TouchGFX and CubeIDE to make a project with the board. So the issue I am encountering is that when I wrote or made some adjustments in the both applications the project seems fine (when i built the project in CubeIDE it gave 0 errors or the simulator in the TouchGFX worked just fine) but when I try to debug to project in to the board using the debugger in the TouchGFX the application shows it debugged just fine but there is nothing showing up on the board afterwards. When I try to debug a blank new created project it shows up on the screen but when I'm trying to debug a project with some images or fdcan codes with it the issue I've just said shows up. I don't know what's the problem.
Problem descriptionHi everyone,I’m working with a NUCLEO-F411RE board and I need to use USART2 (PA2=TX, PA3=RX) to communicate with a LoRa module (Reyax RYLR998).The issue is: even though I configure USART2 in CubeMX, all data I send ends up on the COM9 (ST-LINK VCP) of my PC (USB micro connector), not on the physical pins PA2/PA3.What I want:Data should go out via PA2/PA3 → LoRa module.But instead it always goes to the PC via COM9.What I already checkedCubeMX configurationUSART2 enabled in Asynchronous mode.PA2 assigned to USART2_TX, PA3 assigned to USART2_RX.Baudrate = 115200, 8N1, no flow control.SYS/Debug set to Serial Wire (not Trace Asynchronous SW).printf redirectionNo active redirection to ITM/SWV.When using printf, I have _write function pointing to huart2: int _write(int file, char *ptr, int len) { HAL_UART_Transmit(&huart2, (uint8_t*)ptr, len, HAL_MAX_DELAY); return len; } SWV disabledIn CubeMX: Debug = Serial Wire only.Not using ITM or ITM_SendChar.Direct test in c
I adapted the official BSP example code (available at https://www.st.com/en/embedded-software/stm32cubeu5.html, stm32cubeu5-v1-8-0.zip) to acquire and process audio. My code is running very slowly on the board. We thought the slowdown might be due to other features enabled by default that I don’t need. Therefore, I created a project from scratch, enabling only the pins I need, but I’m doing something wrong with the GPDMA1 and MDF1/ADF1 filter configuration (even callbacks don't work). Could you provide an example .ioc file with the integrated microphone configured correctly (with GPDMA1) or, alternatively, the BSP .ioc project itself (which is not included in the official example you provide)? Thank you.
I am trying to use X-CUBE-ST67W61M1 but I am failing to read any data with COM port set as document um3449 indicates (I am currently using a UART-TTL converter connected on CN7 of X-NUCLEO-ST67W61M1). I am trying to update the X-NUCLEO-ST67W61M1 firmware to see if anything changes, but NCP_update_mission_profile.bat from X-CUBE-ST67W61 does not support update with my Nucleo board. Are there any ways to bypass this problem?Moreover, any ideas about why I am not reading anything sensible from the X-NUCLEO-ST67W61M1 UART port? Thanks in advance for any advice
Hi, I'm trying to use my P-NUCLEO-WB55.USBDongle with the BLE_TransparentModeVCP_reference.hex firmware.Following the documentation I have updated FUS and installed the latest (V1.23.0) stm32wb5x_BLE_Stack_full_extended_fw.bin wireless firmware: Afterwards, I flashed BLE_TransparentModeVCP_reference.hex, put SW2 into run mode and reconnected the dongle. It shows up in device manager as a COM Port, but connecting with STM32CubeMonitor-RF fails:I also tried building the TransparentModeVCP Firmware from source, but it fails the same way. What am I doing wrong?
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.