Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello ST Community,I'm working with the STM32N6570-DK board and using the ST-provided UVC video streaming example.https://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/STM32N6570-DK/Applications/USBX/Ux_Device_Video By default, the example uses MJPEG format, but I modified the UVC descriptors to stream in UNCOMPRESSED format (YUY2).Where as i am sending static image data-->> When using a lower resolution configuration 320*236 and HS_MPS is 512 , Then the static image displays correctly on Windows Camera, and Wireshark shows proper isochronous packets. However, when I change the configuration to a higher resolution like 800×480 and increase HS_MPS:#define USBD_VIDEO_EPIN_HS_MPS 1024 // Also tried 2044, 3036, 3072#define UVC_FRAME_WIDTH 800U#define UVC_FRAME_HEIGHT
Hello,I'm hunting a bug probably caused by a race condition running multiple tasks and IRQ handlers under FreeRTOS on a STM32H75x MCU.My code shall run a task after (DMA-) IRQ has fired using the Deferred Interrupt Handling method shown in this example using the CMSIS2 RTOS API. In rare situations, it seems that the task is started delayed, maybe blocked by another task of same priority.All (DMA-/UART-/TIMER) IRQs have prio 5, all tasks have FreeRTOS prio "REALTIME".The FreeRTOS example (comments removed) goes like this:void vANInterruptHandler( void ) { BaseType_t xHigherPriorityTaskWoken; prvClearInterruptSource(); xHigherPriorityTaskWoken = pdFALSE; vTaskNotifyGiveFromISR( xHandlingTask, &xHigherPriorityTaskWoken ); portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); }I wonder how this can be implemented using the CMSIS RTOS API2.My code, according to this example here, goes quite as follows:void IrqHandler(void) { osEventFlagsSet(evt_id, 0
Hello! I'm coding board based on STM32 C031C6T6. Everything works fine except EXTI interrupts - it doesn't fire. I use PB5, PB6 and PB7 for buttons. I checked signals on hardware - it's ok, I can register falling edge. I use external pull-up. I use CudeIDE 1.19.0. main.c 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 ------------------------------------------------------------------*
So I am new to STM32 , what I want to implement is to receive large data(preferably over 1MB) which is greater than the size of receive buffer of UART so how should I proceed with it. Since the data I am receiving is in the form of hex, I also have to program the flash using the same data.
HiI notice STM32CubeExpansion_Audio_V1.1.1\Middlewares\ST\STM32_Audio\Addons has many dsp libs without source code . And it hasn't been upgraded since 2018.Can St provide source code of these libs for reference?
I've got a Nucleo STM32L476 board and noticed in the STMCubeF4 Repo the demonstration for the Adafruit TFT 1.8'' with Joystick and SD Card reader.I've found this quite interesting and ordered the Adafruit shield. Unfortunately I've got the Adafruit shield v2 that is using the so called Seesaw chip as and interface for the shield.The demo example from the repo doesn't work with this v2 shield and it's hard to find any example that could be used to modify the demo to get the v2 shield running.Did anybody has the same experience and could help here? Will ST work on a new version of the demo to support v2 as well? ThanksBernhard
I am trying to compile in stm32h753xx.h into a project. It has a number of lines like this:#define SPI3 ((SPI_TypeDef *) SPI3_BASE)I am getting this error on that line:In file included from ../src/libraries/CMSIS/Device/ST/STM32H7xx/Include/stm32h7xx.h:124, from ../src/rt-arm/STM32F4/i2cComm.hh:17, from ../src/rt-arm/busses/i2c.cc:12: ../src/libraries/CMSIS/Device/ST/STM32H7xx/Include/stm32h753xx.h:2510:30: error: 'reinterpret_cast<SPI_TypeDef*>(1073757184)' is not a constant expression 2510 | #define SPI3 ((SPI_TypeDef *) SPI3_BASE) | ~^~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/rt-arm/STM32F4/dma.hh:178:64: note: in expansion of macro 'SPI3' 178 | plate<> struct dma_perph<1,0,0> { enum {addr = (uint64_t)(&SPI3->RXDR)}; }; //"SPI3_Rx" | ^~~~Other lines like that one also get a similar error. What I don't understand is that the SPI3_BASE is a constant and therefore I would think everything in ((SPI_TypeDef *) SPI3_BASE) would be considered a constant.&n
Hello all, MCU: STM32H733ZG I am facing issue as i am trying to jump from bootloader to the Application code which is located in the SDRAM. In the bootloader stage when the MCU receives the binary from OTA it is stored inside the External Flash. After receiving the binary image and storing it inside the External Flash, the image is copied from External Flash inside the SDRAM and then jumps to the application code. When it jumps to the application code, i open disassembly view and it starts running instructions stored inside the SDRAM until it reaches a specific address `0xC000150E` which is inside the `SystemInit` function. After calling the instruction at this address the disassembly closes up and a text of can not read register at `0xDEADBEE` appears. When checking the line located at this address and commenting that line which is this the problem persists at the same address of `0xC000150E` even though the previous line was commented out. It always crashes at this
Hello all -I am attempting to upgrade an old design from an STM32f4 device to an STM32h753 device. The old design used the STM32_USB_OTG_Driver. It seems to appear that the OTG driver no longer exists for the STM32h753. Any ideas about how to upgrade the code to use the new processor with this driver issue in mind?Thanks,John
Hello, I am working with the FDCAN peripheral on the STM32N6 Nucleo Board. While logging all received and transmitted messages, I noticed that some messages are received twice. Is there a specific reason for this behavior? Should I introduce a delay before reading the RxFIFO again? Thank you in advance for your support. Best regards,Guillermina
Hello, meanwhile i tried for ethernet udp several examples. But either these could not be importedin STMCubeIDE 1.19.0 or were based on RTOS. Did any know or have an example for it? Thank you! Best regards, HiST
Dear ST,I'm trying to get USB CDC device working on custom STM32H7R3L8HxH based board. Host (Windows) detects it but unfortunately the USB device fails to enumerate with error:Windows has stopped this device because it has reported problems. (Code 43)A request for the USB device descriptor failed.USB FS based Boot ROM works in DFU mode so I know hardware should be okay.I found a bug in CubeMX code generator. USBPHY clock source is configured to be HSE (which is 24 MHz):However code generator creates usbd_conf.c function HAL_PCD_MspInit with these lines: /** Initializes the peripherals clock */ PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USBOTGFS; PeriphClkInit.UsbOtgFsClockSelection = RCC_USBOTGFSCLKSOURCE_PLL3Q; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { Error_Handler(); } I confirmed with debugger in SFR view that indeed OTGFSSEL bits in RCC_CCIPR1 are set to PLL3/Q.STM32CubeIDE version is 1.19.0 and MxCube version
Hi, I have the following code inside a function that writes data into flash memory. I noticed that on the first iteration of the for loop, when HAL_FLASH_Program is called, it fails to write at the flash starting address 0x0801F080. However, from the second iteration onward, it successfully writes data into flash. Because of this, the initial data is missing. While debugging, I found that the failure occurs due to this line: error = (FLASH->SR & FLASH_FLAG_SR_ERROR); The error value I get is 128 (decimal). is there anything I am doing wrong? 1.JYI, I have erased the memory before write to confirm this I am observing FF bytes 2.To confirm again I have changed the address from 0x0801F080 to 0x0801F088 still same scenario occours bool write_function(void) { HAL_StatusTypeDef status. uint64_t temp; uint32_t i, j. HAL_FLASH_Unlock(); __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_SIZERR | FLASH_FLAG_OPERR | FLASH_F
I'm looking for an example to use as the starting point for a sensor data collector. In particular, an STM32F401 ADC_MultichannelSingleConversion with DMA and software start. I found an example for the F11 that is based on the LL SDK. I then created an F401 project using ADC with DMA and set the code generator to utilize the LL SDK for those components. I then compared the 'stm32f4xx_it' source and header files and found them substantially different. So much so, in fact, that I'm unsure how to proceed. The F11 example does not have an IOC file, so I cannot view its configuration settings. The code generated from my IOC file features very nice blocks that delineate where user code should be placed, and I want to utilize this feature to avoid conflicts with the code generator as I add other system components.The same applies to the 'main' source and header files. If there's a better example to use as a starting point, or some guidance for merging the example code into a STM32Cube p
Hello,I am working with the STM32N6570-DK and following the steps described in the following article to write the FSBL and application to flash and verify their operation:https://community.st.com/t5/stm32-mcus/how-to-create-an-stm32n6-fsbl-load-and-run/ta-p/768206Specifically, I am referring to section 2.2: "Second demo with FSBL and application".However, I was unable to observe the LED blinking as expected.While investigating the issue, I came across the following discussion:https://community.st.com/t5/stm32-mcus-boards-and-hardware/nucleo-n657x0-q-failed-to-start-gdb-server/td-p/756404/highlight/true/page/2After reviewing this and checking the OTP values, I noticed that the values for OTP11 and OTP124 were identical.When I switched the BOOT mode to DEV and executed the FSBL from SRAM, the application written to flash started successfully and the LED began blinking.Based on this behavior, I suspect that the FSBL is not being properly loaded into SRAM by the internal boot ROM.Could you
Hi everyone,I'm trying to interface an SD card over SPI with an STM32F411. However, I cannot even initialize it. My current sequence is:Wait 20 ms after power-on.Send 10 clock cycles with CS high.Pull CS low and send CMD0 and wait for a reponse.Instead, I only ever receive 0xFF instead of 0x01.My SPI configuration looks like this:Here is the relevant code: MY_DEBUG_PRINTLN("Hello World"); uint8_t txBuf[6]; uint8_t resp = 0x00; uint8_t dummy = 0xFF; HAL_Delay(20); MY_DEBUG_PRINT("Raw SD SPI test:\n"); // send 80 clocks with CS high HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_SET); for (int i = 0; i < 10; i++) { HAL_SPI_Transmit(&hspi2, &dummy, 1, HAL_MAX_DELAY); } HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_RESET); // CMD0 frame txBuf[0] = 0x40; txBuf[1] = 0x00; txBuf[2] = 0x00; txBuf[3] = 0x00; txBuf[4] = 0x00; txBuf[5] = 0x95; // send command HAL_SPI_Transmit(&hspi2, txBuf, 6, HAL_MAX_DELAY); // wait for response for (int i = 0; i < 3
im looking in the main.h file for this example and wondering where __BUFFER__ is defined thats used in this line #define COUNTOF(__BUFFER__) (sizeof(__BUFFER__) / sizeof(*(__BUFFER__))) thanks for the help
TL;DR - adding USBX and the USB CDC device class to my STM32U5 TouchGFX project causes it to fail during initialization, because the default memory settings are woefully inadequate.I have a TouchGFX project running on an STM32U5G9J-DK2 using ThreadX. The TouchGFX component tosses up a splashscreen, and I have other tasks running, including a debug task putting out UART data. So that all works fine.What doesn't work is when I add USBX and a simple USB CDC device class to the project. I can add it using CubeMX, but when I build and run it, it dies during initialization because of memory allocation issues. I would at least expect it to run out-of-the-box when adding it to a new or existing project.Here are my steps to reproduce the failure:Make a workspace directory (I called mine C:\ST\workspace\touchgfx_usb_issue).Open TouchGFX, create a new project, select STM32U5G9J Discovery Kit 2 running ThreadX, select the workspace directory as the "Application Directo
Hi all,I'm currently working on a project using a STM32H753 in combination with the Azure RTOS UsbX to create a composite class USB device (CDC ACM + MSC). As a starting point for the MSC support, I'm using this STM github example:https://github.com/STMicroelectronics/x-cube-azrtos-h7/tree/main/Projects/STM32H735G-DK/Applications/USBX/Ux_Device_MSC Unfortunately, my board only supports a 1-bit SD bus which is running at 48MHz. The composite class is working along I'm using the HAL_SD_WriteBlocks_IT / HAL_SD_ReadBlocks_IT functions. By using the IT driven approach, Windows is able to mount the SD card and I can create, edit or delete files as expected.Changing to the DMA driven functions, then the mount seems to fail, has corrupt disk naming or asks to insert a disk. I'm aware of cache coherency issues in the H7 and I setup the linker file and MPU accordingly (creating an 32kB area for the UsbX memory pool in the AXI SRAM): Linker file:/* Specify the memory
Hi,I am not able to output per I2S properly.1. I changed from a properly working driver for STM32F407 to this STM32H7A3VGTI had to learn, that the master clock is different as for the 407; here is always running (?) and the DMA did not work properly anymore.2. I made a testsetup with CubeMX (6.14.1):- I2S Philips- 48 kS- 16 bit- I2S clock = 49,152MHz- no MasterclockI simply use HAL_I2S_Transmit() for a 4 word buffer to send. The buffer is 32bit aligned and is in "normal" ram since DTCMRAM does not work for the DMA (lateron).The function generates proper output for BCK, Data and LRCK, but it never stops. It sends the last word from buffer over and over again. I can switch of i2s, than it stopps. Is this to be expected (?)3. Next approach:- Same configuration as (2), but using DMA, Half-Word(16bit) for per and mem, no fifo- The callback HAL_I2S_TxCpltCallback() is called with the right SPI-> inside I call HAL_I2S_DMAStop() to stop the DMAResult: No output at all4. Next approach:-
I'm a USB newbie and am trying to use the STM32F411CEU6 as a USB mic. I'm currently using FreeRTOS (cmsisV1) and the Cubemax USB library. My device currently enumerates normally, but when the host sends a URB_ISOCHRONOUS_IN request, my MCU won't handle it properly (according to SWD and serial port debugging, I found that the MCU won't even enter the OTG_FS_IRQHandler interrupt when the host sends this request). This has been bothering me for a long time. Here are my descriptors and some configuration code:__ALIGN_BEGIN static uint8_t USBD_AUDIO_CfgDesc[] __ALIGN_END = { /* Configuration Descriptor Head */ 0x09, // bLength 0x02, // bDescriptorType = CONFIGURATION 0x6D, 0x00, // wTotalLength = 109 bytes 0x02, // bNumInterfaces = 2 (Audio Control + Audio Streaming) 0x01, // bConfigurationValue 0x00, // iConfiguration 0x80, // bmAttributes: Bus powered 0x32, // bMaxPower: 100mA /* -------- Audio Control Interface (Interface 0) -------- */ 0x09, // bLength 0x04, // bDescriptorT
I’m encountering an issue with XSPI1 in my application. I boot the application via XSPI2 in an LRUN configuration, and this part works perfectly. However, within the application, I need to use XSPI1 to write data to a different flash.During MX_XSPI1_Init(), the code crashes at this line:if (HAL_XSPIM_Config(&hxspi1, &sXspiManagerCfg, HAL_XSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK){Error_Handler();}I traced the crash to the exact line:IOM_cfg[0].IOPort = pCfg->IOPort;The initialization code for XSPI1 was generated using CubeMX. Interestingly, if I initialize XSPI1 in the boot project, everything works fine.I’ve already spent a week trying to solve this issue, but so far nothing has worked.I would really appreciate suggestions to help solve my problem.
Hello,I am trying to set up a UPD communication with a nucleo-H755ZI-Q board.Now I have the effect, that the lwip stack sends out an arp request for its own IP address.I double-checked the IP address and destination address to make sure they were correct. Does anyone have any idea, what could be causing this?Thank you.HiSt
Dear STMicroelectronics Support Team,I previously submitted a request on [ Auguest 26, 2025] (case #[00242096]) and have not received a reply.I am evaluating STM32 MCUs for an LwM2M client implementation and need clarification on ST’s official support.Questions:Does ST offer any MCU models with an official LwM2M stack or pre-integrated middleware?Please provide package names, download links, and any long-term support information.Please update the status of my open case and provide the requested technical references.Best regards,Name : Wilfred.kim (JongSeong.Kim)Company : TeladinEmail/Phone : wilfred@teladin.com/+821054147096
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
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.