Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
HelloI have my own board with STM32G071KBT6 microcontroller. I successfully comunicate with charger by PD protocol and I receive up to 21 V (PPS). But I need above 21V. I have power bank with AVS up to 28V and USB cable with e-marker (up to 240W). How to configure the stack to receive EPR parameters? I have no TCPP IC, but I use my own protection circuit. In the trace the EPR commands isn't present. I use STM32CubeIDE 2.1.1 and STM32CubeMX 6.17.0.Thanks a lot and best regards
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
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 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 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
Hello, I am using stm32f429zi for my project, I set timer 1 with 4 channels (channel 1 and 2 as input channel, and channel 3 is output channel). I would like to generate a pulse from channel 3 with low frequency and around 50% width to set a communication handshake signal to different control board. I set main frequency as 168MHz, so timer 1 APB2 is 168MHz. the setup is followed: TIM_ClockConfigTypeDef sClockSourceConfig = {0}; TIM_MasterConfigTypeDef sMasterConfig = {0}; TIM_IC_InitTypeDef sConfigIC = {0}; TIM_OC_InitTypeDef sConfigOC = {0}; htim1.Instance = TIM1; htim1.Init.Prescaler = 2099; htim1.Init.CounterMode = TIM_COUNTERMODE_UP; htim1.Init.Period = 65535; htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim1.Init.RepetitionCounter = 0; htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; if (HAL_TIM_Base_Init(&htim1) != HAL_OK) { Error_Handler(); } sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; if (HAL_TIM_ConfigClockSource(&
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:
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
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
Dear ST Community Team,We are working on the STM32N657X0H3Q microcontroller and interfacing two Infineon S80KS5123GABHB020 Octal HYPERRAM devices using the XSPI1 interface in the dual-octal (16-bit) configuration, as shown in the STM32N6 Reference Manual (Figure 196 – XSPI block diagram for dual-octal configuration).In our hardware design:MCU: STM32N657X0H3Q Interface: XSPI1 Memory devices: 2 × Infineon S80KS5123GABHB020 Octal HYPERRAM Configuration: Dual-octal mode (two 8-bit memories operating as a single 16-bit memory interface) Both memories are connected according to the STM32N6 dual-octal configuration.We would like guidance on how to correctly configure this setup in STM32CubeMX.Could you please provide the recommended CubeMX configuration for the following?How should XSPI1 be configured for dual-octal mode? Which Memory Type should be selected for the S80KS5123GABHB020? How should the chip select (NCS) signals be configured for two memories operating in dual mode? Are there an
Hi everyone,I have published a small bare-metal USB-C Power Delivery sink example for STM32 MCUs with the built-in UCPD peripheral:https://github.com/robobtnet/stm32-usb-pd-baremetal-sinkThe goal is to keep it minimal and portable:- no FreeRTOS- no ST USB-PD middleware- only two core files: pd_bm.c and pd_bm.h- configurable sink profiles- starts from the highest configured voltage profile, then falls back to lower profiles- reports the selected PD contract through the APIThe current tested setup is NUCLEO-G474RE using UCPD1. I also added porting notes for STM32U5/GPDMA based on an STM32U575 test project.I would appreciate tests and feedback on other STM32 families or boards that include UCPD, especially:- STM32G0- STM32G4- STM32U5- STM32L5- boards using UCPD2- boards using GPDMA instead of classic DMA- different USB-C PD chargers and PDO combinationsThis is not intended to be a full USB-PD stack. It is a lightweight sink-only example for simple cases where the MCU only needs to request
Hi,Maybe someone has encountered a similar problem. I've been working on it for a few days now and unfortunately with no results, so I'm looking for help here. Maybe I'm doing something wrong.Board / setupST NUCLEO-N657X0-Q (reference board). MCU: STM32N657X0HxQ (VFBGA264). On-board external NOR: MX25UM51245G in Octal DTR mode on XSPI2 (external loader: MX25UM51245G_STM32N6570-NUCLEO.stldr). FSBL's XSPI init/memory-mapped-enable code is based on the XSPI_NOR_MemoryMapped_DTR reference example for this board.Boot chain: FSBL (runs from AXISRAM2, never itself XIP) → MCUboot (Direct-XIP + Direct-XIP-Revert, single image, ECDSA P-256) → verifies and jumps into the Application, which executes Direct-XIP directly from the same XSPI2 memory-mapped NOR (no copy to RAM for the app itself).GoalFrom within the running Application (while it is executing Direct-XIP from XSPI2), temporarily exit memory-mapped mode, write to the flash (initially just the MCUboot trailer image_ok flag, eventually firm
Hello, I am trying to collect data on the STWINKT1B board with the microSD card. I have a 128GB microSD which I formatted to FAT32. While running tests I noticed that after I click the USR button on the board it starts collecting data like normally, but after 55 seconds it stops logging data. If I click the USR button a second time, the same process occurs. I checked the data folders that populated on the SD card from the tests and the data seems to be accurate. I checked the device_config.json file to double check that ‘automode’ was no enabled, which it is not. I am wanting to run longer, continuous tests. Does anyone know why I am having this issue and how to go about fixing it?Another issue that I am running into is because of network restrictions, I cannot write to the microSD card so I cannot get the device_config.json file on the SD card. I tried using the BLE app to configure the sensors, but it is grayed out and says that it is unavailable for my proficiency level. Is there a
I'm learning embedded development and would like to build a simple USB game controller as a practice project. I also manage a gaming website called TomodachiLifeROM, where I write about Nintendo games and gaming-related projects, so I'd like to experiment with custom hardware in the future.I'm considering using an STM32 development board, but I'm not sure which one would be the best starting point.Could you please advise:Which STM32 Nucleo or Discovery board is best for beginners? Is STM32CubeIDE sufficient for this type of project? Are there any official examples for USB HID game controllers? Which STM32 MCU family would you recommend for learning embedded programming and USB development?I've read through the STM32 documentation and examples, but I'd really appreciate recommendations from developers with hands-on experience.Thank you!
Hello ST community,Is there a way to find information about how many bytes I've written to the flash memory of a certain memory area at some memory address (not starting at 0x0800000, but at 0x0802000)?When I first power up, the byte counter is initialized to 0, and as I write bytes from address 0x0802000, I count the number of bytes, and at that point, I get the information about the number of bytes written.But my goal is to know how many bytes I've previously written when I power cycle the STM32H7 MCU. Is there an option that counts the number of bytes written to the flash memory and automatically stores that information somewhere in the memory?If so, which memory and at what address?Thanks to anyone who can help me.Regards
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.