Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello everyone,I'm working on a project using a NUCLEO-H7S3L8 board, and I have run into a very persistent and unusual problem involving FreeRTOS and a HAL function that I hope the community can provide some insight into.My aim is to build an event-driven data acquisition system. The application uses multiple peripherals (ADC, SPI, UART, I2C, and TIM3 for PWM Input Capture) running in DMA mode. A central FreeRTOS task (StartOSScheduler) waits on an event group for any peripheral DMA to complete. When an event occurs, it collects data from all sources, aggregates it, and sends it as a UDP packet using LwIP.Hardware and Software SetupBoard: NUCLEO-H7S3L8MCU: STM32H7S3L8HxToolchain: STM32CubeIDEFirmware: STM32Cube FW_H7RS V1.2.0Middleware: FreeRTOS (CMSIS-V2 Interface) and LwIPThe Problem: A Halt Inside a FreeRTOS TaskMy application halts without any fault or error when calling HAL_TIM_IC_Start_DMA() inside my main scheduler task (StartOSScheduler).The Critical Clue: The Most Important Pi
Split from https://community.st.com/t5/stm32-mcus-boards-and-hardware/nucleo-h563zi-as-usb-host/td-p/646056 Hi, I am New here.I was trying to connect the USB Barcode scanner to this Nucleo Board. Did you guys find any solution to make the board act as a USB Host.
Hey everyone, I'm working on a project where I'm implementing an algorithm on an STM32H7. As part of the algorithm, I need to compute the square root of a matrix using Cholesky decomposition. I noticed that the CMSIS-DSP library includes a function called arm_mat_cholesky_f32. However, after including CMSIS-DSP through the ioc (X-ALGO middleware), I can't seem to find this function in my project. Am I missing something here?
Hi, i have been developing custom bootloader with start address at 0x08000000 and a main application at address 0x08003800 were i planned 14KB for bootloader and next 40kb for main app.i can see the bootloader works fine, but bootloader doesnt triggers the main app properly.were this is how i am pointing to the main apptypedef void (*pFunction)(void);pFunction Jump_To_Application;uint32_t JumpAddress;on this __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);were #define APPLICATION_ADDRESS ((uint32_t)0x08003800)could anyone help me to solve the isue?
Hello ST Community,I’m currently developing on the STM32H743 using STM32CubeIDE, with the following configuration:FreeRTOS v1 (CMSIS v1 style tasks)LWIP stack configured in RAW API mode (not using netconn or socket layers)Network communication is up and running, and TCP/IP works as expected.Requirement:I want to monitor or intercept the raw LWIP buffers, especially:RX and TX pbuf contentsPacket payloadsPCB-level metadata...but I want to achieve this without using:lwip_recv(), lwip_send()lwip_select() or POSIX socket APIsGoal:Build a diagnostic/logging mechanism to observe incoming/outgoing TCP/UDP packetsPossibly build a lightweight mirror/sniffer on the MCU itselfDebug real-time network traffic without affecting application-level task logicKey Questions:Can we hook into pbuf_alloc(), pbuf_free(), or similar functions to mirror buffer contents?Is there a safe and clean way to tap into the LWIP receive/transmit paths at the core level?Can tcp_input() or eth_input() be instrumented for m
Hi, my name is Zaeem Ahmed.I'm currently digging into the STM32F1 HAL and trying to understand it at a deeper level. I'm intentionally not using STM32CubeMX — not because I have anything against it (it’s a great tool) — but because I want to read the HAL documentation and implement configurations manually to better understand what’s really happening under the hood.What I'm looking for:I would really appreciate any good resources, expert tips, or learning strategies that help connect:HAL APIs ↔ Hardware-level understanding from the reference manualThe challenge I'm facing:Often, when reading HAL documentation, I encounter vague or overly simplified explanations. For example:HAL_TIM_Base_Init vs. HAL_TIM_Base_MspInit — the documentation just says one initializes the timer and the other the MSP, which is obvious from the names but not why they're separated or how they work together under the hood.Another example:When initializing timers, there are different functions for different modes (
Hi everyone,I'm working on an STM32H7RS project (NUCLEO-H7S3L8) with the following setup:Bootloader in internal flash (0x08000000)Application in external OSPI flash (XIP) at 0x70000000Using FreeRTOSUsing TIM6 as the HAL time base (not SysTick)Configured using latest STM32CubeMX and STM32CubeIDE (v1.18.1)My current issue is that while HAL_Delay and TIM6 is working, SysTick seems not to work inside of the RTOS as soon as the scheduler starts.I noticed that because ther CPU got caught inside osDelay without throwing an error. I also already checked the NVIC, but it seems pretty fine to me. Did i otherwise miss something what i configured wrong inside my IOC file?
Hello , I am working with the STM32H755ZI-Q board and configuring it as a USB Host. I’ve successfully tested the USB Host functionality using standard USB devices such as a keyboard and a mouse, both of which are recognized correctly by the host. However, when I connect a USB-to-TTL adapter to the host, it fails to detect or enumerate the device. There is no response or indication that a USB device has been connected. I would appreciate any guidance or suggestions on the following: Are USB-to-TTL adapters supported in USB Host mode by default? Is there any specific configuration or class driver (e.g., CDC class) that I need to enable for this to work? Has anyone successfully interfaced a USB-to-TTL device with STM32 USB Host? This is the output I see on Tera Term after enabling the user log : USBH Event TriggeredEvent : StartPID: 7523h VID: 1a86h Address (#1) assigned. Manufacturer : N/A Product : USB Serial Enumeration done. This device has only 1 configuration. Default configuration
I am trying to perform USB enumeration on an STM32H503. I am using HAL_PCD_SetupStageCallback inside of the USB interrupt, which is working perfectly: when I plug in the USB cable to the Nucleo board, the interrupt triggers and I can see that the callback is executing. One thing that doesn't make sense is that the wLength field is always 0x8408 = 33800. One would expect the field to be 0x12 = 18 for a GET_DESCRIPTOR command, but it's always 33800. I don't think the host is the problem - it's a typical Ubuntu PC that has worked with plenty of other USB devices in the past - but I'm having a hard time seeing where there might be a problem in the code. (The cast from hpcd->Setup to USB_SetupTypeDef isn't the problem, in the debugger window I can see that all fields except wLength are exactly as expected, and that 0x8408 is in the hpcd->Setup array as well.)void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd) { USB_SetupTypeDef *setup = (USB_SetupTy
Hello,I'm working on a project which includes: W25Q32 (NOR Flash), File system and USB MSC + CDC on STM32U0 series MCU - STM32U073RCT6.Till now, I've implemented these:- SPI setup and communication with the NOR Flash (W25Q32)- For the file-system part, I tried to do it using the FileX but couldn't find relevant resources for "FileX + NOR Flash + SPI + STM32U0 series MCU". So, I found this https://github.com/maxiufeng258/SPI_Flash_Uart_Led_Polling_V1.0 (FatFS + W25Qxx) and implemented the same for my MCU as well. And able to create and mount the file system, create folder, text file and able to scan the disk.- Next for the USB part, I've seen some articles and videos, implemented CDC-ACM using USBX and my laptop (USB host) is able to load the appropriate driver for my MCU (USB device) and able to perform CDC-ACM i.e tested by sending some random text from MCU to laptop.- Now, I want to implement the MSC part as well. But the thing is, I think it'll become difficult to integrat
Hi all,I have a strange issue that I can't wrap my head around.I have an eMMC chip connected to a STM32U5G9The .IOC file is all standard: with the clock config as follows: However, when I start a debugging session I get stuck in the init function like so:It looks almost like the sysTick is not being updated at this point so the whole init just stalls.If I comment-out the MX_SDMMC1_MMC_Init() the whole system runs as intended (having a touchGFX application that boots right after the inits)I am running FreeRTOS right now where I think the whole thing should move to ThreadX but the init function should still function as intended, right? For now I am fine with just verifying if the eMMC can initialize. This is my first time setting up an eMMC so I might have overlooked something basic. Anyone out there with some good insights on this?
Hi all,I'm working on an STM32-based system using FreeRTOS, LWIP (static IP), and the Eclipse Paho MQTTClient C library.Problem Summary:MQTT connection is successfully established (MQTTConnect() OK).All SUBSCRIBE operations return SUBACK, everything looks fine.MQTTYield() initially runs correctly but after a while:Messages stop arriving or arrive with a delay.Sometimes multiple messages are batched and received at once.Inside MQTTYield(), the deliverMessage() call fails with error code 3 (FAILURE).In net_read(), the recv() function either returns nothing or behaves like a timeout.MQTT_LWIP_SOCKET is enabled.recv() is non-blocking.SO_RCVTIMEO is disabled, but issue persists.cycle() is tested both once and inside a while loop – the same issue occurs.It seems deliverMessage() is not properly triggered after readPacket().This problem does not occur consistently in local/home network with Mosquitto. But in corporate/complex networks, messages stop being delivered.MQTT CONNECT sent...CONNACK
Hello,I have been playing about with the LTDC_Paint example and have managed to produce screens using my own images.I would now like to start my own project using the STMH750B-DK incorporating the elements of the LTDC_Paint example.I am struggling to work out which files and how is best to copy them into my project.i just need to be able to draw BMPs and text on the screen, i do not need the touch screen funtionality or the save to USB function.Has anyone succesfully incorporated elements of the example into their own project and be able to share an example project of point me in the right direction?? Many thanks, Iain
How to create a soft start in the initial operation when generating a PWM signal with STM32
hi, am using stm32u585iot dev board i need all power code stop and shutdown and standby code for that board?
Hello everyone, I've designed a custom board with STM32H723ZG, previously based on STM32F767ZG. When I connect board with ST Link V2 prog through SWDIO, SWDCLK and GND, I get response that no target has been detected. I'm currently using ST-Link Utility software. If I desolder H723ZG and replace it with F767ZG, board works completely fine, without any issues. What could possibly be issue, should I order ST-Link V3 prog for the H723 MCU?Please check attached schematic of the board, MCU related stuff is on second page.Thanks everyone in advance! :)
I'm programming a STM32H503CBUx Timer3. NVIC settings are such that the count down event is trapped in void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef* htim)This is a global interrupt routine that takes care for other timer interrupts as well and on has to decide from the handle that is being passed, which interrupt has to be served.My requirement is that this interrupt has high priority and is handled as fast as possible.Timer CLK is 250MHz. The timer counts down with pre divider 1 and count down of around 15,000.In the ISR the counter htim3.Init.Period =14999 is being set to 1000 and should generate the next interrupt. Then follows another chain of such countdowns from 1000. The interval between the two subsequent interrupts is 4 µs. Can an ISR be served with such time constraints?How many instructions can be handled by the MCU at 250MHz clock? Alone the handle testing costs me valuable instruction time. Could I use a timer that has a uniquely asserted ISR?
I am using the USB CDC driver code provided by ST in stm32cubeide, and am trying to figure out a proper minimum heap size. I have found various slightly conflicting answers, but the consensus seems to be that 512 bytes is not enough.In the same application, I also use FATFS, but I'm not 100% sure if that is supposed to use the heap.Now I wanted to test just how much of the heap is in fact overwritten. To do this, I brutally stored the byte sequence AA BB CC DD over and over in the first 1 KB of the heap. I did that with this piece of code inserted in main.c, immediately after the entry point:uint32_t *heapPtr; uint32_t *heapOrigin; (...) /** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ uint16_t i; heapOrigin = malloc(4); free(heapOrigin); heapPtr = heapOrigin; slDebug6 = (uint32_t)heapOrigin; for (i = 0; i < (1024 / sizeof(*heapOrigin)); i++) { *heapPtr = 0xDDCCBBAA; heapPtr++; } /* USER CODE END 1 */The malloc(4
Hi, I am running firmware for USBX MSC device. The example project "Ux_Device_MSC" on demo board STM32U575I-EV. MSC device is enumerated on computer and FATS file system is used. It can transfer file from computer to storage on STM32U575I-EV. I am trying to figure out the following parameters. 1. how many times the following function in source file "ux_device_msc.c" is called when transfer a large file UINT USBD_STORAGE_Write(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_Write */ UX_PARAMETER_NOT_USED(storage_instance); UX_PARAMETER_NOT_USED(lun); UX_PARAMETER_NOT_USED(media_status); ULONG WriteFlags = 0U; /* Check if the SD card is present */ if (HAL_GPIO_ReadPin(GPIOI, GPIO_PIN_0) == GPIO_PIN_SET) { /* Check id SD card is ready */ if(check_sd_status() != HAL_OK) { Error_Handler(); } /* Start the Dma write */ status = HAL_SD_WriteB
Greetings, I am trying to do a POC of LVGL migration to the STM32N6DK, https://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/STM32N6570-DK/Examples/BSP For the POC i tried porting the LVGL into FSBL example above, but I ran into memory overflow issues. So for the next step, I cloned and tried to port the drivers and dependent files into this repo's application project: https://github.com/stm32-hotspot/STM32N6_FSBL_Modes/tree/main In this I was able to display just the initial screen util clear screen function and then it crashes in the dma2d buffer transfer section, most likely the DMA2D CE bits were not being set and the timeout is not triggered because the hal tick fails and it is stuck in the while loop. Either way, I am unsure of the best approach, my goal is simple, to get a barebones LCD and touch working in the application region and link it with LVGL library to do the UI for my POC. Could anyone please guide me to get the fastest approach to getting th
Hello,I'm currently preparing the firmware for a USB NFC reader (CCID). I'm working with the STM32F103 MCU and the ST25R3916 NFC reader.The STM32F103 MCU is programmed on a CCID USB device using the CCID USBD driver provided by STM32. The MCU acts as the mediator between the computer and the ST25R3916 NFC reader. It takes the APDU command sent by the computer and transfers it to the NFC reader, and takes the NFC reader's response and transfers it to the computer using the SC_Itf_XferBlock() function.The STM32F103 MCU supports usb full-speed, this means that the maximum amount of data to be transferred to the computer is 64 bytes. If you want to transfer data larger than 64 bytes, you transfer it using chunk-by-chunk methods.To transfer 253-byte data, the splitting is as follows:5 chunks: chunk 1 (54 bytes of data with 10 bytes of header), chunk 2 (64 bytes of data), chunk 3 (64 bytes of data), chunk 4 (64 bytes of data), and chunk 5 (7 bytes).The issue is that when I try to transfer 25
Hi,I am using STM32Cube_FW_H5_V1.5.0. I initialize a MPU region with the following code, using only LL-calls:LL_MPU_ConfigRegion(LL_MPU_REGION_NUMBER6, LL_MPU_REGION_PRIV_RW|LL_MPU_INSTRUCTION_ACCESS_DISABLE|LL_MPU_ACCESS_NOT_SHAREABLE, LL_MPU_ATTRIBUTES_NUMBER2, 0x90000000U, 0x9FFFFFFFU);The corresponding MPU register MPU_RLAR_Ax gets set to 0x9FFFFFE3, wich is obviously wrong because I wanted to select attribute#2 and instead the attribute field gets set to 0x1.For verification I did the same initialization using HAL-calls:MPU_Region_InitTypeDef region; region.Enable = MPU_REGION_ENABLE; region.Number = MPU_REGION_NUMBER6; region.AttributesIndex = MPU_ATTRIBUTES_NUMBER2; region.BaseAddress = 0x90000000U; region.LimitAddress = 0x9FFFFFFFU; region.AccessPermission = MPU_REGION_PRIV_RW; region.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE; region.IsShareable = MPU_ACCESS_NOT_SHAREABLE; HAL_MPU_ConfigRegion(&region);Now the MPU register MPU_RLAR_Ax gets set to the correct va
I'm working with an STM32G431KBUx and trying to output a waveform via DAC1 using DMA and TIM6 as trigger (TRGO). I’ve successfully configured the DAC and DMA using STM32CubeMX. However, the DMA callbacks HAL_DAC_ConvCpltCallbackCh1 and HAL_DAC_ConvHalfCpltCallbackCh1 never get called. Here’s what I’ve checked so far: DMA handle is linked manually:hdac1.DMA_Handle1 = &hdma_dac1_ch1; Trigger is set to Timer 6 Trigger Out event. DMA is configured in Circular Mode. I'm calling HAL_DAC_Start_DMA(...) with a buffer of 2 * 64 samples (12-bit aligned). Callback functions are correctly named and defined in main.c: void HAL_DAC_ConvHalfCpltCallbackCh1(DAC_HandleTypeDef *hdac1) {// Never called}void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef *hdac1) {// Never called} /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ***************************************
I am currently using the STM32N657 to drive an 800x480 pixel display with 24-bit color. The problem that I am running into is the buffer that I need uses 1.1MB (800*480*3 = 1.152MB). Using just FSBL, I am limited to 511KB of SRAM. I know that this chip has 4.2MB of SRAM on it, so how do I access that SRAM for my buffer?
We have a STM32070CBT6 with minimal connections (schematic below) and it appears to be unresponsive to USB enumeration, although it does pull DP low to trigger it. This occurs when hotplugging it or holding reset low for a few seconds. I've checked the input on PF0 and it is getting a clean 16 MHz.
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.