Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
STM32G030F6P6 microcontroller CubeIDE environment when enabling interrupt for I2C an LL_I2C_EnableIT_RX (I2C2); error occurs _______stm32g030xx.h:618:29: error: expected declaration specifiers or '...' before '(' token error occurs when any I2C interrupt is enabled
We are starting to develop a new hardware platform and are currently evaluating the STM32H7R/S series for the main controller.The question now is which RTOS is best suited here in terms of long-term support from ST. We're going to use a lot of communication interfaces (USB, Ethernet, external WiFi/BT module, CAN), an RTOS with an integrated communication stack would make our work easier.Zephyr: High initial training effort, but you get a great framework. The two available H7RS-Eval boards are already supported, but in the video Zephyr 4.1: Status of STM32 support – Erwan Gouriou // Zephyr Meetup Grenoble Mar. 26, 2025 by @Erwan Gouriou from March of this year you can see that Zephyr support for the H7RS is not yet complete. Can anyone give an estimate of the extent to which you can already work with it or how much effort is involved in porting drivers from the H7 to the H7RS that are not yet available? I'm new to Zephyr and can't estimate the effort involved.ThreadX: Support
I am using the STM32U585RIT6 microcontroller with the B-U585I-IOT02A development kit. I need to implement USB functionality using an interrupt-based approach. In my project, I have configured USB_OTG_FS in Device-only mode, enabled the NVIC global interrupt, and enabled USBX CDC-ACM. I am using bare-metal code (no RTOS or ThreadX). After completing all the USB configurations, inside the MX_USBX_Device_Init() function I added the following initialization: RX FIFO and TX FIFO configurations USBX DCD initialization using _ux_dcd_stm32_initialize() Started the PCD using HAL_PCD_Start() In the main while loop, I am calling ux_device_stack_tasks_run(). With this setup, the USB device starts correctly and is detected as a Virtual COM Port. Now, I want to handle USB connect and disconnect events using interrupts. For this, VBUS sensing may need to be enabled. While referring to the B-U585I-IOT02A schematic, the USB_VBUS_SENSE pin is shown as PF14. However, in the MCU datasheet and in STM32Cube
When using the STM32H743ZI Nucleo board as the I²C master and two STM32 Blue Pill boards as I²C slaves with different addresses, the master requests data from the slaves and the slaves respond accordingly. However, I²C communication is unreliable during initial startup, and intermittent I²C errors are observed during runtime.Is there anyone to help me with this issue.Thank you.
ST‑LINK Mini V3E not detecting STM32H7 (Core ID error, high current when VTARGET connected)I’m debugging an issue with a custom STM32H7 board and an ST‑LINK Mini V3E. The setup includes a main PCB and a separate power PCB. So far:Power & Basic Checks3.3 V and 24 V rails are correct.Board current consumption is low when powered from either an 8 V or 24 V supply.Connections between the ST‑LINK Mini V3E and the main PCB have been verified.ProblemWhen I connect VTARGET from the ST‑LINK to the board’s 3.3 V rail, the current spikes and something starts to smell hot.STM32CubeProgrammer shows no target voltage, no device ID, and fails to read the core ID.The ST‑LINK is detected by the PC normally.Additional TestsTried a second main PCB and a different ST‑LINK Mini V3E, powering only through the ST‑LINK (no external supply). Same result: STM32CubeProgrammer cannot detect the STM32H7.I’m aware that VTARGET on the Mini V3E is an input, so I’ve tied it to the board’s 3.3 V rail as required.Ne
Hi everyone,I'm working with an STM32F401CCU6 and trying to transmit 2 bytes over I2C3 using DMA1 Stream 5 Channel 6, which is the correct mapping according to RM0368 Table 28:DMA1 Channel 6 Stream 5 -> I2C3_TXThe DMA configuration appears correct, and I do receive the DMA Transfer Complete (TC) interrupt. So the DMA request is generated, the stream runs, and the transfer completes.However, it seems like the I2C slave device (AW9523) never receives the register and data bytes. Unfortunately my osci is currently broken.The same write sequence works perfectly when I use a blocking I2C write (polling SB, ADDR, TXE, etc.). Only the DMA‑driven version fails.What I observe:START condition is generatedAddress is sent and ACKedADDR flag is cleared correctlyDMA TC interrupt firesSTOP is generatedBut the slave never sees the register or data byteDMA is configured as:DMA1, Stream 5, Channel 6Direction: Memory -> PeripheralMemory increment enabledPeripheral increment disabledByte transfersNo
Hello Sir,I urgently want to have an idea whether due to the change of LCD from HT043C KunJjian to RK043FN48H-CT672B Rocktech in 32F746GDISCOVERY Board, is there any changes in the firmware due to this?I would like to request for early response from your team, thanks for your support in advance.Note: From the post only I got a point that RK043FN48H-CT672B Rocktech changed from HT043C KunJjian, 32F746GDISCOVERY B02 and C01 - what's the differen... - STMicroelectronics CommunityBest RegardsSushant Verma
Good day,I've been working for a little on this and can't wrap my head around what the issue is, so figured I'd post here. As a start I'm doing a graduation project from a computer science education and am working on a project that requires a high speed usb to be implemented on a nucleo h755ziq. There are other pieces in play, but those have been disconnected to try and get this one part to work. To make this work I have the nucleo board and a usb3300. This usb3300 has been put on a board and connects to pins placed on the nucleo. I have quadrouple checked the pins and they are all correct. In CUBEMX I setup the USB_OTG_HS external PHY to device mode, as ill be using it as a device which will be detected by an application later in development. I have also set the middleware up for Virtual Com Port as shown below.My pinout is also setup correctly, but for the sake of detail here is the pinout.I have set up the clock for the stm to 192MHZ due to the other components that will b
Hello everyone, I am using a custom board with STM32H750 and I am trying to develop a file system with FILEX. The file system' s media is a uSD card with 10 MB/s baudrate which is communicating with the micro thanks to the SDMMC peripheral. The SDMMC peripheral's configuration is copied from one of the many examples that are available in STMCubeMX ( it has a 50 Mhz clock, 4 bit mode, no power mode save and no transceiver).The uSDcard has been formatted through the api given by FILEX (fx_media_format) following the information available during uSD card initialization ( for example sector size is 512 bytes, number of sectors and so on...).I am using the drivers given by ST for FILEX (in my case SD with IDMA) and I am trying different media size buffer (512, 1024 and 4096) which I allocate in AXI SRAM ( SDMMC1 IDMA can access only in AXI SRAM).I am experiencing two different behaviour: If I am doing a reading operation the SDMMC is very fast while writing operation is
When using USB CDC to communicate via USART, and interacting with USART data, in code is it recommended to interact with it at the USB side, or to interact with it at the USART side?From what I can tell, both offer both polling and interrupt methods. The USART offers DMA access, but apart from that it's not clear what, if any, tradeoffs there are between USB CDC and USART.
Hello,in our application, running on a H533RET6 and with no TZ enabled, we need to close debug ports in production.I preliminarly did some tests using CubeProgrammer: I generated password-based credentials (obk+bin files, which as far as I understand from AN6008 is the only option when not in TZ) and successfully managed to lock the device by moving from PRODUCT_STATE Open (0xED) to Provisioning (0x17), supplying the .obk file and then lock the device (PRODUCT_STATE = 0x72). After verifying that debug ports were closed, I unlocked the device by making a discovery and providing the bin file, with the device returning into Open state. Note that the first 3 32-bit words of my obk file are:0x00, 0x01, 0xfd, 0x0f, 0x60, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00Showing that the address base is the secure OBK base address and that the encryption is on (as it should be in my device, again as far as I understand).So far so good, but know I would like to move at least the encryption process
I'm trying to enable USART transmission (TX only for now) via DMA, but when I call HAL_UART_Transmit_DMA, the transfer doesn't seem to start at all and HAL_UART_TxCpltCallback is never called.I've configured everything through CubeMX: enabled USART with DMA, enabled FreeRTOS, and enabled interrupts. Without DMA, transmission works fine using HAL_UART_Transmit, but when I switch to HAL_UART_Transmit_DMA, nothing happens.I can't figure out what the problem might be. Does anyone have any suggestions?Here's my main code:/* 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 fi
Hello everyone, I'm having some trouble implementing I3C communication and would like to ask for some help. I am using the NUCLEO-H503RB board as my main controller. For the target devices, I have the NUCLEO-IKS01A3 expansion board and the TSC1641 (Click Board) connected. I'm currently facing some issues with the I3C communication setup between these components. I have successfully managed to read the WHO_AM_I ID from the LSM6DSO (on the NUCLEO-IKS01A3). However, when I attempt to read the ID from the TSC1641, the SCL line continues to output a clock signal (or stays toggling) without a proper response. I am seeking assistance in analyzing the root cause of this issue.
I want to make a pedometer app that would count steps and display the number of steps on an LCD screen. I have tested my functions for the screen (ILI9341 SPI), and they work successfully. I tested the LCD code by initializing a timer that incremented the value to display every second and sets the flag update_lcd_flag.But when I add the pedometer code, which uses SPI1, the value on the screen never gets updated past zero. Is it because I launch a DMA interrupt from the timer interrupt, or do I need to look for problems somehwere else, e.g. in my pedometer logic or SPI1 configuration? The pedometer relies on the accelometer, which is built into STM32F4O7G-DISC1, which is my board, by defaultP.S. The LCD functions don't use interrupts or DMA, they only use polling.The timer callbackvoid HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef* htim) { if (htim->Instance == TIM2) { if (draw_ready == 1) { HAL_GPIO_WritePin(ACC_GPIO_PORT, ACC_GPIO_PIN, GPIO_PIN_RESET); HAL_SPI_T
I am migrating from STM32L431 to STM32L471. After migration, the function relating to internal flash writing does not work any more. The problem is when I programmed internal flash with HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, address, data), following errors occurred, including FLASH_SR_PROGERR, FLASH_FLAG_PGAERR, and FLASH_FLAG_PGSERR.I searched on the web, and found problem may relate to timer initialization and watchdog usage. I added HAL_TIM_Base_DeInit before HAL_TIM_Base_Init, and watchdog is disabled completely in the system including wathdog initialization and update.. But the problem is still there.By the way, the development environment is MDK5.36, ARM::CMSIS IS 5.8.0 (5.6.0 is also tested), ARM::CMSIS-Driver is 2.6.1, Keil::STM32L4xx_DFP is 2.6.1.So, what the problem it might be, and how can I solve this problem?Thanks
Hello,I am using an ST7701S LCD over 3-wire SPI (CS, SCK, SDA) with my STM32.When I send the initialization commands from my ESP, I noticed the following:The first command of the sequence is not sent.The program seems to stop at the second stage, around the 100th command.SPI is configured in master mode, polling (no DMA, no interrupts).Example of the write function:void ST7701_Write(uint8_t dc, uint8_t data) { uint16_t value = ((dc & 0x01) << 8) | data; HAL_GPIO_WritePin(LCD_CS_GPIO_Port, LCD_CS_Pin, GPIO_PIN_RESET); HAL_SPI_Transmit(&hspi2, (uint8_t *)&value, 1, HAL_MAX_DELAY); HAL_GPIO_WritePin(LCD_CS_GPIO_Port, LCD_CS_Pin, GPIO_PIN_SET); }Questions:Could the first command being skipped be due to HAL/SPI initialization or state?What is the recommended method to ensure all commands are reliably sent over 3-wire SPI to ST7701S?Thank you for your help.
Hello Everyone,I hope this message finds you well. I am currently developing a USB Host application using the STM32H573I-DK and have encountered a persistent Hard Fault issue that I would like to seek your expertise on.[Environment Information]Target: STM32H573I-DKExample: USBPD_SRC_UX_Host_MSC Stack: Azure RTOS (ThreadX, USBX)[Detailed Symptom]A hard fault occurs during initialization or while driving the process thread (msc_process_thread_entry) when connecting a USB MSC device. Debugging revealed abnormal memory access occurring during execution of the _ux_utility_memory_copy function.[Inquiry]When implementing USBX Host in this example and the STM32H5 environment, we seek broad advice on potential causes that could trigger memory copy and access errors.Example Stability: Are there any known issues or patch histories related to USBX memory management or stack configuration in the currently deployed USBPD_SRC_UX_Host_MSC example?H5 Architecture Characteristics: Are there scenari
I'm using stm32u535 and would like to have zero crossing detection of supply voltage. I've requirement of 6ADC channels and all are configured in differential mode and adc clock is 25Mhz and resolution is 14 bit and dma circular mode is enabled. On channel 6 i e enabled analog watchdog and written logic in isr to toggle GPIO. I proved gpio and I see deviation. Can someone help here. Here is my code snippet:ADC and AWDG initialization: hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; hadc1.Init.Resolution = ADC_RESOLUTION_14B; hadc1.Init.GainCompensation = 0; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV; hadc1.Init.LowPowerAutoWait = DISABLE; hadc1.Init.ContinuousConvMode = ENABLE; hadc1.Init.NbrOfConversion = 8; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_N
Hi STM Devs!I would like to introduce a thread scheduling library - SuperTinyKernel (STK).Its GitHub repo: https://github.com/dmitrykos/stkYou can check capabilities in detail on GitHub but briefly STK can:Soft and hard real-time support: STK supports cooperative scheduling for “soft real-time” tasks, you can also enable hard real-time mode (KERNEL_HRT) for periodic tasks with guaranteed deadlines.Static and dynamic tasks: Define all tasks at startup (KERNEL_STATIC) or allow tasks to be created and destroyed at runtime (KERNEL_DYNAMIC).Low-power friendliness: STK puts MCU into a low-power mode when there are no runnable tasks (task calls Sleep).Tiny footprint: Minimal C++ abstractions (no STL, no heavy namespaces) keep the kernel small and simple.Portability: Supports ARM Cortex-M and RISC-V RV32 MCUs.Multi-core support: Fully implemented for Cortex-M and RISC-V.x86 development mode: Compile & debug your code on a PC before flashing to the MCU, which helps with early
NUCLEO-F411REI have ADC1 to DMA in a circular buffer 4 samples long (ADC_VAL). I then use a TIM1 interrupt to send the contents via UART to a PC. int16_t ADC_VAL[4]; ... HAL_ADC_STart_DMA(&hadc1, (uint32_t *)ADC_VAL, 4); /* TIM1 callback */ void HAL_TIM_periodElapsedCallback(TIM_HandleTypeDef *htim) { HAL_UART_Transmit(&huart2, (uint8_t *)ADC_VAL, 16, 10); } Should I have declared ADC_VAL as a uint32_t ?
HelloI am currently developing a quadruped robot using a NUCLEO-H753ZI. My setup involves a mix of Dynamixel AX-12+ (UART3, 1Mbps, Protocol 1.0) and MX-series motors (UART6, 2Mbps, Protocol 2.0) using an SN74LS241N transceiver.The Problem:UART3 (AX-12): Works perfectly at 1Mbps. This confirms my basic transceiver logic and wiring are functional.UART6 (MX-Series): No response at all. I’ve tried downgrading the MX motors to 1Mbps and using Protocol 1.0 to match the AX-12, but still nothing.Technical Context & MPU Setup: To provide more context, I have implemented an MPU configuration primarily to handle IMU sensor data via DMA. I wanted to ensure cache coherency for the IMU data buffers.However, I am now concerned that this MPU/Cache setup might be interfering with my UART6 communication. Since the MX motors on UART6 require much higher timing precision (especially at 2Mbps), I suspect the D-Cache or MPU regions might be causing issues with the UART TX buffers, even though I'm curren
Hi I have been testing secure function calls from non-secure world in STM32U575 - TrustZone Enabled environment.I have a LED_Port which is in secure world (secure peripheral). I have implemented a toggle function in secure project - secure_nsc.c/hCMSE_NS_ENTRY void SECURE_BlinkBlueLED(void) {...}I can be able to compile without any issues:Here are some linker details:.....................................I verified the map files as below.......................Now I am calling this function from non-secure project: It went to Hard Fault as it calls original function which is in the secure world.How to call veneer instead of direct function?Any help?
I have been trying to add freeRTOS to simple LED - TrustZone enabled project (default LED project). I just followed the instructions as given here: How to use STM32U5 with FreeRTOS™ in tickless mode - STMicroelectronics Community This instruction shows enabling X_CUBE-FREERTOS for NS but this gave me the following errors: So, I enabled for both, secure and non-secure versions in Cube MX This solved my previous errors but code hang in HAL_GTZC_MPCBB_ConfigMem() [Note: before enabling RTOS I did not see any issues in calling this function] Any suggestions?
Zephyr RTOS 4.3.I am trying to get this sample working on my STM32 Nucleo F767ZI board:zephyr/samples/drivers/uart/async_api/I created an overlay file.nucleo_f767zi.overlay dut: &usart3 { dmas = <&dma1 2 STM32_DMA_PERIPH_TX>, <&dma1 3 STM32_DMA_PERIPH_RX>; dma-names = "tx", "rx"; }; &dma1 { status = "okay"; }; Building and running the sample I get the following output: *** Booting Zephyr OS build v4.3.0-929-g1d6e0d533a81 *** [00:00:05.000,000] <inf> sample: Loop 0: Sending 3 packets [00:00:05.000,000] <err> uart_stm32: Tx buffer should be placed in a nocache memory region [00:00:05.000,000] <err> sample: Unknown error (-14) [00:00:05.000,000] <err> uart_stm32: Tx buffer should be placed in a nocache memory region [00:00:05.000,000] <err> sample: Unknown error (-14) [00:00:05.000,000] <err> uart_stm32: Tx buffer should be placed in a nocache memory region [00:00:05.000,000] <err> sample: Unknown error
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.