Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Dear STM32 Community, We believe that the example projects provided for the STM32Cube embedded software are a valuable resource when developing projects. We would like to better understand how developers use these examples in their workflow and explore ways to improve them. Therefore, we have a few questions we would like to ask: From where do you obtain the examples, and why? Are you working with the examples through the STM32Cube MCU packages, the STM32CubeMX Example Selector, or through GitHub? Is there a particular reason you prefer one channel over the others? How do you use the examples in your work with STM32 embedded software? Do you use the examples to learn how to use a driver or a feature, as reference code for implementation, and/or for debugging? What is working well, and what can we do to improve the examples and/or your experience working with them? You can either reply directly in this thread or feel free to send me a private message. &nb
Hi all - I have a problem getting DMA working with SPI, for communication with an MCP3564R ADC as one task in a complex project running on FreeRTOS. I have made a stripped-down version of the project that just does the ADC reading task. It runs on a bare Nucleo board and illustrates the basic problem which shows up from the first transmit, so a connected ADC isn’t needed to see the problem.The code uses SPI3 at 20MHz (although the problem occurs at lower speeds as well)The GPIO pins I’m using are not the defaults:GPDMA1 is configured with two channels for SPI3 TX and RX:My code can be configured to use the HAL SPI DMA APIs or the interrupt APIs like so:static uint8_t write_register(const uint8_t * reg_write_cmd_p, uint8_t num_bytes){ HAL_StatusTypeDef hal_status; BaseType_t wait_ret_val; uint32_t notify_bits; uint8_t ret_val = 0; /* Failure */#if (MCP3564_HAL_SPI_MODE == MCP3564_USE_HAL_SPI_DMA_MODE) hal_status = HAL_SPI_Transmit_DMA(&ADC_SPI_PERIPH_HANDLE, reg_write
hi I am trying to get an sd card to work with my custom board, uses STM32F412RET6.when i try to mount or do anything other than init in 1 bit mode the code gets stuck at this point. I have been able to read block size and number from the SD card but that is it. while(!__HAL_SD_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT)) { if(__HAL_SD_GET_FLAG(hsd, SDIO_FLAG_RXDAVL)) { *(tempscr + index) = SDIO_ReadFIFO(hsd->Instance); index++; } else if(!__HAL_SD_GET_FLAG(hsd, SDIO_FLAG_RXACT)) { break; } if((HAL_GetTick() - tickstart) >= SDMMC_SWDATATIMEOUT) { return HAL_SD_ERROR_TIMEOUT; } }
Hello,is there a definitive application note to interface PDM mics with MDF/ADF?there is AN5027 but it doesn’t tell about MDF or ADF. If I insert correctly MDF/ADF is a newer version of DFSDM but I would like if someone can point me to the interfacing wet stm32cubeMX for MDF/ADF usage with PDM mics showing configurations to interface N number of MICs(1-8) for a required sampling rate(16-96 KHz) if possible?which one to choose MDF or ADF?or both are same?Thanks a lot in advance !regards,S
Hello,I have a project that uses I3C to connect a Nucleo-C562RE with an STM32C542CCT6 MCU. The setup was working fine with HAL 2.0.0 but it does not work in 2.1.0. I generated the code with MX2 and I observed that it is identical to the code in the private_it_controller example code. I stepped through the mx_i3c1_init function and I noticed that the moment the GPIO for SDA and SCL are enabled, the I3C clock (SCL) is turned on (visible on the oscilloscope) and does not stop. I don’t see how this could be correct. When I try to start DAA it fails instantly (the error callback is invoked) and the SDA line never changes state (it stays HIGH after reset).Can someone help with this issue?Thank you,Gil
Hello ST Community,am working with a Nucleo-H753ZI board where the STM32H753ZI is configured as an SPI1 slave, and the SPI master is a TI AM64x R5F core.The goal is for the STM32 to continuously transmit 4-byte frames over SPI (using DMA) whenever the master clocks the bus.However, the problem is:The master is receives only FF FF/* 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 --------------
Setup: STM32F446RE Nucleo + MPU9250 (I2C1, PB8=SCL/PB9=SDA), breadboard wiring, HAL library, 100kHz standard mode.Symptom progression: Sensor works intermittently. When it fails, I see two distinct failure signatures that seem to escalate:First failure mode: HAL_I2C_IsDeviceReady() succeeds (device ACKs its address) but the WHOAMI register read returns the wrong value. After a couple of MCU resets without touching hardware: escalates to the device not ACKing its address at all (IsDeviceReady fails outright).What I've tried:Implemented the STM32 I2C "clear busy flag erratum" workaround (ST-documented fix for the analog filter/BUSY-flag lockup bug — the 15-step GPIO bit-bang + SWRST sequence). This did NOT reliably fix it — worked on some boots, failed on others, no clear pattern. A full power cycle (not just MCU reset — actual power removal) temporarily restores it to working. Reseated all breadboard connections (SDA, SCL, VCC, GND) multiple times — no change in behavior.What this rules
Dear ST Support Team,I am currently working on an LLC resonant converter project using the STM32G474 microcontroller.My goal is to implement Synchronous Rectification (SR) using the STM32G474's PWM timers and Comparator peripherals. However, I am unsure about the correct peripheral configuration and firmware implementation.I would appreciate your guidance on the following: How should I configure the PWM timers and Comparator peripherals in STM32CubeMX for Synchronous Rectification? Which timer and comparator connections are recommended for this application? Are there any reference projects, example firmware, or application notes available for implementing SR on the STM32G474? Are there any recommended CubeMX configurations or firmware examples that demonstrate this functionality? Could you recommend any official documentation, training material, videos, or tutorials that explain the implementation of LLC Synchronous Rectification using STM32? My objective is to understand the c
Dear STM32 Advisor, I'll design a system based on Nucleo 64 H533RE. The system will act as USB CDC and USB HID Keyboard at the same time. The idea is when the CDC receive a character, here for example "F" then the Nucleo H533RE will output a high going pulse. And, if the Nucleo H533RE receive falling pulse external interrupt, the the Nucleo H533RE will press the F8 key. As a beginner on STM32, is it possible? Thanks and regards, Fuad Purnomo.
Hello everyone,I am working on Ethernet communication using the STM32H750B-DK with STM32CubeIDE and LwIP. I am using the onboard LAN8742 Ethernet PHY and a direct Ethernet connection between the PC and the board. LwIP is configured with NO_SYS = 1, and I am continuously calling MX_LWIP_Process() in the main loop. When I check the Ethernet traffic in Wireshark, the PC continuously sends ARP requests asking for the STM32 MAC address, but the STM32 does not send an ARP reply. While debugging the gnetif structure, I see PHYLinkState = 0, speed = 0, and duplex = 0. I also checked the STM32H750B-DK documentation and found that the onboard Ethernet PHY is connected through MII. My CubeMX project was initially configured for RMII, so I changed the Ethernet configuration to MII. I am also checking the Ethernet DMA/LwIP memory configuration and moved the Ethernet descriptor and RX buffer sections to D2 SRAM using the linker script. However, I still cannot get a ping response from the board.Curre
I have two concurrent UART DMA RX running in STM32l431. UART2 is running all the time and UART3 is started when a command is sent and waiting for data. Both of them works, but when I try to make a new DMA transfer on one of them the other stops which I do not want. Why does this happens? Here is the initiation:DMA_HandleTypeDef hdma_rx2;DMA_HandleTypeDef hdma_rx3;DMA_HandleTypeDef hdma_lrx1;DMA_InitTypeDef DMA_InitStructure;void HW_DMA_Init(){ __HAL_RCC_DMA1_FORCE_RESET(); __HAL_RCC_DMA1_RELEASE_RESET(); __HAL_RCC_DMA1_CLK_ENABLE(); __HAL_RCC_DMA2_FORCE_RESET(); __HAL_RCC_DMA2_RELEASE_RESET(); __HAL_RCC_DMA2_CLK_ENABLE(); currentDMABufferWrite = 1; currentDMABufferRead = 0; dmaLen1 = 0; dmaLen2 = 0; dmaHasData1 = false; dmaHasData2 = false; /* Configure the DMA handler for reception process */ hdma_rx2.Instance = DMA1_Channel6; hdma_rx2.Init.Direction = DMA_PERIPH_TO_MEMORY; hdma_rx2.Init.PeriphInc = DMA_PINC_DISABLE; hdma_rx2.Init.MemInc
Hello,I am working with an STM32N657 on the NUCLEO-N657X0-Q and I am trying to use the Ethernet PTP PPS signal as a hardware start trigger for TIM3.TIM3 is configured as follows: HAL_TIMEx_TISelection(&htim3, TIM_TIM3_TI1_ETH1_PPS, TIM_CHANNEL_1);sSlaveConfig.SlaveMode = TIM_SLAVEMODE_TRIGGER;sSlaveConfig.InputTrigger = TIM_TS_TI1FP1;sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_RISING;sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;sSlaveConfig.TriggerFilter = 0;HAL_TIM_SlaveConfigSynchro(&htim3, &sSlaveConfig);TIM3 itself uses an external clock on ETR2 and should only be enabled by the rising edge of ETH1_PPS.The internal connection works correctly when I use the normal/fixed PPS mode.For example: ETH1->MACPPSCR = 1U;In this case the PPS rising edge reaches TIM3, TIM3->CR1.CEN becomes set, TIM3 starts counting and the rest of my application starts correctly.However, I cannot get the same internal connection to
HIHow to create a project for STM32H7 with Ethernet and LwIP stack working | CommunityRx buffers labeled “Zero Copy” and are used by DMA and CPU are not marked by MPU for cacheable? only descriptors are. I couldn’t find any special clean or flush cache operations in code as well. Why is that? Image below shows only descriptors (512B) and TX (LWIP heap) are noncacheable.
Hello everyone,It is more a bug report than a question, but in the last version of X-CUBE-EEPROM, (X-CUBE-EEPROM | Product - STMicroelectronics) I found out that value “EE_NO_PAGE_FOUND” is defined twice.Once in eeprom_emul.h:/* No page define */#define EE_NO_PAGE_FOUND ((uint32_t)0xFFFFFFFFU)And once in eeprom_emul_types.h:/** * @brief EE Status enum definition. *//* Define of the return value */typedef enum { /* External return codes : ok */ EE_OK = 0U,... /* Internal return code */ EE_NO_PAGE_FOUND, -> here, second definition EE_PAGE_NOTERASED,...} EE_Status;Is it made on purpose? Best regards
i have a problem regarding the usage of the jpeg codec on a stm32n657x0h-q to decode images. the project also involves the transfer of such images over eth0 but for the sake of isolation of the problem i have bypassed mongoose. the problem seems to relate only to jpeg interrupts since the hpdma channel0, used to feed the periperal, is working.To develop this project i followed this example for the discovery kit.doing some debugging, i noticed that confr0 is being manipulated (i used a watchpoint), both jpeg_cr and jpeg_sr are being set, but confr1 has a strange behaviour: during Init_process, its registers are properly set, then, when manually halting execution in the cycle in main, the confr1 is set to all zeros. During initialization, registers are as follows:Confr1 has DE and HDR set to 0x1, the others to 0x0;cr has JCEN, EOCIE and HPDIE set to 0x1, the others to 0x0sr has IFTF, IFNFF and COF set to 0x1, the Others to 0x0COF in jpg_cr remains 0x1, as does the JCEN, thus the pheriper
Hello STM team, We are working to interface the NUCLEO-U5A5ZJ-Q and nRF7002-DK using QSPI. We are using vanillas zephyr. We are able to built the code for SPI. But can not be able to built for QSPI. It will be very helpful if you provide a proper support to interface this.
I'm implementing I2C communication using an STM32WBA2 as the Master and an STM32U0 as the Slave.I've implemented a process to send one byte of data (0x75) from the Master to the Slave, with the Slave Address set to 0x68. However, when I check the SCL/SDA waveforms, it appears there's no ACK from the Slave.On the other hand, the Slave receives an event in HAL_I2C_AddrCallback() when it receives 0x68, but the value read by HAL_I2C_Slave_Receive() is empty. How can I receive 0x75 from the Master?I've attached the main.c files for both the Master and Slave.The CubeMX configuration is as follows:
HI.Previously, I successfully completed development for my project using the W25Q128 SPI Flash with its working External Loader file (.stldr).However, due to internal circumstances, we have recently replaced the external memory with the AT25SF128A. Since changing the chip, flashing code via the previous external loader no longer works.As a result, I need an External Loader tailored for the AT25SF128A.Could you please let me know if an External Loader for the AT25SF128A on the STM32H723 is already available from ST?If it is not available, could you provide guidance or reference materials on how to generate/modify an External Loader project for this specific memory?Thank you for your support.
We have a current application in which our F7 is connected to an external Microchip PHY which provides a 50 MHz reference clock for RMII. We are attempting to place the system into a low power mode in which we disable the PHY thus stopping the reference clock. Is there a way to do this that will not cause the network stack on the MCU to fail? We are using Zephyr as our RTOS which may or may not be relevant.
Hi all,I am Jacopo and I am working on a project using STM32U5G9ZJ and I updated to the latest firmware package (STM32Cube_FW_U5_V1.9.0) with STM32CubeMX.I noticed that with the new package the call to HAL_ADC_Start fails to actually start the conversion if used with ADC4. Digging inside the function code I noticed that the call to LL_ADC_REG_StartConversion(hadc->Instance) got moved a couple of lines with respect to the previous version. This means that when the check for ADC4 passes nothing is done, and moving the function call back fixes the problem.Is this a bug? For now I fixed it by manually calling LL_ADC_REG_StartConversion after HAL_ADC_Start, but this is less than ideal.Thank you. Jacopo
Hello,On an STM32H725, changing RDP from Level 0 to Level 1 causes the firmware to stop running. In my device, the LED and FDCAN stop responding, even without a debugger connected. During debug session, this occurs in “HAL_FLASH_OB_Launch()”, more specifically after “SET_BIT(FLASH->OPTCR, FLASH_OPTCR_OPTSTART);”. After a manual power cycle, the firmware runs normally and RDP Level 1 is successfully applied.Is this expected behavior? Is a reset required after changing RDP from Level 0 to Level 1,Thanks!
I am working on UART communication between two STM32 development boards: an STM32H7B3I-EVAL (STM32H7B3LI MCU) configured as the master and an STM32H573I-DK (STM32H573II MCU) configured as the slave. When HAL_Delay() is not added in the master application, the master continuously transmits data over UART, and the slave receives the data continuously without any issues. When HAL_Delay() is added after the UART transmission, the master transmits the data only once and then stops. During debugging, the application is found to be stuck inside HAL_Delay(). The attached screenshot shows that HAL_GetTick() always returns 0, and the global tick counter uwTick also remains 0 throughout execution. Since the HAL tick never increments, HAL_Delay() never completes and the application remains blocked. If execution is resumed from the debugger, the application eventually enters Error_Handler(). I have attached the debugger screenshot showing the values of HAL_GetTick(), uwTick, and the SysTick regis
The MCU works fine the first time it gets programmed. However, after one power cycle, it freezes completely after an external interrupt happens. Doesn’t even enter the error handler. I have SMPS enabled. Thanks for your help int main(void){ /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the System Power */ SystemPower_Config(); /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_RTC_Init(); MX_UART4_Init(); /* USER CODE BEGIN 2 */ GreenLEDOn(); HAL_Delay(5000); GreenLEDOff(); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { if(!HAL_GPIO_ReadPin(V_Fu_Trig_GPIO_Port, V_Fu_T
TIM2 is configured in Encoder Interface Mode (TIM_ENCODERMODE_TI12). In this mode the timer counter (CNT) is driven by quadrature encoder transitions on channels CH1 and CH2 instead of the internal timer clock. PWM generation on TIM2 channel 3 relies on the same timer counter reaching the compare value (CCR3). Since no encoder transitions were present during testing, the counter remained at zero (TIM2->CNT = 0). Consequently the compare event never occurred and the PWM output did not toggle, resulting in a constant output level on the oscilloscope. The issue is therefore caused by the timer counter source being encoder-driven rather than clock-driven.I am using an STM32U535VET6 with the following configuration:1. TIM2_CH1 (PA0) → Encoder Input A2. TIM2_CH2 (PA1) → Encoder Input B3. TIM2_CH3 (PA2) → PWM output for a buzzerTIM2 is configured in Encoder Interface Mode: sConfig.EncoderMode = TIM_ENCODERMODE_TI12; HAL_TIM_Encoder_Init(&htim2, &sConfig); Channel
Hi there ! I start to work with this shield, and i use one STM32G071 for control the UART comunication. The module work at 115200baute rate , and i use the AT command for comunicate with her. So everthingh work fine except when i send ATE0 for turn off the echo this command send back ok but afther i send the other command the answert i receive it’s look like the echo still on . Examplke i send AT\r\n i receive back AT\r\n\r\nok\r\n i try to wait to send the next command but nothingh still dosen’t work. I know i can continus to work eaven send me back the echo but this stuff make me crazy because i don’t understand if is one my problem or if the shield. The UART is configurate with interrupt and i configure the rx in this way every time i receive one byte in the callback i save inside one buffer and outside the callback i check if i receive OK or ERROR. Some one know how to resolve this problem ? Thank You Sergio
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.