Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi Team,Currently I am working with FreeRTOS Timers and callback is not firing always.Please note that timer is creating and main application is calling after once osKernelInitialize(); is done. Above are configurations in FreeRTOSConfig.h. Please give a solution why Callback is not firing ? Thanks and Regards,Ramesh osTimerId_t FreertosTimerHandle; const osTimerAttr_t FreertosTimer_attr = { .name = "FreertosTimer_LED" }; void RPS_print_console_Thread(void *argument) { /* Initialize watchdog Timer */ IWDG_Init(); StartLEDTimer(); while(1) { /* Refresh watchdog periodically */ IWDG_Refresh(); } } void StartLEDTimer(void) { FreertosTimerHandle = osTimerNew(Fire_LED_Toggle, osTimerOnce, NULL, &FreertosTimer_attr); if (FreertosTimerHandle != NULL) { if (osTimerStart(FreertosTimerHandle, 5000) == osOK) { printf("LED timer started\n"); } else { printf("Failed to start LED timer\n"); } } else { printf("Failed to create LED timer\n"); } } void Fire_LE
Hi, I am trying to jump into system bootloader but board is not getting detected in USB DFU on STM32CubeProgrammer. I tried below two methods:1) By connecting Boot0 pin to HIGH and resetting the board and tried connecting on STM32CubeProgrammer.2) By Jumping to system Bootloader start address from application.In the second method I tried setting option bits manually in software and board got connected in USB DFU for one or two times only.Let me know how can I jump to system bootloader and do application reprogramming.Thanks,Vishwanath Devara
I am using STM32H573 and I have tried to enable PVD some what like this:void PVD_Init() { PWR_PVDTypeDef pvdconfig; HAL_NVIC_SetPriority(PVD_AVD_IRQn, 5, 0); HAL_NVIC_EnableIRQ(PVD_AVD_IRQn); pvdconfig.Mode = PWR_PVD_MODE_IT_RISING_FALLING; pvdconfig.PVDLevel = PWR_PVDLEVEL_7; HAL_PWR_ConfigPVD(&pvdconfig); HAL_PWR_EnablePVD(); } void HAL_PWR_PVDCallback() { // HAL_GPIO_WritePin(GPIOC, LED_1_Pin, GPIO_PIN_SET); printf("\rBefore RESET COUNT: %.2f\n", counter); EEPROM_Write_NUM(0, 0, counter); }Someone might say to enable the clock but for this module I don't think we need to manually enable the clock. I have looked into it and am pretty sure about it. If anyone else have some other theories please let me know. Also made sure that EXTI 16 is connected internally.
Hella All, While working with the STM32H533RE microcontroller and using VS Code with PlatformIO for debugging, I noticed that the SCB (System Control Block) peripheral definitions appear to be missing from the SVD file. The SCB is a critical ARM Cortex-M33 core peripheral that should include registers such as:CPUID (CPU ID Base Register) - 0xE000ED00ICSR (Interrupt Control and State Register) - 0xE000ED04VTOR (Vector Table Offset Register) - 0xE000ED08AIRCR (Application Interrupt and Reset Control Register) - 0xE000ED0CSCR (System Control Register) - 0xE000ED10CCR (Configuration and Control Register) - 0xE000ED14And other SCB registers in the 0xE000E000-0xE000EFFF address range The missing SCB definitions limit our ability to:Monitor system control registers during debuggingAnalyze interrupt and exception behaviorDebug power management and system configuration issuesPerform comprehensive system-level debugging I would greatly appreciate your assistance in
Hi All,I’m working on a project with the STM32U5G9ZJT6, where I’ve implemented a bootloader in internal flash at 0x08000000. The application is stored in external OctoSPI NOR flash (MX66LM1G45G), which is memory-mapped to address 0xA0000000 using Octal STR mode.I'm flashing the application binary into external flash using an external loader (.stldr) via STM32CubeIDE.Although the application is successfully stored in external flash, when I try to execute it via memory-mapped mode, it fails (shows “Target Failed” or halts). I’m not sure whether it’s due to memory mapping, stack configuration, MPU, or something else.Could someone guide me on the correct procedure or help me troubleshoot this issue? What I’ve Done So Far:Bootloader:Configured OSPI (HSPI1 / OCTOSPI2) to enable memory-mapped mode using MX66LM1G45G_EnableSTRMemoryMappedMode().Verified that data can be read from 0xA0000000.Read the initial MSP and Reset_Handler from external flash:uint32_t app_msp = *(uint32_t*)0xA0000000
Hi all Do you have any SPi protocol example for stm32f407VGTx board . B.R Ash
IDE : STM32CubeIDE Version: 1.16.1Board : STM32F407VG DISC1SYS Timebase Source : TIM6 Hello,In my project, i use I2C and multiple UARTs. It worked fine before adding FreeRTOS tasks. Recently i need add buttons to my project, so i add a new task to handle interrupts. To synchonize my EXIT ISR (callback) and the button handling task, a binary semaphore is adpoted. Strange things happened, after creating a binary semaphore with xSemaphoreCreateBinary(), all I/Os, I2C and UARTs, are failed. Even HAL_Delay() did not work, bebugger died in HAL_GetTick() in HAL_Delay. all abnormalities happened before starting FreeRTOS kernel and initializing tasks. Commenting the xSemaphoreCreateBinary() system is back to normal. Can someone tell me what causes the problem.
i have created a USBx ramdisk which enumerates with windows and a usb disk is shown. when i look at the properties it is 0bytes in size and wont let me format it.if ULONG USBD_STORAGE_GetMediaLastLba(VOID) and USBD_STORAGE_GetMediaBlocklength are set to0 the USB will enumerates. if they are any other size then the USB wont enumerate. i have attched the design. Any pointers would be great. i will eventually be adding an external SD card inthe design. but just want to get the ramdisk working first.
Hello everyone,I'm a beginner learning STM32 and working on a small project with the STM32H755 (NUCLEO-H755ZI-Q). I'm trying to use an EXTI interrupt on PA0 (push button) to toggle an LED on PB0 on the Cortex-M7 (CM7) core. I need help to figure out what's wrong!Thanks a lot!
I am currently using STM32H723 MCU for a project. I want to use PTP to synchronise different peripherals that will send data and their timings need to be precisely synchronised. The reference manual has got a whole section for programming IEEE 1588 timestamping. But going through the different files that implement the ethernet driver, I found this comment: -@- The PTP protocol offload APIs are not supported in this driver. The offload feature is most vital to me. I am wondering whether that is an old message or if this driver still doesn't support hardware timestamping. Has anyone have luck with this??
Hello,I am currently working on a bootloader code. I successfully managed to execute the app code by copying to the RAM address (0x20000000). However, whenever I try to copy the app code to SDRAM (0xC0000000) instead of RAM, bootloader never executes the app code. In the linker script file of my app, I follow the same process with the "RAM Version" of the code: I used SDRAM address for all sectors (.data, .text, .bss...). My jump code is basically like: uint32_t app_sp = *((volatile uint32_t*)APP_SDRAM_ADDRESS); uint32_t app_pc = *((volatile uint32_t*)(APP_SDRAM_ADDRESS + 4)); SCB->VTOR = APP_SDRAM_ADDRESS; __set_MSP(app_sp); ((void (*)(void))app_pc)(); Thanks.
osTimerId_t FreertosTimerHandle; const osTimerAttr_t FreertosTimer_attr = { .name = "FreertosTimer_LED" }; void RPS_print_console_Thread(void *argument) { /* Initialize watchdog Timer */ IWDG_Init(); StartLEDTimer(); while(1) { /* Refresh watchdog periodically */ IWDG_Refresh(); } } void StartLEDTimer(void) { FreertosTimerHandle = osTimerNew(Fire_LED_Toggle, osTimerOnce, NULL, &FreertosTimer_attr); if (FreertosTimerHandle != NULL) { if (osTimerStart(FreertosTimerHandle, 5000) == osOK) { printf("LED timer started\n"); } else { printf("Failed to start LED timer\n"); } } else { printf("Failed to create LED timer\n"); } } void Fire_LED_Toggle(void *argument) { printf("Timer callback fired!\n"); HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, SET); HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, SET); HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, SET); HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, SET); }
Friends, which algorithm do you use to control the LEDs in this structure? I need your ideas. I have prepared a table of the LEDs' turn on order.
Hello,I'm working on an adapter USB to Ethernet and it is working only as a DEVICE. Now I would like to do the same but I want my STM to work as HOST.Is ST providing the same code stm32-mw-usb-device but for host?Thanks,G.
Dear ST, After signing the NDA agreement, I received STM32CubeExpansion_STL_G0_V2.0.0. I tried testing the projects for NUCLEO-G071RB in STM32CubeIDE 1.14.1, but to no avail. Edit: Removed screenshots as package is under NDA. After importing the projects: Edit: Removed screenshots as package is under NDA. When I compile, I get the following error: Edit: Removed screenshots as package is under NDA. Any suggestions?
HelloI have two boards. Both of them are based on STM32 MCUs. One is a SPI master and the second is a SPI slave.Settings for master (STM32H723): mHandle.Init.Mode = SPI_MODE_MASTER; mHandle.Init.Direction = SPI_DIRECTION_2LINES; mHandle.Init.DataSize = SPI_DATASIZE_8BIT; mHandle.Init.CLKPolarity = mSclIdle == SclIdle::kLow ? SPI_POLARITY_LOW : SPI_POLARITY_HIGH; mHandle.Init.CLKPhase = mSclEdge == SclEdge::k1 ? SPI_PHASE_1EDGE : SPI_PHASE_2EDGE; mHandle.Init.BaudRatePrescaler = mPrescaler; mHandle.Init.FirstBit = SPI_FIRSTBIT_MSB; mHandle.Init.TIMode = SPI_TIMODE_DISABLE; mHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; mHandle.Init.CRCPolynomial = 0x00; mHandle.Init.NSS = SPI_NSS_SOFT; mHandle.Init.NSSPMode = SPI_NSS_PULSE_DISABLE; mHandle.Init.NSSPolarity = SPI_NSS_POLARITY_LOW; mHandle.Init.FifoThreshold = SPI_FIFO_THRESHOLD_01DATA; mHandle.Init.TxCRCInitializationPattern = SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN; mHandle.Init.RxCRCInitializationPattern = SPI
Hi,I have a STM32U535 microcontroller, I would like to send data to the display via SPI using GPDMA with LLI. The Frame buffer is about 150kB, so due to the fact that in a single transfer I can send max. 64kB of data, I want to divide it into three LLI nodes create a queue and send via SPI.For the test, I created two LLI nodes in CubeMX:DMA_NodeTypeDef YourNodeName; DMA_QListTypeDef YourQueueName; DMA_NodeTypeDef YourNodeName2; /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ uint8_t ScrAdrPart1[] = {0xAD, 0xAD,0xAD,0xAD,0xAD,0xAD,0xAD,0xAD,0xAD,0xAD,0xAD,0xAD,0xAD,0xAD, 0xAD,0xAD,0xAD,0xAD,0xAD,0xAD}; uint16_t DataSizePart1 = 20; uint8_t ScrAdrPart2[] = {0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x
Hello ST Community,I'm working on a project using STM32U595 with INMP441 MEMS microphone and NS4168 audio DAC. The system is configured to capture audio data from the microphone using SAI1_Block_A in DMA mode and then output it to the speaker using SAI1_Block_B.Issue:I've implemented the SAI RX half-complete and complete callbacks, but they are never triggered. I've added printf statements to display the received data, but nothing is being printed. The DAC seems to be initialized correctly (NS4168_INIT() returns without error), but no audio data is being processed. Code:/* USER CODE BEGIN Header */ /** ****************************************************************************** * File Name : SAI.c * Description : This file provides code for the configuration * of the SAI instances. ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All rights reserved. * * This so
Hi, all.I'm using STM32H747I-DISCO.I tried STemWinHelloWorld example, and "Hello world!" string was displayed on LCD properly.I added EXTI IRQ. And I confirmed when EXTI IRQ occur, it went to EXTI15_10_IRQHandler.Then I added proccess that display "How are you?" string in EXTI15_10_IRQHandler, as shown below.void EXTI15_10_IRQHandler(void) { /* USER CODE BEGIN EXTI15_10_IRQn 0 */ /* USER CODE END EXTI15_10_IRQn 0 */ HAL_GPIO_EXTI_IRQHandler(GpioInt_Pin); /* USER CODE BEGIN EXTI15_10_IRQn 1 */ GUI_DispStringAt("How are you?", (LCD_GetXSize()-100)/2, (LCD_GetYSize()-20)/4); /* USER CODE END EXTI15_10_IRQn 1 */ }But when EXTI IRQ occur, "How are you?" string was not displayed on LCD, although it go to EXTI15_10_IRQHandler.And I confirmed below action.I added proccess that display "Fine!" string in MainTask() followed by GUI_Delay(1000), as shown below.void MainTask(void) { GUI_Clear(); GUI_SetFont(&GUI_Font32_1); GUI_DispSt
Did you come to a conclusion on this approach? I am having the exact same dilemma. There is an approach to do it through TF-M, but then how is the support from ST on that part? https://github.com/zephyrproject-rtos/trusted-firmware-m/tree/release/2.2.x Again, I want to emphasize on what is available from ST and not compare it to nRF. This way I can decide which approach to take for the secure boot solution on STM32U5. @Sarra.S Edit: Moved from mcuboot bootloader update.
I am attempting to transmit four bytes via I2C to a device with address 0x27, using the code below.data_t[0] = 0x01; data_t[1] = 0x02; data_t[2] = 0x04; data_t[3] = 0x08; HAL_I2C_Master_Transmit (&hi2c4, 0x27U,(uint8_t *) data_t, 4, 100);My understanding is that the structure of an I2C message is7 bit addr | R/W bit = 0 (for write) | DataThe address is 0x27 = 0b0100111The RW bit is 0 for WSo the header byte is then 0b01001110 = 0x4ESo I would expect one of two possible things to happen when I use this command. EitherEach byte is separate and preceded by the address byte. Then 8 bytes will be clocked out to the I2C bus[0x4E],[0x01],[0x4E],[0x02],[0x4E],[0x04],[0x4E],[0x08]Or there is one address byte, followed by 4 bytes of data. Then 5 bytes will be clocked out[0x4E],[0x01],[0x02],[0x04],[0x08]What I actually see on the logic analyser below. So there is 5 bytes, which is something I would have expected, but it seems to be just repeating the address each time, and never actually wri
Hi,I'm currently working on STM32H733 MCU powered by Azure RTOS (Threadx + NetxDuo), My application is divided into two parts: custom bootloader[For Firmware Updates] and application[Business logic Implementation]. I was able to update the application from the bootloader. After a successful download of the application, the bootloader Soft Resets the device. The device boots into the bootloader again and checks if there is a valid application, then jumps to the application.Everything was working as expected until I updated ld file(to move .tcp_sec and .nx_data sections to start of D1_RAM) from .tcp_sec (NOLOAD) : { . = ABSOLUTE(0x24036C00); *(.RxDescripSection) . = ABSOLUTE(0x24036C60); *(.TxDescripSection) } >RAM_D1 AT> FLASH .nx_data 0x24000100 (NOLOAD): { . = ABSOLUTE(0x24036D00); *(.NetXPoolSection) } >RAM_D1 AT >FLASHto ... .tcp_sec (NOLOAD) : { . = ABSOLUTE(0x24000000); *(.RxDescripSection) . = ABSOLUTE(0x24000060); *(.TxDescripSection) } >RAM_D1 A
I get errors in many of the headers files in the Drivers, for: unknown type name 'HAL_StatusTypeDef'. All of these files include the file with definitions, in my case #include "stm32u5xx_hal_def.h", so I do not understand why it is a problem to find. I have all necessary include paths. When I searched on the internet I see that others had the same issue but did not get any good solution. Do you have any tips why it happens and how can I solve it?Thanks in advance!
Hi Master:Platform: STM32H743HAL library firmware: STM32Cube FW_H7 V1.12.1Question:As shown in the following code, it takes a long time to update 'sTime', perhaps a few minutes. RTC_TimeTypeDef sTime = { 0 }; RTC_DateTypeDef sDate = { 0 }; ASSERT(HAL_RTC_GetDate(&hrtc, &sDate, RTC_FORMAT_BIN) == HAL_OK); ASSERT(HAL_RTC_GetTime(&hrtc, &sTime, RTC_FORMAT_BIN) == HAL_OK); But when I switch the order of execution, it is updated every secondRTC_TimeTypeDef sTime = { 0 }; RTC_DateTypeDef sDate = { 0 }; ASSERT2(HAL_RTC_GetTime(&hrtc, &sTime, RTC_FORMAT_BIN) == HAL_OK); ASSERT2(HAL_RTC_GetDate(&hrtc, &sDate, RTC_FORMAT_BIN) == HAL_OK);What is the reason for this? Thank you so much
Hello all, I am trying to compile STM32F7xx_HAL_Driver using gcc toolchain in mingw. I am trying to build the example project GPIO_EXTI for the STM32F746ZG-Nucleo. Here's a snip of my console output: Would appreciate any help!
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.