Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi experts:I'm working on STM32U575 evk, using ADC1 including two channels enabe interrupt, attached file is my test project, only one interrupt in the callback function, I don't know why, if I changed the end of conversion selection to end of sequence of conversion, no interrupt triggered, please help to check if anything missing in my project, thanks.Bill
Hi there!I start to work with this sensor and i want use this functionHAL_I2C_Mem_Write_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress,uint16_t MemAddSize, uint8_t *pData, uint16_t Size)so the pointer address register of the sensor is 8 bit but the data are 16bit is correct if i do that example: data[0] = MSB; data[1]=LSB; HAL_I2C_Mem_Write_IT(&hi2c1, INA226_Addr , 0x00, I2C_MEMADD_SIZE_8BIT, data, 2); and i do the same when i want read data from register.Sorry if i ask a silly question thank you Sergio
Hi there!i start one of my new project with STM32cubeide 2.0. First i start with configure mu MCU in STM32CUBEMX in this casa STM32G031K8T6 afther i configurate all pin i create a poject . So afther i import my project in STM32CubeIde 2.0 and i build gave me this error:Core\inc\main.h: fatal error: stm32g0xx_hal.h: No such file or directory #include "stm32g0xx_hal.h" but i check with F3 and this file exist , so please someone can help me ? Thank youSergio
Posted on July 25, 2013 at 11:26 Hi ! When running the VCP USB Stack (STM32_USB-Host-Device_Lib_V2.1.0) on my STM32F4 i got an error code on my Win7 x64 sytem. ''This device cannot start(code 10)'' I'm using the USB HS Port on PORTB in FS mode. Finally i found a solution for it. The source code of the file usbd_conf.h must be changed in the following way: Old: /* CDC Endpoints parameters: you can fine tune these values depending on the needed baudrates and performance. */ #ifdef USE_USB_OTG_HS #define CDC_DATA_MAX_PACKET_SIZE 512 /* Endpoint IN & OUT Packet size */ #define CDC_CMD_PACKET_SZE 8 /* Control Endpoint Packet size */ New /* CDC Endpoints parameters: you can fine tune these values depending on the needed baudrates and performance. */ #ifdef USE_USB_OTG_HS #define CDC_DATA_MAX_PACKET_SIZE 64 /* Endpoint IN & OUT Packet size */ #define CDC_CMD_PACKET_SZE 8 /* Control Endpoint Packet size */ This change is only necessary when using t
I've had problems with sd_diskio.c used for SD card I/O with FatFs.CubeMX version is 6.16.0.I'm using SDMMC with DMA, so consideration needs to be given to cache coherency and alignment.I have both these set:#define ENABLE_SD_DMA_CACHE_MAINTENANCE 1#define ENABLE_SCRATCH_BUFFERHowever, I've found some bugs in the code:In SD_read, the alignment check:#if defined(ENABLE_SCRATCH_BUFFER)if (!((uint32_t)buff & 0x3)){#endifshould have the 0x3 changed to 0x1f, as cache alignment requires 32-byte alignment, not 4-byte.There's another case of this in SD_write.Furthermore, there's a bracketing problem in SD_write with the code under ENABLE_SCRATCH_BUFFER conditional compilation, which is supposed to be invoked when the buffer is misaligned as an else condition for if (!((uint32_t)buff & 0x1f), but is instead an else condition for a DMA success check. This means that the scratch buffer code does not run at all when a buffer misalignment is detected.To fix it, I added a closing brace
Hello,I am trying to get Ethernet-over-USB working on a STM32U585. I want to be able to use both RNDIS and CDC-ECM, but I decided to start with RNDIS first. After a lot of trial and error and research, I am running out of ideas as to why my PC does not show any devices in USB Viewer on the port where I connected the circuit board. I am developing on a B-U585I-IOT02A.I based my work on the following example: https://github.com/STMicroelectronics/stm32-usbx-examples/tree/main/Projects/STM32H735G-DK/Applications/USBX/Ux_Device_RNDISI provide my code here (if not mentioned it is generated by CubeMX). I did not touch files if code is not shown here:main.c: int main(void) { /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the System Power */ SystemPower_Config(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_ICACHE_Init(); // HINT: this function
我使用的芯片是G071RB,当我使用STM32UCPD发status,直接从FF01(PD协议的DP模式)变成0x00000,并且在抓包发现再发送的时候没有发VDO000000001,返回的数据中HPD为0,有没有大佬知道怎么解决 Translation: I'm using the STM32G071RB MCU. When I send a status update using STM32UCPD, it jumps directly from FF01 (DP mode of the PD protocol) to 0x00000. Packet capture shows that VDO000000001 is not sent during retransmission, and HPD is 0 in the returned data. Does anyone know how to solve this?
I have one question regarding the HAL_FLASH_Program function. I use the HAL_FLASH_Program many times during the runtime of the firmware. I use it to store log, warnings and errors in the several flash pages. When the page is full and I must write into it I erase the page, obviously. However, at the very begining I also want to store the "reset cause" (an entry in the flash pages) of the last power cycle (switch on off). Was it a BOR, WWDOG, IWOG, PINRST, etc, etc,..? Unfortunately, I am unable to successfully use HAL_FLASH_Program with a HAL_OK. It seems as if HAL_FLASH_Program does not work at the very beginning of the firmware application... does it sound crazy? Could it be that this function needs some time to work. /** * @brief The function's role is to save the log data into the log page/s. */ mid_error_t flash_program_loop_2(const uint8_t * data_in) { HAL_FLASH_Unlock(); /** * first we check if the next position to writ
下面是我的部分函数,普通串口按照这个配置,是可以正常进入回调函数,但是LPuart却不能进入回调函数,不知道问题出在哪里,使用stm32cubemx6.16.0,附件是ioc文件, Post Edited by ST moderator to apply source code formatting and translate from Chinese to English to comply with the community rule: Below are some of my functions. With this configuration, the standard serial port can enter the callback function normally, but LPuart cannot. I'm unsure where the issue lies. Using STM32CubeMX 6.16.0. The attached file is the I/O configuration file. void StartControlPowerTask(void const * argument) { /* USER CODE BEGIN StartControlPowerTask */ HAL_StatusTypeDef ret; __HAL_UART_ENABLE_IT(&hlpuart1, UART_IT_IDLE); __HAL_UART_CLEAR_IDLEFLAG(&hlpuart1); ret = HAL_UARTEx_ReceiveToIdle_DMA(&hlpuart1, rxl1_dma_buffer, RX_BUFFER_SIZE);//rs232 /* Infinite loop */ for(;;) { osDelay(1); } /* USER CODE END StartControlPowerTask */ } void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size) { if (huart->Instanc
When using a USB CDC device, especially at high data rates, there is a possibility for packet loss. This post illustrates the issue with what I consider convincing evidence. This isn't a STM32 bug, but it's something you may encounter when interfacing with an STM32 device so I felt it is relevant here. As a bonus, this also shows the achievable speeds with USB FS CDC to be ~9.2 Mbps under ideal circumstances (fast, good code on both sides of the connection). Here's the setup to illustrate the issue: On the STM32, I'm initializing a USB FS CDC device (sometimes also called a VCP) and sending out packets as fast as possible. The bus speed of USB FS is 12 MHz. Buffers of 16 kB are sent which contain increasing uint64_t values (e.g. 0x0000000000000000 0x0000000000000001, etc...) When one buffer finishes, the next one is sent out. (I used STM32CubeMX to do the initialization code and it worked perfectly.) On the PC side, I'm opening the serial port in Python and reading data
Good evening, now that I can ping my F767ZI board with my laptop, I'm trying to use some tutorials on the web to be able to send data (numbers or message strings) to a server (Hercules software set as a TCP server), but I'm having some difficulties (I don't know whether to use semaphores or timers as interrupts, and for semaphores, it's not entirely clear to me how to use them). I'm wondering if there's a short guide for my board that can give me a starting point. I'm using CUBE IDE V1.18.1. I tried starting from the project that allows me to ping my board, but as soon as I try to make some changes, the ping no longer works, and the timer set as an event interrupt doesn't work anymore, so I would need a tutorial as an example (the tutorial I followed successfully had a UDP library, but now I'll have to use the TCP libraries I already have, but I'm having some difficulties). Here below the code that I used for start point and that is give to me the way to ping my board succesflul
I have updated the STM32L4 HAL drivers to V1.13.6 / 14-November-2025 (1.18.2), which has broken my implementation of HAL_UARTEx_ReceiveToIdle_DMA.Is this a fault in the new HAL drivers or does user code need to be updated inside the HAL_UARTEx_RxEventCallback?
When I call function HAL_FLASH_Program twice with the same Flash address, the second call is ignored. See test code below.int8_t buffer1[16] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};int8_t buffer2[16] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};EraseIntFlash( 0x08200000, 0x08300000 );HAL_FLASH_Program(FLASH_TYPEPROGRAM_QUADWORD, 0X0820000, buffer1);HAL_FLASH_Program(FLASH_TYPEPROGRAM_QUADWORD, 0X0820000, buffer2); In Memory Browser, I expect:0x08200000 03020100 07060504 0B0A0908 0F0E0D0CBut I get:0x08200000 03020100 07060504 FFFFFFFF FFFFFFFFWhat is going on? I really need this to work. Can anyone provide insight or solution or workaround?Jim Eno
I am working with the NUCLEO-N657X0-Q and I am looking for a reference project or a pointer to an example that implements USB Host Mass Storage Class (MSC).My Goal: I need to mount a USB memory stick to read test vectors, process them using the Cortex-M55, and then write the output results back to the USB stick.Current Blockers:I have searched through the latest STM32CubeN6 Firmware Package, but I haven't found a ready-to-use USB Host MSC example specifically tailored for this Nucleo board.Given the new architecture of the STM32N6 (including the high-speed USB PHY and the NPU/M55 pipeline), I want to ensure I am using the correct driver implementation for the USB stack.Does anyone have a pointer to a compatible example or a known working configuration for USB Host on the N6 series? Specifically, I'm looking for guidance on integrating ThreadX/USBX (or the classic middleware) with FileX/FatFs for this board.Any help or GitHub links would be greatly appreciated!
Hello everyone,I’m working with an STM32F103RCT6 on a custom board, and I’m trying to use the built-in RTC using ST Low-Layer (LL) drivers.When I enter debug mode, the application gets stuck inside LL_RTC_Init(). It neither returns SUCCESS nor ERROR — it keeps looping internally, apparently waiting for a flag that never gets set.Here is the function from my application: void LL_RTC_Init_Custom() { // TODO: RTC clock needs to be set to LSE. On the dev kit, LSE isn't available LL_RTC_InitTypeDef rtcInit = { .AsynchPrescaler = RTC_CLK_PRESCALE, .OutPutSource = LL_RTC_CALIB_OUTPUT_NONE }; ErrorStatus status = LL_RTC_Init(RTC, &rtcInit); if (status != SUCCESS) Error_Handler(); } Inside this function, it stucks here, in this while loop below.ErrorStatus LL_RTC_ExitInitMode(RTC_TypeDef *RTCx) { __IO uint32_t timeout = RTC_INITMODE_TIMEOUT; ErrorStatus status = SUCCESS; uint32_t tmp = 0U; /* Check the parameter */ assert_param(IS_RTC_ALL_INSTANCE(RTCx)); /* Di
Hi,I want to design a voice announcement system using the STM32F103C8T6.My requirement is to Load WAV audio files from an SD card and play them using the STM32, without using any external DAC.I would like guidance on how to start the project using STM32CubeMX / STM32CubeIDE, including:Peripheral configuration in CubeMXAudio playback method without a DAC (for example, PWM-based audio)Basic coding structure to read WAV files from an SD card and play themAny help or reference projects would be greatly appreciated. I have design hardware also here attachment is there please go through it ...Thank you
Hello,I am using STM32U5 with an external Winbond W25Q128 (Quad SPI NOR via OctoSPI).Could you please clarify from where an external loader (.stldr) for STM32U5 OctoSPI NOR can be obtained, if available?I checked the following locations and did not find any loader for STM32U5:STM32Cube_FW_U5/UtilitiesSTM32Cube_FW_U5/ProjectsSTM32CubeProgrammer default ExternalLoader directoryIs there an official external loader provided by ST for STM32U5 + OctoSPI NOR, or is it currently not supported?Thank you for the clarification
OverviewI’m working on a custom PCB based on STM32H757BIT6, conceptually similar to the STM32H747I-EVAL board. The original EVAL board uses a Micron MT25TL01G (dual-die) QSPI flash on BK1_CS (PG6). On my board, the flash is replaced with MT25QL01G (single-die) and connected to BK2_NCS (PC11).I need to know what changes are required in the BSP and external loader (.stldr) to make them work with this new flash and cs pin changes.HardwareMCU: STM32H757BIT6QSPI Flash:Original: MT25TL01GHBB8ESF (dual-die)New: MT25QL01GBBB8ESF (single-die)New QSPI CS is connected at BK2_NCS (PC11); BK1_CS is tied to BK2_NCS.ToolsSTM32CubeIDE 1.18.xExternal loader build: IAR EWARMProgrammer: STM32CubeProgrammer v2.18.0ST-LINK FW: V2J46S7Differences vs EVALFlash changed to single-die MT25QLCS moved to BK2Hardware is fixed; BSP/loader adapted from EVALCurrent StatusApp firmware: QSPI init works after making few changes like FlashID = QSPI_FLASH_ID_1, DualFlash = DISABLE, memory-mapped mode initialization
I am working on STM32H753 (with eval board EVAL 2).I am modifying an existing firmware built without libc and without startup files.I need to convert floating point variables to strings, so I want to use as little as libc as possible. I choosed newlib-nano for memory size.I compiled with `-mfpu=fpv5-d16 -mfloat-abi=hard -specs=nano.specs ...` and linked with `-mfpu=fpv5-d16 -mfloat-abi=hard -specs=nosys.specs -specs=nano.specs -u _printf_float -nostartfiles ...`I also added the definition of symbols required by the libc and reserved a memory area for the heap. I tried to write a string from a double variable with the following code (it's code for debug only, I know it may overflow the char array depending on float value):char my_string[64]; double my_double = 1.3; sprintf(my_string, "%.3f", my_double);But the content of the string (checked by dumping the memory on debugger) is `1300` and not `1.300`(i tried with different values and format specifiers)Am I missing something ?
Hi,We're working on integrating the STM32N6 Getting Started Object Detection and the VENC SDCard examples and were wondering if we could ask some advice on memory allocation?The Object Detection example defines AXISRAM1_S and I think uses this for the camera interface and ISP - if the RAM required by the VENC is added to this then AXISRAM1_S seems to be insufficient and the linker fails.In the examples, the amount of SRAM available for the application seems to be limited by the position SRAM2 at 0x3418 0000 used by the FSBL then later for NN activations:https://github.com/STMicroelectronics/STM32N6-GettingStarted-ObjectDetection/blob/main/Doc/Boot-Overview.md#boot-from-flash-with-first-stage-boot-loaderthis states "STM32N6570-DK: 1MB of SRAM1 is reserved for the User App (see STM32N657xx.ld) and 1MB of SRAM2 is reserved for the network activations (see stm32n6-app2_STM32N6570-DK.mpool)."More detail of the higher sections of memory is given in:https://github.com/STMicroel
So I have a board which I'm correctly using with threadX and TouchGFX.I want to implement a function that calculates the FFT of a signal, but I'm having a hard time finding the CMSIS-DSP libraries.I need to include the classic math library for ARM#include "arm_math.h" #include "arm_const_structs.h"But in cubeMX I'm finding various DSP librarieswhat should I use?
Hi,I am Working on STM32H745XIH6 MCU which embed in our custom board. I have bootloader code which is working fine on STM32H745I-Discovery board. But when I use bootloader in out custom board problem is unable to jump on application code, but same thing is working fine with STM32H745I-Discovery with same bootloader code and application code.I have debug more and got same interesting things happen which mention in below When I flash the application code from STMcubeProgrammer into my custom board and then give power cycle that time jump from bootloader to application code is working fine. When I flash the application code from bootloader into my custom board, that time I will face the issue in jump from bootloader to application code. Then I have check the Flash memory section of application code and compare in both scenario when flash through bootloader or flash through STM32CudeProgrammer. Application code is match properly. So writing into flash memory through bootloader code is wor
Requesting ST to kindly provide a working example for STM32U545 using stand-alone USB HOST MSC to interface with a USB Pen drive. A Tech-Note explaining the code to be added to the various CUBEMX generated files would help.I have been logging to the USB Pen Drive for years using the F105 and F405 series.For battery operated devices I planned to move to U545 expecting a simple code migration but the USB interface has changed from the familiar and simple FATFS.I tried to refer to the available USBX/FILEX samples of various other devices but could not get them to work as many refer OTG types while U545 has DRD types.I referred to various threads on the community.st.com but they trail off without answers.Thanks.
This article documents step by step the changes to be done in a CUBEMX generated U545 project to access a USB Pen Drive using ST Usb_Host MSC and FatFs Working Code for the NUCLEO-U545RE-Q board is available at https://github.com/NereusF1/stm32u545-classic-coremw-usb-host-fatfsBuilt using embedded software package STM32U5 v1.8 and STM32CUDEIDE v1.19.0This project is tested on the NUCLEO-U545RE-Q board.USB Pen drive must be formatted to FAT32.The classic Middleware versions are ST USB Host Lib V3.5.1. and FatFs VR0.12c (ST modified 2023-08-18). The classic Middleware are copied over from an F439 project built using embedded software package STM32F4 v1.28.31. Create a projectStart a new project in STM32CubeIDE by selecting File → New → STM32 Project. Navigate to the [Board Selector] tab and choose [NUCLEO-U545RE-Q].2. Keep the default board options3. After creating the project, navigate to the [Con
Heyho,not really a bug, but the register ETH_MACCSRSWCRis missing in the struct ETH_TypeDef, in the CMSIS / STM32H7 header files, at least for H723 .. H735.Also checked the github repos.Any specific reason for that?
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.