Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Heyho,H723..H735, using DTCM a lot, also ITCM for some functions.Recently I found some strange behaviour:the global pointer sFlashIntCtl.pu8WrBuf to the buffer u8FlashIntPageBuf (global) is set in function A setting the pointer is working, printf via UART later on function A calls function B pointer sFlashIntCtl.pu8WrBuf is not changed anywhere, no IRQ or anywhere first thing function B is doing: check if pointer sFlashIntCtl.pu8WrBuf != NULL check fails, because sFlashIntCtl.pu8WrBuf = 0 (checked via UART, see below) Here’s the UART output:function A UART output:*** start *** wr SPI flash to APP flash&u8FlashIntPageBuf[0] 20000800sFlashIntCtl.pu8WrBuf 20000800 <- this OKAYsOspiFlashCtl.pu8RdBuf 20000800sFlashIntCtl.u32WrAddr 08040000sFlashIntCtl.u32ChkAddr 08040000sOspiFlashCtl.u32RdAddr 00000100sOspiFlashCtl.u32RdLen 32...function A calls function Bfunction B UART output:#E FlashIntWrPage(): pu8WrBuf = NULLsFlashIntCtl.pu8WrBuf 00000000 <- WTF ?&u8FlashI
Hi everyone,I am working on an STM32H745 dual-core device.My current setup is:CM7 starts first after reset (default hardware behavior). CM7 performs minimal initialization and releases CM4. The bootloader runs on CM4. CM4 bootloader is located at 0x08100000. CM4 application is located at 0x08120000.The CM4 bootloader validates the application image and then jumps to the CM4 application using the standard vector table jump sequence.My goal is to support firmware updates of the CM4 application while the bootloader itself is running on CM4.I would like to understand the recommended architecture and any limitations for this scenario:What is the recommended way to organize flash banks when the CM4 bootloader needs to update the CM4 application? Is it safe for a CM4 bootloader executing from Bank 2 to erase/program another region in the same bank where the CM4 application resides? Should the bootloader be moved to a different flash bank or SRAM during the update process? Are there any STM32H
Hi everyone!I have a project where I start, with the help of the Timer 3, three ADCs(ADC1, ADC2 and ADC4). Each of them samples 256 samples and then stops. Then I disable them and start a calibration process on all three ADCs.This is repeated with a frequency of 4Hz approx. Interesting thing is that after calibration I get very often different calibration values for ADC1, not really often for ADC2 and rarely for ADC4. Like this:60, 61, 6260, 61, 6261, 61, 6260, 61, 6260, 60, 6261, 61, 6261, 61, 6260, 61, 6260, 61, 62...Calibration is done with HAL function from ST. ADCs are turned of during calibration (ADEN = 0). Vref is external(3v) and it is stable, but I believe that offset calculation during calibration does not really use Vref voltage. Or it does?So I’m a bit confused. Is here some ADC guru of Yoda level?I appreciate any help.
I have an external loader with a starting address of 0xA0000000. I can perform read and write operations with this loader using CubeProgrammer. However, when I define the external loader via CubeIDE, it programs the address 0x080000000. Here is my flash.ld The external loader starts working when I start it with the external loader address 0x00000000, but I want to start with 0xA0000000. How can I fix it ?
Hello everyone,I am trying to built a communication through SPI between two stm32g474 mircontrollers in two seperate projects. One should act as a Master and the other as slave. The Master succesfully reads ADC values out and sends it. But unfortunately, the Slave does not Receive it. Here is my Code for Master:/* 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 file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes -----------
Hello, I am using the RTC wakeup from the power standby example provided in the STM32C5 repository. The example starts the RTC wake-up timer and places the device in standby mode. The device does go to standby, and it does wake up due to the RTC wakeup interrupt; however, the RTC initialization fails after wakeup. It is worth mentioning that the only way I can get rid of this error is to power cycle the board.The failure happens in HAL_RTC_WAKEUP_SetConfig due to RTC_WaitSyncrhroWUTW() returning an error due to RTC_CR_WUTE being set.static hal_status_t RTC_WaitSynchro_WUTW(void) { uint32_t tickstart; if (LL_RTC_IsActiveFlag_INIT() == 0U) { if (LL_RTC_WAKEUP_IsEnabled() == 1U) { return HAL_ERROR; // Code returns this error } tickstart = HAL_GetTick(); while (LL_RTC_IsActiveFlag_WUTW() == 0U) { if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE) { if (LL_RTC_IsActiveFlag_WUTW() == 0U) { return HAL_ERROR; } } } } return HAL_OK; }To make the examp
Hello, I am trying to make the lpuart1+dma_linked_list transferring data in stop1 mode.My setup is like this: SPI1 + GPDMA: // SPI clocked from HSI Start transfer Enter STOP SCK continues toggling DMA continues Transfer completes DMA irq wakes from stopLPUART1 + GPDMA: // LPUART clocked from LSE Start transfer Enter STOP TX line freezes DMA stops progressing Exit STOP TX resumes Both peripherals are using dma in linked list mode in a similar manner.My understanding is that since both peripherals are “autonomous” they should work in a similar way. I have no problem with the SPI1 working during stop1 mode but the LPUART seems to behave differently.This is my LPUART1 init code: void bsp_lpuart_init(void){ bsp_lpuart1_reset_hard(); LL_LPUART_SetPrescaler(LPUART1, LL_LPUART_PRESCALER_DIV1); // Disable before configuration LL_LPUART_Disable(LPUART1); while (LL_LPUART_IsEnabled(LPUART1)); LPUART1->BRR = 3495; //419430 LL_LPUAR
Heyy, I'm using an STM32u545 (on a Nucleo board), and I'm trying to wake up my MCU from stop 2 mode using wake-up pin 2. Wake-up pin 2 is connected to LPTIM3 (via a jumper wire), and LPTIM3 works. Besides trying to wake up the CPU. An LPBAM application is collecting data using the ADC4 and LPDMA with LPTIM1. Also, it does work. But now I don't know how to wake the CPU using LPTIM3. Did I miss something, or is this not the way to go/ is there an easier way to do this? The program should: - read data on a specific frequency - wake up every two seconds to write the data to an SD card (eventually) Thanks in advance :) 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 sys
Hello,I am working with the official USBX CDC ACM example for the NUCLEO-C071RB:https://github.com/STMicroelectronics/STM32CubeC0/tree/main/Projects/NUCLEO-C071RB/Applications/USBX/Ux_Device_CDC_ACMHardware: STM32C071RBT (128 KB Flash, 24 KB RAM)Firmware: STM32Cube FW_C0 V1.4.0Toolchain: STM32CubeIDE 2.1.1The example runs successfully on the NUCLEO-C071RB board. However, after analyzing the RAM usage I am concerned about available headroom for my application.Current RAM usage (from .map file):- .data: 116 B- .bss: 23628 B (including ux_device_byte_pool_buffer: 8192 B, tx_byte_pool_buffer: 1024 B, three RTOS threads: 3x176 B)- ThreadX heap (._threadx_heap in .ld): 4096 B- Stack + Heap: 1536 B- Total: 23744 B- Free: 832 B (out of 24576 B)Current configuration:- UX_DEVICE_APP_MEM_POOL_SIZE = 8192 (app_azure_rtos_config.h)- USBX_DEVICE_MEMORY_STACK_SIZE = 4096 (app_usbx_device.h)- TX_APP_MEM_POOL_SIZE = 1024- ThreadX heap in .ld = 4096 BI need to add additional peripherals (UART, I2C,
I'm seeing a filesystem corruption issue on an STM32H7 when using FatFs with SDMMC DMA. Hardware / Software STM32H7 SDMMC1 DMA (and MDMA support enabled) FatFs generated by CubeMX D-Cache enabled 8 GB Swissbit industrial SD card Generated sd_diskio.c based on: /* Note: code generation based on sd_diskio_dma_rtos_template_bspv1.c v2.1.4 */ ProblemsThe SD card works normally while mounted: Files can be created Data can be written Data can be read back f_write(), f_sync(), and f_close() all return success However, after: Removing and reinserting the SD card, or Power cycling the system the SD card is detected by Windows as:RAW / Unformattedand must be reformatted before it can be used again.Important observationIf I only perform read operations:Mount cardRead filesPower cycle / reinsert cardthe filesystem remains valid. The corruption only occurs after write operations.Initial investigationBecause the STM32H7 uses D-Cache, I initially suspected cache coherency issues.I
Hi,I have developed an application for the STM32C562RET microcontroller that wakes up from standby mode, initially based on an example provided by ST. The non-FreeRTOS version of this application works fine (though there is a minor wake-up issue that is fixable). Subsequently, I created a FreeRTOS version of the same application that starts a task, and when the user presses a button, the vTaskEndScheduler() function is called to terminate FreeRTOS, which in turn calls void vPortEndScheduler(void) where the wake-up code is implemented. void vPortEndScheduler(void) { HAL_RTC_WAKEUP_Start(HAL_RTC_WAKEUP_IT_ENABLE); LL_PWR_ClearFlag_SB(); HAL_PWR_EnterStandbyMode(); } Despite the fact that FreeRTOS is no longer running, the MCU goes to standby and wakes up immediately.Do you have any suggestions on how to make this work?Thanks,-Gil
Hello everyone, I am new to STM32 development and I am working with the STM32H7A3ZIT6 microcontroller. I need to interface it with a BiSS-C encoder/sensor. I would like to know: Is there any ready-made or full BiSS-C communication library available for STM32? Does STM32CubeMX / HAL provide any support for BiSS-C? If no full library is available, what is the recommended way to implement BiSS-C on STM32H7A3ZIT6? Can BiSS-C be implemented using SPI, timer, DMA, or GPIO bit-banging on this MCU? Any example code, application note, or guidance would be very helpful. Thank you.
I set ETH to be working on RMII_PTP_SYNCHRO, However HAL_ETH_USE_PTP is still not defined by default.
I am using the Analog Devices EVAL-ADE9430 Evaluation board for testing one of their devices. The Evaluation board uses the NUCLEO-144 STM32F413ZH processor. I am using the Keil uVision development setup to run and debug code. I am specifically concentrating on the SPI Bus Driver and the timing. I have no previous experience with STM Devices and how the SPI transfers happen in the processor. While walking through the code and following it on my scope to see the SPI Bus timing I am seeing something that does not make sense. The AFERead32BitBuffer() function is called when you read a 32-bit register from the SPI Device which is an Analog Devices ADE9430 Chip (see Below). The code calls HAL_SPI_Transmit() with the number of bytes it needs to transmit (see line 9 below). In this case it is transmitting a two byte command header where bits [15:04] are the register address and bits [3:0] is the R/W command, see example timing below. When
Hello, I hope you are doing well.I am currently working on benchmarking the Ethernet communication interface on an STM32H753 Nucleo board.My setup involves sending data from a Python script to the STM32, where the data is encrypted, and then sent back. This allows me to measure the RTT and overall throughput.I initially used Mongoose, but I encountered several issues:With UDP, I cannot reliably send more than ~1500 bytes, since larger packets get fragmented or dropped.TCP works correctly, but the throughput varies significantly depending on payload size. For example:~2.7 MiB/s for 1400-byte payloads~7 MiB/s for 10240-byte payloadsI would like to know:What is the best networking stack or library for STM32 to achieve better performance and properly handle UDP large payloads?Given that Ethernet is 100 Mbps in my case, I am not reaching near-theoretical throughput even without encryption. Is this because I am measuring not only transmission time but also packet handling, buffering, and pro
Hello,I have been using the hrtim hardware on a prototype board with STM32G474RE and have noticed what might be a possible regression in CubeMX. Purpose:We are a group of students currently trying to develop FOC from scratch for controlling a BLDC-motor, this is a part of a bachelors thesis. As a part of developing the FOC we decided to use six-step commutation to start the motor before the FOC takes over. During the part of developing the commutation we have notice some strange behaviour between cubeMX versions.The problem:We are experiencing signal inversion with V6.17.0 of cubeMX with the exact same files pulled from the git repo. Either the migration fails for some reason or there is some sort of regression when it comes to the the configuration in CubeMX.6.16.1:HRTIM1 with slave-timers A,B,E are configured to output 6 PWM-signals with dead time configuration and complementary mode for CH2 of each timer.The output on the logic analyzer is as expected. It shows a duty cycle of
I am using the Analog Devices EVAL-ADE9430 Evaluation board for testing one of their devices. The Evaluation board uses the NUCLEO-144 STM32F413ZH processor. I am using the Keil uVision development setup to run and debug code. I am specifically concentrating on the SPI Bus Driver and the timing. I have no previous experience with STM Devices and how the SPI transfers happen in the processor. so I apologize a head of time. The Analog Devices ADE9430 uses a a 16-bit CRC (CRC-16-CCITT) and from what I originally read the STM32F413ZH processor supports 32-Bit CRC (CRC-32-CCITT). Diving deeper into the NUCLEO-144 STM32F413ZH processor manual section "29.4.2 CRC calculation" indicates "The SPI offers CRC8 or CRC16 calculation depending on the data format selected through the DFF bit." When the DFF bit (SPI_CR1 bit 11) is 0 it uses CRC8, when the DFF bit is '1' it uses CRC16.https://www.st.com/resource/en/reference_manual/rm0430-s
I am having difficulties with initializing a SD Card.I am making use of the generated code to initialize the card:void MX_SDMMC1_SD_Init(void) I measured with a scope and I am getting 400KHz clock. All the pull-up resistors are correct and voltage is correct.Within the SD_PowerON() function, the function to send the MD8: SEND_IF_COND is called, but I get no response from the card. HAL Error Return is timeout.I tried a differ SD Card as well.Any suggestions where to start checking for potential issues?static uint32_t SD_PowerON(SD_HandleTypeDef *hsd) { __IO uint32_t count = 0U; uint32_t response = 0U; uint32_t validvoltage = 0U; uint32_t errorstate =0U; #if (USE_SD_TRANSCEIVER != 0U) uint32_t tickstart = HAL_GetTick(); #endif /* USE_SD_TRANSCEIVER */ /* CMD0: GO_IDLE_STATE */ errorstate = SDMMC_CmdGoIdleState(hsd->Instance); if (errorstate != HAL_SD_ERROR_NONE) { return errorstate; } /* CMD8: SEND_IF_COND: Command available only on V2.0 cards */ err
Hello everyone,I'm using the stm32G0 USB Host with firmware package V1.6.3.There is an issue with H2D control transfers, where the USB Host stack send a second OUT packet before sending an IN packet on the last packet.I wrote a usb dfu host class that uses USBH_CtlReq.From this picture on the left we can see the PC sending a DNLOAD packet to the stm32h7, first the OUT packet followed by an IN packet.On the right we can see the stm32G0 host sending an OUT packet followed by another OUT packet, before sending an IN packet. The device here is the stm32f4, which for some odd reason allows this (every single stm I tried allows this except h7, tested stm: F4, F7, G0, H5, L5). So my update actually works on every single stm except on the stm32h7.But in the middle picture, the host is still stm32G0, but the device is an stm32h7, which after receiving the second OUT packets NAK's it.From the picture, I would say that the stm32h7 is in the right here. It see that it got an OUT packet, which
Original post: https://community.st.com/t5/stm32-mcus-products/stm32h7-flash-crc/td-p/887279 Github: https://github.com/STMicroelectronics/stm32h7xx-hal-driver/blob/1501be883dae6f202c1d3f856ee6b11407dc257d/Src/stm32h7xx_hal_flash_ex.c#L733 HAL_StatusTypeDef HAL_FLASHEx_ComputeCRC(FLASH_CRCInitTypeDef *pCRCInit, uint32_t *CRC_Result) { ... ... FLASH->CRCCR1 |= FLASH_CRCCR_CLEAN_CRC | pCRCInit->BurstSize | pCRCInit->TypeCRC; ... ... }|= will not program the expected burst size if the reset value is not b00. It looks like on reset the value is b01 (16 flash words). So if user try to set to burst size of 4 flash words (b00) it'll remain set to b01.
I am running the Analog Devices EVAL-ADE9430 board and noticed if I enable CRC checking reading 32 bit registers fail while 16-bit registers always pass. I trace it down to the AFERead16BitBuffer() function not returning a status after reading the register over the SPI bus. This allows 16 bit register reads to work all the time while 32 Bit registers fail all the time (that's another story). See line 12 below: HAL_SPI_Receive(&hSPI, (uint8_t *)&pData[0], 2 * numSamples, SPI_TIMEOUT); uint32_t AFERead16BitBuffer(uint16_t addr, uint16_t numSamples, uint16_t *pData) { int32_t status = SYS_STATUS_SUCCESS; cmdBuffer[0] = (addr >> 4); cmdBuffer[1] = ((addr & 0x0F) << 4) + 8; HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_RESET); status = HAL_SPI_Transmit(&hSPI, (uint8_t *)&cmdBuffer, 2, SPI_TIMEOUT); if (status == 0) { HAL_SPI_Receive(&hSPI, (uint8_t *)&pData[0], 2 * numSamples, SPI_TIMEOUT); } HAL_GPI
Hi everyone,I wanted to share a project I’ve been building over the last few years. It’s called Mk, an operating system built entirely from scratch for the STM32F746G-DISCO and STM32F746G-Eval2 boards.These boards are powered by an ARM Cortex-M7 running at 216MHz. Initially, my goal was just to implement a small scheduler, but I stacked layers one after another to make it as complete as possible. Currently, I think I've added enough layers to claim it as a functional, lightweight OS.Mk features:A KernelPreemptive, priority-based multitasking scheduler (fixed-priority, O(1) selection via hardware CLZ instruction) Trusted Execution Environment (TEE) using the Cortex-M7 MPU (privileged and unprivileged mode isolation) Synchronization primitives: mutex, semaphore, event flags, mailbox Fixed-size memory pools Synchronous and asynchronous callback execution systemA Dynamic ELF Loader Mk can load and execute external .elf binaries at runtime, relocated dynamically into 64 KB pages of the ext
Hello, I am working on I3C private transfers. When I build the context buffer with HAL_I3C_CTRL_BuildTransferCtxPrivate I get an assert when IS_I3C_PRIVATE_MODE is checked against HAL_I3C_PRIVATE_WITH_ARB_RESTART. Is the exclusion of HAL_I3C_PRIVATE_WITH_ARB_RESTART from the macro below intentional? stm32c5xx_hal_i3c.c: line 574 #define IS_I3C_PRIVATE_MODE(MODE) (((MODE) == HAL_I3C_PRIVATE_WITH_ARB_STOP) \ || ((MODE) == HAL_I3C_PRIVATE_WITHOUT_ARB_RESTART) \ || ((MODE) == HAL_I3C_PRIVATE_WITHOUT_ARB_STOP) \ || ((MODE) == HAL_I2C_PRIVATE_WITH_ARB_RESTART) \ || ((MODE) == HAL_I2C_PRIVATE_WITH_ARB_STOP) \ || ((MODE) == HAL_I2C_PRIVATE_WITHOUT_ARB_RESTART) \ || ((MODE) == HAL_I2C_PRIVATE_WITHOUT_ARB_STOP)) Thank you, -Gil
Hello, I am looking for an example of how to use private I3C transfers for STM32C562RE. I read the I3C examples posted on Github but I did not find any controller or target examples that use HAL_I3C_CTRL_Transfer_DMA and HAL_I3C_TGT_Receive_DMA for private transfers using HAL2. Your help would be appreciated,Gil
Recently, I was trying to implement SDMMC+DMA+SDFAT to read and write the SD card of my Class on the STM32H750VBT6. Then I found that the DMA of SDMMC was gone. I saw some online materials saying that MDMA needs to be configured, and some also said that SDMMC does not need to configure DMA as it has its own independent IDMA bus. What is the actual situation when it is directly mounted on AHB? Are there any configuration screenshots and programs of CubeMX for SDMMC+DMA? I'd like to refer to it. Thank you!
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.