Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Dear ST Team,I am using the STM32H5 Nucleo-64 board (MB1814) to develop a CAN communication-based application. In my implementation, I am using the TX Queue for message transmission and RX FIFO0 for message reception, both operating through interrupts.While reviewing the HAL library, I observed that the Message RAM allocation for the RX FIFOs and TX Queue is defined using static, hardcoded macros, as shown below:#define SRAMCAN_FLS_NBR (28U) /* Max. Filter List Standard Number */#define SRAMCAN_FLE_NBR ( 8U) /* Max. Filter List Extended Number */#define SRAMCAN_RF0_NBR ( 3U) /* RX FIFO 0 Elements Number */#define SRAMCAN_RF1_NBR ( 3U) /* RX FIFO 1 Elements Number */#define SRAMCAN_TEF_NBR ( 3U) /* TX Event FIFO Elements Number */#define SRAMCAN_TFQ_NBR ( 3U) /* TX FIFO/Queue Elements Number */Since my application uses only TX Queue and RX FIFO0, I would like to know whether it is possible to reallocate the Message RAM to increase the number of elements for these two resources while set
I’m using SDIO + DMA on an STM32F407 and I need a “transfer complete” callback for SD writes/reads. What is the correct way to attach a user callback for SDIO + DMA completion when using the CubeMX‑generated SD/FATFS drivers?Thank you!
/* * Stl_Scheduler.c * * Created on: Jun 25, 2026 * Author: User */#include <stl_user_api.h>#include "stl_scheduler.h"#include "main.h"#include "app_threadx.h"#include "APP_Log.h"extern TIM_HandleTypeDef htim15;/* RAM & FLASH Tests definitions */#define FLASH_SECTION_SIZE 1024U#define RAM_SECTION_SIZE 128U#ifdef STL_DISABLE_RAM_BCKUP_BUF#define RAM_BACKUP_BUFFER_SIZE 0#else#define RAM_BACKUP_BUFFER_SIZE 32#endif// STM32H523#define TEST_RAM_START_ADDR (0x20000000U + RAM_BACKUP_BUFFER_SIZE)#define TEST_ROM_START_ADDR 0x08000000U//#define TEST_ROM_END_ADDR 0x0801A3FF//#define TEST_ROM_END_ADDR 0x0801A00FU#define TEST_ROM_END_ADDR 0x0801A3FFU//#define TEST_ROM_END_ADDR 0x0807F7FFU/*#if (defined (__GNUC__) && !defined (__CC_ARM) && !defined (__ARMCC_VERSION))extern void *_edata_load;#define TEST_ROM_END_ADDR ( (uint32_t)&_edata_load + 3)#endif*/// Runtime RAM test: 8 sections x 128 bytes = 1024 bytes#define TEST_RAM_SECTION_NB_RUN 8 /* only 8 RAM
Is there any doco or app note on how to save/restore a STM32H7 CRC calculation (e.g. breaking up long CRC calculation into separate segments that requires re-initialization of CRC HW between segments)?
Thank you for taking the time to review my question.I migrated the Ux_Device_Audio_2.0_Standalone of STM32WBA6 to STM32H503 and successfully enumerated using USB FS. However, out of 1000 entries into the USBD_AUDIO_PlaybackStreamFrameDone function per second, half are 4 bytes long and half are 384 bytes (audio stream). I monitored the data using USBlyzer and did not see any upload data (EP IN) from STM32H503. I don't know where these 4 bytes come from, and this issue has been bothering me for several days.VOID USBD_AUDIO_PlaybackStreamFrameDone(UX_DEVICE_CLASS_AUDIO_STREAM *audio_play_stream, ULONG length){ /* USER CODE BEGIN USBD_AUDIO_PlaybackStreamFrameDone */ UCHAR *frame_buffer; ULONG frame_length; int32_t ret; UNUSED(ret); /* Get access to first audio input frame. */ ux_device_class_audio_read_frame_get(audio_play_stream, &frame_buffer, &frame_length); if (length) { HAL_GPIO_TogglePin(GPIOA, GPIO_PI
Hello, I have connected a sensor to my nucleo board to send data when sensor detects movement.I have introduced an ISR for that.void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){ if (GPIO_Pin == GPIO_PIN_0) { pirDetected = true; }} unfortunatelly with that approach everytime the sensor was triggered ( I was able to measure 3.3v on the OUT pin using voltmeter) my stm32 is kind a freezing. I have introduced some testcode,extern "C" int main(void){ /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); while (1) { if(HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0)) { HAL_GPIO_Write
I am working on an STM32 based IoT project where I want to fetch original quality media files from public Instagram post URLs and display them on a connected TFT screen. The concept is similar to how browser based tools like snapinsta.ink work where a public post URL is parsed to extract the direct media file URL which is then fetched as raw image data. My current implementation uses the STM32 HAL HTTP client library to send a GET request to the public post URL and parse the JSON response to extract the highest resolution media node before downloading the file to external flash storage. The main challenge I am running into is that the response payload size exceeds the STM32 heap allocation when trying to buffer the full response in memory before parsing. Has anyone implemented a similar HTTP response streaming and parsing workflow on STM32 and found a reliable way to handle large JSON payloads without loading the entire response into SRAM.
I'm implementing getQuat() for the BNO055 on both STM32 and Arduino and getting very different times. On STM32H7 (HAL, 400kHz I2C) my equivalent code measures ~394µs typical with frequent spikes up to ~2573µs (mean ~912µs), but on Arduino with the Adafruit library getQuat() I get ~2ms. Is my STM32 HAL code below a fair equivalent of the Adafruit getQuat(), so that the times are actually comparable?adfruit bno055 offical library /* 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. * ****************
I am working on the STM32N6570-DK and would like to implement FOTA (Firmware Update) through Ethernet.We are planning to perform the firmware update over a wired Ethernet connection, not through wireless or OTA.Could you please suggest which protocol is better for firmware image update:UDP TCP HTTPKindly let me know the recommended approach for reliable firmware updates over Ethernet.Also, if there are any example projects or reference code available for implementing firmware update over Ethernet on STM32N6570-DK, please share them. It will be very helpful for our development.
Hiya. I’m working on a project that writes to a microSD card over SPI using an RTOS (ThreadX in this case). I’ve had a bit of trouble implementing it over the weekend since I’ve seen little/no support for SPI on FileX and I’ve had issues porting over FatFs SPI code over to this project. Looking for some help and guidance with this! I’m not experienced with FileX or FatFs, so the solution could be pretty simple.With FileX, I can initialise but cannot mount the drive (memory pool allocations has been large enough). I used this custom library for the SPI implementation: With FatFs, I was also able to initialise but could not mount the drive. Again, I am pretty new to this stuff, so a series of steps to implement and identify the problems would be greatly appreciated. I can figure out the rest of the code (like writing and reading), I’m just struggling with initialising and mounting.
Summary On a NUCLEO-N657X0-Q I have a custom (non-CubeMX-template) FSBL that copies an "LRUN" application image from external XSPI flash into AXISRAM and jumps to it. The byte-identical signed FSBL runs completely when I stage it with the debugger in Development boot (monitor reset → load → jump Reset_Handler) — the app runs end to end. But in true ROM flash-boot (BOOT pins set for boot-from-flash, power-cycle, no debugger), the FSBL reaches main() (user LEDs light) and then locks up before its first clock-configuration step. The lock-up is invisible to SWD, UART, and even fault handlers, which points at a processor LOCKUP tied to the state the boot ROM leaves at the FSBL entry in flash-boot (security / RIF / clock), which differs from the debugger path. I would like to understand what minimal init my FSBL must do at entry in flash-boot. Hardware / tools - Board: NUCLEO-N657X0-Q (MB1940), STM32N657X0H, Cortex-M55 + Neural-ART. Device ID 0x486, Rev Z. Lifecycle state: OPEN (SWD attac
Board: STM32N6 (Custom board with USB OTG HS)I am trying to create a USB composite device with: - CDC ACM Instance 0 (LOG port) - Interfaces 0, 1 - CDC ACM Instance 1 (DATA port for GenICam/GenCP) - Interfaces 2, 3 - UVC VIDEO class - Interfaces 4, 5Dual CDC works perfectly. However, when I add CLASS_TYPE_VIDEO to UserClassInstance[], the device fails to enumerate entirely (not visible in lsusb). --- Working Configuration (Dual CDC Only) // ux_device_descriptors.c uint8_t UserClassInstance[USBD_MAX_CLASS_INTERFACES] = { CLASS_TYPE_CDC_ACM, // CDC0 - interfaces 0,1 - endpoints 0x81,0x82,0x03 CLASS_TYPE_CDC_ACM, // CDC1 - interfaces 2,3 - endpoints 0x84,0x85,0x06 }; Result: Device enumerates as 0483:5710, two /dev/ttyACM ports appear, communication works. --- Failing Configuration (Dual CDC + VIDEO) uint8_t UserClassInstance[USBD_MAX_CLASS_INTERFACES] = { CLASS_TYPE_CDC_ACM, // CDC0 - interfaces 0,1 CLASS_TYPE_CDC_ACM, // CDC1 - interfaces 2,3 CLASS_TYP
Hello,I was trying to run AC1 and ADC2 in Dual mode and ADC3 configured as independent one.Using HAL_ADC_Start for ADC3 doesn’t start the converter as it checks multi-mode in common ADC_CCR register wrongly not allowing to use ADC3 for ADC_DUALMODE_REGSIMULT (value 6). I prepared a patch for stm32f4xx_hal_adc.c, but not for injected channels from stm32f4xx_hal_adc_ex.c file as they have a similar issue.Could it be checked by library owner or someone responsible for the code? Firmware Package Name and Version : STM32Cube FW_F4 V1.28.3STM32CubeMX 6.14.0MCU STM32F446ZEJx Best RegardsJarosław Hill
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
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.