Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
I am working on a project that requires a 320x240 LCD panel (ILI9341). I use a nucleo board with STM32G071RB chip. The SPI communication works fine when I use a blocking HAL_SPI_Transmit() function, but it takes a while to fill the entire screen. When I use a DMA with SPI to speed it up, all colors get distorted. I have tried a HAL_SPI_Transmit_DMA() - transmit only function, and a two way HAL_SPI_TransmitReceive_DMA() function. I tried switching from 8-bit SPI to 16-bit SPI mode for DMA transfer, but always get the same color distortion problem.A detailed analysis revealed the core problem. While transmitting the RGB565 pixel information 'RRRRRGGGGGGBBBBB', the 16-bit data is broken into two bytes 'RRRRRGGG' and 'GGGBBBBB'. In the blocking SPI transmit function both bytes are transferred. With any configuration SPI -DMA, the second bit gets lost. The ILI9341 controller receives a single byte and for some reason reads it, according to
Hi team,I am working on the STM32U585I-IOT02A board and trying to implement USB dual-role functionality (Host + Device).My goal is:USB Host: MSC class (to read firmware from a USB flash drive)USB Device: CDC class (for communication with a PC)I have enabled both the USB Host stack and USB Device stack in CubeMX, but I am unable to get the dual-role setup working reliably.My main objective is to upgrade firmware using a USB flash drive (MSC Host) while still supporting CDC Device communication.I would like to know:Does STM32U5 support USB dual-role operation (Host + Device) simultaneously or via role switching?Is there any example project or reference implementation for USB dual-role on STM32U5?Are there recommended approaches for implementing firmware upgrade via USB MSC Host on this board?Any guidance or example projects would be very helpful.Thank you.
I have an STM32H7A3ZIT running at 280MHz with 4 SPI buses attempting to “simultaneously” communicate with external ADCs. All 4 SPI are set up as full-duplex masters, 16-bit data size, 8.75 MHz clock speed, and software chip select.I’m using the HAL function HAL_SPI_TransmitReceive_IT to sequentially initiate the data transfer for each SPI bus. I expected each transfer to start quickly one after another, but instead I’m finding large time gaps. The TransmitReceive_IT composite image below shows the chip select line (yellow) and the SPI clock signals (cyan) for each sequential SPI bus. You can see the first 2 buses start clocking quickly, but then there is a time gap before the third and fourth buses start clocking. The code functionally works as the received data is correct, but the end of the transfer for the fourth SPI bus is too close to the next CS transaction, not leaving a lot of time for data processing.TransmitReceive_ITOddly enough, if I change the function to just receivi
Hi,I want to fly the STM32F429I-DISC with the 8 MB SDRAM. I use CubeIDE and selected the right board. All units are set to default. I commented out everything that had to do with os.With help of ChatGPT I hacked together an initialization of the SDRAM and set up a SDRAM Test. That seems to work partly but with weird effects. In the following code: start/end 0x00/0xff or 0x100/0x1ff works fine, but start/end 0x00/0x101 reads out 0x100 at address 0x0. Maybe it is an timing issue with precharged lines.THXCheersDetlef #define SDRAM_BASE_ADDR ((uint32_t)0xD0000000) void SDRAM_Test(void) { volatile uint16_t *p = (volatile uint16_t *)SDRAM_BASE_ADDR; uint32_t i ; uint32_t start = 0x100 ; uint32_t end = 0x302 ; for (i=start; i<end; i++) p[i] = i; sprintf(buf,"start \r\n",i); HAL_UART_Transmit(&huart1, (uint8_t *) buf, strlen(buf), HAL_MAX_DELAY); while(1){ for (i=start; i<end;i++) if (p[i] != i){ sprintf(buf,"no 0x%x 0x%x\r\n",i,p[i]); HAL_UART_Transmit(&
Got a message: " Break at address "0x8001c50" with no debug information available, or outside of program code." and exited. Please help. If you need more info please advise.
Board: STM32H750B-DK (DK32H750B$AT1)IDE: STM32CubeIDE 1.14.1CubeMX: 6.11.1TouchGFX: 4.23.1Firmware: STM32Cube FW_H7 V1.12.1Problem Description:I created a new TouchGFX project for the STM32H750B-DK board. The project builds successfully (0 errors, 1 warning), but I cannot debug it. When starting a debug session, I get the error: "Cannot access memory at address 0x90000000".The project is configured to use external QSPI flash (0x90000000) for code execution (XIP) since the code size (424KB) exceeds the H750's internal flash (128KB).What Works:Project builds successfullySimple non-TouchGFX blinky projects debug successfullyWhat Fails:Debug session fails with memory access errors at 0x90000000Attempts to set SP/PC from external flash vector table failAs found STMicroelectronics ST-LINK GDB server. Version 7.12.0Copyright (c) 2025, STMicroelectronics. All rights reserved. Starting server with the following options:Persistent Mode : DisabledLogging Level : 1Listen Port Number : 61
I’m running micro-ROS on an STM32G474RE (NUCLEO-G474RE) with FreeRTOS (STM32CubeIDE / CubeMX integration) over UART to the micro-ROS agent.The firmware boots and the executor loop runs (LED heartbeat works), but no subscription callback ever triggers, even for a simple topic like std_msgs/msg/Int32.```export ROS_DOMAIN_ID=<id>ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0 -b 115200 -v6``````export ROS_DOMAIN_ID=<id>ros2 topic pub -r 5 /mcu/test std_msgs/msg/Int32 "{data: 1}"```ros2 topic echo on the host shows messages, but the MCU callback never fires. I also tried different QoS and longer spin_some() timeouts.Question: can this happen if I print debug logs (printf/UART) on the same UART used for micro-ROS transport, or are there other common causes on STM32G4?
Hi all,I’m working on an STM32WB55 and trying to run two advertisements “in parallel”:a connectable advertisement (for normal connections / data)a non-connectable advertisement using Additional BeaconI can see both advertisements from an Android device, so the basic setup works.The problem I’m struggling with is synchronising beacon payload updates with the actual beacon transmissions.What I’d ideally like to do is update the beacon payload right before each non-connectable advertising event, so the transmitted packet always contains the latest data, without updating faster than the beacon interval.I looked into using ACI_HAL_END_OF_RADIO_ACTIVITY_EVENT as a pacing mechanism (e.g., update the beacon payload right after an advertising event so the next one carries new data). However, with two advertising roles and other BLE activity (connection events, etc.), this event is generated frequently and not only for the additional beacon advertising. From what I can tell, it also doesn’t clea
..
Code is written using stm32CubeMX. Connecting with stmlink V3 Minie. Executing step by step, it appears that debug fails (lose connection) when executing debug_init. In fact debug_init creates the problem when programming pa13.When removing the initialization of PA13 and PA14 in debug init, things seems to work but I have no idea of potential side effect. An recommendation?
Hello everyone,I am currently working on a project to develop drivers for STM32F4 microcontrollers, based on Reference Manual RM0090 (without HAL, only CMSIS and register access).The goal of the project is to design reusable low-level drivers for the following peripherals:USART / UARTSPII2CI am now in the code implementation phase.I would like the community's help with the following:Examples of source code or references (preferably bare-metal / register level) for:SPI : transmission et réceptionI2C : master transmit / master receiveUART : transmission et réceptionRecommendations on API structure and function naming, for example:SPI_Init(), SPI_Transmit(), SPI_Receive()I2C_MasterTransmit(), I2C_MasterReceive()USART_Transmit(), USART_Receive()Any help, code snippets, links to reference implementations, or feedback would be greatly appreciated.Thank you in advance for your help.Best regards, *This post has been translated from French to comply with the ST Community guidelines.
I want to interface STM32G474 MCU with DS18B20 digital temperature probe in my project. The DS18B20 uses one-wire interface. Is one wire interface supported with this MCU? Kindly provide a detailed explanation. Help please. Datasheet link for DS1B20: EVVO DS18B20Axx Regards,Sreejith
Hi STM32 experts, I've been digging through the STM32WBA65RI datasheet and the RM0515 STM32WBA6xxx advanced Arm®-based 32 MCUs but can't seem to locate the factory default values for the FLASH_OPTR register for the STM32WBA65. Unliked the solution from this thread, where the RM0440's Option Bytes Descriptions section indicates ST Production Value, the RM0515's Option Bytes Descriptions section starting on page 206 doesn't contain the factory production value. Am I missing this information elsewhere in the RM0515 or STM32WBA65RI datasheet? Thanks and Best Regards,-Eric
Hello everyone, I’m working on a project to interface an OV5640 camera module with an STM32H743 MCU via the DCMI interface. I’ve set up the STM32H743 in CubeMX and generated a basic project, but I’m looking for supporting documents, example projects, or reference drivers to help with the integration. Specifically, I am looking for guidance on: OV5640 initialization sequence (XCLK, SCCB/I2C configuration, reset/power-down sequence) Recommended CubeMX DCMI + DMA settings for QVGA RGB565 capture Memory placement for DMA frame buffers (AXI SRAM vs DTCM vs SDRAM) Minimal working register tables to enable QVGA or VGA output Any ST or community examples of STM32H7 + OV5640 projects I understand DCMI + DMA basics, but I am aware that OV5640 requires stricter timing and more complex initialization. Any pointers to example projects, application notes, or reference drivers would be extremely helpful. Thank you in advance!
Split from this thread for a new question. Thank you. I've changed the programmer, and it now programmed without errors. I however get a Hard Fault, sitting in HardFault_Handler(), as soon as I run. It happens before the code gets to main(). It also does not look like it is matching symbols to files correctly, because it is not showing code. I did check that Load Symbols is checked in debugger settings. Can this HardFault be related, or should I start new post to help with that?
Post moved from this thread. @ STTwo-32 I am using the same STM32H755ZIQ board and facing the same issue where the target is not detected by ST-Link after uploading the program.This is the code link: https://github.com/kavyammengineer/stm32debug/tree/main/led_on_offThe code works correctly on the Nucleo-H755ZIQ board, but when I upload it to my customized board, the target gets stuck and is no longer detected by ST-Link.this is my sysclk 64Mhz
Hello everyone,MCU in use: STM32H745XI (dual-core, Bootloader v9.1, CubeIDE 1.16.1, HAL v1.11.3, CubeProgrammer v2.17.0)Hardware status: BOOT0 HIGH works perfectly, I can access the system bootloader over USART1 (PA9/PA10), and program via UART. Hardware is validated and all connections are good. PB15/PB14 pins are floating, not connected anywhere.My need:I want to jump from user application (C code only, no BOOT0 pin) to the internal ROM system bootloader for firmware update purposes, so that I can upload new firmware over UART (using CubeProgrammer or similar), and then return to normal application on the next reset.Here are the methods I have tried (none worked):Set MSP to 0x1FF09800, jump to 0x1FF09804 (function pointer), disable all interrupts (NVIC->ICER), set PRIMASK/FAULTMASK, disable and invalidate caches (SCB), disable SysTick, deinit all peripherals (HAL_DeInit, RCC_DeInit, etc.).Disable MPU/SAU regions (including secure/privileged regions).Put all GPIOs (including used U
Hi I'm looking for a developer for single-phase SPWM modulation using a Nucleo STM32G474. Thanks
In AN2606 Rev 69, the STM32WBA6x system bootloader section describes the UART interface as USART3, but there appear to be errors:1. Inconsistency within the same entry:The TX pin description mixes USART2 and USART3 in the same sentence:USART3_TX pin Output PA12 pin: USART2 in transmission mode. Kept in reset configuration until 0x7F detected on USART_RX.While the RX pin description correctly uses USART3:USART3_RX pin Input PA11 pin: USART3 in reception mode. Used in alternate push-pull, pull-up mode.2. PA11/PA12 are assigned to USART2, not USART3:According to the STM32WBA62 datasheet, PA11 and PA12 are mapped to USART2 (USART2_RX / USART2_TX), not USART3.Question:Does the STM32WBA6x system bootloader actually use USART2 on PA11/PA12? It seems the document should read USART2 throughout, and the current "USART3" label is an error.Could ST please clarify and correct this in the next revision of AN2606?Environment:- Document: AN2606 Rev 69- MCU: STM32WBA62CGU6- Section: STM32WBA6x boo
Hi! I am working with a stm32h743zit6 + ov5640 combo. I am using STM32CUBEMX + Makefile on Ubuntu.Currently I am at the state of:- Camera setup is successful- Code gets into HSYNC event callback- Code gets into VSYNC event callback- Code doesn't get into Frame event callback Currently I am unable to capture any images. I would really appreciate your help! Thank you in advance!
In section 19.6.2 LCD frame control register (LCD_FCR) of the STM32U0 RM0503 Reference Manual, the examples provided for PS and DIV initially count up in decimal, but finish in binary. This looks like an accident and is confusing to the reader. https://www.st.com/resource/en/reference_manual/rm0503-stm32u0-series-advanced-armbased-32bit-mcus-stmicroelectronics.pdfAll other examples further down in section 19.6.2 correctly count up in binary and do not mix in decimal numbers:
helloDescription:I'm currently working with the STM32U585 and encountered an issue related to USART3Most of the time the code works fine, but it occasionally gets trapped in HAL_UART_IRQHandlerI am using the DMA Receiver Timeout (RTO) and DMA TX, may code is:void uart_tx_complete_cb(UART_HandleTypeDef *huart) { if (...) HAL_UART_Transmit_DMA(huart, buf, len); } void uart_rx_error_cb(UART_HandleTypeDef *huart) { HAL_UART_AbortReceive(huart); if (huart->ErrorCode & HAL_UART_ERROR_RTO) { ... } HAL_UART_Receive_DMA(huart, rx_buf, rx_buf_len); } HAL_UART_RegisterCallback(&huart3, HAL_UART_ERROR_CB_ID, uart_rx_error_cb); HAL_UART_ReceiverTimeout_Config(&huart3, 100); HAL_UART_EnableReceiverTimeout(&huart3); HAL_UART_Receive_DMA(&TD_UART_HANDLE, rx_buf, rx_buf_len); HAL_UART_RegisterCallback(&huart3, HAL_UART_TX_COMPLETE_CB_ID, uart_tx_complete_cb); When the issue occurs, I found that the TC (Transmission Complete) flag is not being cleared:an
Hello!I am writing a program for STM32F769I-DISCO board that uses FreeRTOS and LwIP to communicate with the server and send data to it. It generally works, but unplugging and plugging Ethernet cable (especially doing it several times within a few seconds) usually causes Ethernet DMA errors which make program stop calling HAL_ETH_IRQHandler and thus board can't even try to reconnect to server. I don't know how I should handle those errors and where to look for information that could offer a solution to my problem.Any kind of help, whether a direct response or a link to helpful resources, is appreciated. Ethernet DMASR registerheth error codeMPU and Ethernet descriptors EDIT 1: Added ethernetif.c and lwip.c files to attachments and screenshot of MPU configuration.
I generated my project from the TouchGFX envinroment.Itried to modify the cube file and i got the following issues1. linking error ld.exe: cannot find -l:libnemagfx-float-abi-hard.a: No such file or directory2. linking error ld.exe: cannot find -l:libtouchgfxnema-float-abi-hard.a: No such file or directory3. many basic files are missing like main.h so i cant access any gpio by the name that was given to it in my user files
Hello,I have filed an issue but thought I would post this here for reference, this bug took me quite a while to hunt down and hope to save others time possibly:I have found a memory-safety defect in EEPROM_Emul on STM32U5 128-bit flash-line config.Config:- FLASH_LINES_128B enabled- EE_ACCESS_32BITS enabledIssue:- EE_ReadVariable32bits() passes a single EE_DATA_TYPE buffer:Core/EEPROM_Emul/Core/eeprom_emul.c:758, :762- In FLASH_LINES_128B mode, ReadVariable() writes two words:Core/EEPROM_Emul/Core/eeprom_emul.c:1184, :1185- This writes beyond the caller’s single-word buffer and can corrupt stack/register state (we observed HardFault with corrupted stacked PC).Why “wrong API usage” is not a valid dismissal:1) The API is publicly exposed in this build mode (Core/EEPROM_Emul/Core/eeprom_emul.h:126 with FLASH_LINES_128B APIs also present at :130).2) An exported API must not corrupt memory under any call pattern; unsupported combinations must fail explicitly.3) This component already uses st
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.