Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I am working on SDRAM execution using FMC on STM32H563ZI (NUCLEO-H563ZI board) with external SDRAM connected through FMC interface. Our target is: Execute application sections from SDRAM Place heap and stack in SDRAM Enable automatic scatter-loading/copy from internal flash to SDRAM during startup We are facing an issue where: SDRAM initialization appears successful Manual SDRAM read/write access works in application runtime But automatic copy/scatter-loading from Flash to SDRAM during startup is failing Application execution from SDRAM is unstable and leads to HardFault/reset handler Below are the detailed steps and observations. CURRENT STARTUP FLOW Reset_Handler→ SystemInit()→ PLL/System clock configuration→ FMC GPIO configuration→ FMC SDRAM initialization→ SDRAM command sequence→ __main()→ scatter loading→ main() We intentionally moved FMC/SDRAM initialization into SystemInit() so that SDRAM becomes available before scatter loading. CLOCK CONFIGURATION We configured P
Hello everyone! I have a problem with reterning ticks in line "measure_speed_rpm = speed_reference / LL_TIM_GetCounter(TIM2);". speed_reference is const variable and equals 15000000. When I looked at Serial Monitor, it's indicated: (picture)That's mean that LL_TIM_GetCounter(TIM2) returns '1' sometimes. Nothing in my code not calling void EXTI1_IRQHandler(void), except EXTI Interrupt. And the main question is - Why it reterns only '1'??? Not 2,3 e.t.c.Thank you for help! void EXTI1_IRQHandler(void) { if (LL_EXTI_IsActiveFlag_0_31(LL_EXTI_LINE_1)) { LL_EXTI_ClearFlag_0_31(LL_EXTI_LINE_1); static uint8_t edge_switch = 0; if (!edge_switch) { edge_switch = 1; LL_TIM_SetCounter(TIM2, 0); } else { edge_switch = 0; measure_speed_rpm = speed_reference / LL_TIM_GetCounter(TIM2); NVIC_SetPendingIRQ(SPI1_IRQn); // SPI1_IRQHandler is free vector in list, that's why I use it for PID update trigger } uint8_t hall_index = HALL_Read(); SixStep_SetPhas
Hi Community, I'm a new Developer/ for ST Microcontrollers, Now Im currently using STM32H723ZGT6 (NUCLEO - 144). Im currently working on ethernet (LWIP), the ping is not working for this code that i have generated . I have seen some youtube channels but I cant rectify and make the ping, I have tried all the possible things like , flash linker script , enabling ICache , Dcache , using MPU(Memory Protection Unit), change them to static ip for both board and my PC and So on . I have tried but I dont know whether my code or my implementation is correct or not . Can anybody help me with this ?.. I have attached the file thats my code and how project. pls have a look into that. Thank You.
Hello STM32 Community,I am developing a system on the NUCLEO-N657X0-Q using ThreadX and NetX Duo and I am having a hard time to make the ethernet work. I want to implement a web server in my system but I cannot make the Ethernet communicate.Problem:I am unable to receive or transmit any Ethernet frames. The PHY link establishes successfully (from what I see on my linux terminal, autonegotiation completes, Link is UP, and the LEDs on the plug turns on normally), but pinging the Nucleo's static IP yields no response. Wireshark shows no ARP or ICMP packets originating from the Nucleo.Trying to debug, I see that the the MAC/DMA interrupt `ETH1_IRQHandler` is never triggered by incoming network traffic. It fires exactly twice during the initial board boot sequence(where, for what I understand, some DMA errors flag are raised), but remains completely silent afterward. From the logs that I send to the serial port it appears that from the NetXDuo point of view is everything fine.The D-cache is
Split from this thread My firmware is based on this ccid usbd driver https://github.com/STMicroelectronics/stm32-mw-usb-device/blob/master/Class/CCID/Src/usbd_ccid.c . The issue that I face, the PC finishes receiving data immediately after receiving 256 bytes (10 bytes of header + 246 bytes of data). when I want to send to pc 253 bytes of data + 10 bytes of header (263 bytes in total) by splitting (64 bytes by 64 bytes) the PC finishes receiving data immediately after receiving the fourth chunk which is 256 bytes (10 bytes of header and 243 bytes of data), It doesn't wait for the fifth chunk, which carries the remaining 7 bytes of my data which arrives in an unknown message despite the fact that I define the size of the data to be sent as 253 bytes. Images 1 and 2 show these details captured by wireshark software.12 this is my code used to send data by chunks : uint8_t SC_Itf_XferBlock(uint8_t *ptrBlock, uint32_t blockLen, uint16_t expectedLen, USBD_CCID_BulkIn_DataTyp
Environment:- MCU: STM32H743IITx- USB PHY: USB3300 (ULPI, external HS PHY)- HAL version: STM32CubeH7 v1.11.6- Mode: USB Host, HS, ISOC transfer (UVC camera)- HFIR: 7500 (manually set for 60MHz PHY clock)Problem:HPRT.PENA is cleared by hardware at exactly HFNUM=16383 (14-bit framecounter maximum, about to roll over to 0). HPRT value at the moment ofHAL_HCD_PortDisabled_Callback: 0x00001409.Key observations:1. PCSTS=1 at the time of the event — device is still physically connected2. This happens 100% reproducibly at frame 16383, never at any other frame3. Without SDRAM (FMC) and LTDC active, the issue does not occur for 1.5+ hours4. With SDRAM only: occurs after ~7 minutes5. With SDRAM + LTDC (framebuffer in SDRAM): occurs within seconds6. Temporarily shorting USB3300 VCC to GND with a probe (adding bypasscapacitance) eliminated the issue for 50+ minutes — suggesting powersupply noise is a contributing factor, but the frame=16383 correlationis too precise to be purely noise-drivenQuestio
Hello! I am encountering some issues when trying to run 2-Lane DSI with an STM32H747.Current Hardware Configuration:MCU: STM32H747 (using the Cortex-M7 core)Display Driver: Chipone CO5300 OLED Display DriverDisplay Panel: Round TOH143XRT-01CG2 1.43" 466×466 AMOLEDInterface: MIPI DSI (adapted command mode) Issue I am experiencing:I have successfully implemented 1-lane DSI communication between the STM32H747 and CO5300 display driver. However, when I configure both the STM32 DSI host and CO5300 for 2-lane operation, the display is not responsive (black screen / nothing being displayed) The display pipeline works as follows:DMA2D → Performs 2D graphics operations and copies framebuffer data to SRAMLTDC → Reads framebuffer from memory, performs layer blending, generates parallel RGB pixel stream (HSYNC, VSYNC, DE, pixel clock, RGB data)DSI Wrapper → Converts LTDC parallel RGB stream into a format suitable for DSI hostDSI Host → Packetizes pixel data into MIPI DSI packets, seriali
Hi,I have a DMA2D issue with a STM32N6 Nucleo-144 board. I can use the DMA2D to blend two framebuffers if the inputs are in the AXISRAM1. However, when one of the framebuffers is in AXISRAM3 (NPU RAM), the DMA2D doesn't copy from the relevant framebuffer. There is no error, but the output is invalid.I can copy to the AXISRAM3 using HPDMA without any issue. I have configured the RISAF4/5/6; otherwise, I am unable to copy to AXISRAM3. This is the code to configure RISAF4/5/6 (NPU RAMs): __HAL_RCC_RISAF_CLK_ENABLE(); RISAF4->REG[0].CFGR = 0x00000000; RISAF4->REG[1].CFGR = 0x00000000; RISAF4->REG[0].CIDCFGR = 0x000F000F; /* RW for everyone */ RISAF4->REG[0].ENDR = 0xFFFFFFFF; /* all-encompassing */ RISAF4->REG[0].CFGR = 0x00000101; /* enabled, secure, unprivileged for everyone */ RISAF4->REG[1].CIDCFGR = 0x00FF00FF; /* RW for everyone */ RISAF4->REG[1].ENDR = 0xFFFFFFFF; /* all-encompassing */ RISAF4->REG[1].CFGR = 0x00000001; /* enabled, non-secu
Hi all,I am trying to develop a bootloader software for STM32F765.I requires two features in it.1) jumping from Bootloader to Application2) jumping from Application to BootloaderI could make jump from Bootloader to Application very easily.But I am suffering with jumping from Application to Bootloader for 4-5 days now.The final code I tried is given below:void Bootloader_JumpToBootloader_Program(void) { void (*app_reset_handler)(void); __disable_irq(); SysTick->CTRL = 0 ; SysTick->LOAD = 0; SysTick->VAL = 0; HAL_RCC_DeInit(); HAL_DeInit(); /* 2) disable all enabled interrupts */ NVIC->ICER[ 0 ] = 0xFFFFFFFF ; NVIC->ICER[ 1 ] = 0xFFFFFFFF ; NVIC->ICER[ 2 ] = 0xFFFFFFFF ; NVIC->ICER[ 3 ] = 0xFFFFFFFF ; NVIC->ICER[ 4 ] = 0xFFFFFFFF ; NVIC->ICER[ 5 ] = 0xFFFFFFFF ; NVIC->ICER[ 6 ] = 0xFFFFFFFF ; NVIC->ICER[ 7 ] = 0xFFFFFFFF ; NVIC->ICPR[ 0 ] = 0xFFFFFFFF ; NVIC->ICPR[ 1 ] = 0xFFFFFFFF ; NVIC->ICPR[ 2 ] = 0xFFFFFFFF ; NVIC->ICPR[ 3 ]
Hi i have a board with STM32F4 and an EMMC. And I am using FATFS. I managed to enable the STM32 RTC and added the necessary code in get_fattime(); There is one problem stil: under windows "created" and "modified" date are shown corerctly. But "accessed" date is wrong. See attached image. Any clue what is going wrong? Thx
Dear all,I think I have discovered a bug in the CMSIS headers supplied for the STM32H7RSx and STM32H7x MCUs.In "Drivers/CMSIS/Device/ST/STM32H7RSxx/Include/stm32h7rsxx.h", there are definitions for ATOMIC_SET_BIT() and ATOMIC_CLEAR_BIT() among others, see https://github.com/STMicroelectronics/cmsis-device-h7rs/blob/7e6e213ddc397c76622a0aca2f623ccc3b34c010/Include/stm32h7rsxx.h#L162:/* Use of CMSIS compiler intrinsics for register exclusive access */ /* Atomic 32-bit register access macro to set one or several bits */ #define ATOMIC_SET_BIT(REG, BIT) \ do { \ uint32_t val; \ do { \ val = __LDREXW((__IO uint32_t *)&(REG)) | (BIT); \ } while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \ } while(0)and the "register" in the description and the '__IO' qualifier in the code hint that this can be used for peripheral registers. This suspicion is correct, e.g., see https://github.com/STMicroelectronics/stm32h7rsxx-hal-driver/blob/1bde483bc7ab4883c2ef643e5a16ad6b303a631f/S
In the code examples provided with AN4502, this pattern is used often: while ( STACK_SMBUS_IsReady(pcontext) != SMBUS_SMS_READY) { } But in our code, when built with the Release CMake preset, this hangs forever.My understanding is that this is because the `StateMachine` member of the SMBus context struct (SMBUS_StackHandleTypeDef) is getting updated by the SMBUS interrupt handlers, but it isn't marked volatile: * @brief Stack state machine handling structure - the stack operation context */ typedef struct { uint32_t StateMachine; /*!< Keeps track of current stack state */ SMBUS_HandleTypeDef *Device; /*!< HAL driver handle */ uint8_t *ARP_UDID; /*!< A UDID used in ARP */ st_command_t *CurrentCommand; /*!< NULL, unless a command is being processed */ st_command_t *CMD_table; /*!< Pointer to first record in the table of all supported commands */ uint32_t CMD_tableSize; /*!< The supported commands table size */ #ifdef PMBUS13 SMBUS_ZoneStateTyp
Hi, I would like to use MDMA to get values from ADC. I have one adc set with 6 channels, starting conversion with timer (100µs). So I would like to save in memory adc values like that : val1, val2, val3, val4, val5, val6 -> val1(100µs),val1(200µs)...val1(1000µs),val2(100µs),val2(200µs)...val2(1000µs)...val6(1000µs) the destination memory is 60 values of 16 bits. That means I would like to be interrupted every 1ms by MDMA. So I use this configuration (at beginning I would like to test only 2 first values val1 and val2): this is the code to initialize MDMA MDMA_HandleTypeDef hmdma_mdma_channel0_dma1_stream2_tc_0; MDMA_LinkNodeTypeDef node_mdma_channel0_dma1_stream2_tc_1; /** * Enable MDMA controller clock * Configure MDMA for global transfers * hmdma_mdma_channel0_dma1_stream2_tc_0 * node_mdma_channel0_dma1_stream2_tc_1 */ void MX_MDMA_Init(void) { /* MDMA controller clock enable */ __HAL_RCC_MDMA_CLK_ENABLE(); /* Local variables */ MDMA_LinkNodeConfTypeDef nodeConfig; /*
I'm using an STM32G431 with FreeRTOS. I have a total of 5 tasks, including the default task, and all of them were set to osPriorityLow. With this configuration, the tasks did not run properly. When creating the tasks, NULL was not returned and no error occurred. After changing all task priorities to osPriorityNormal, the problem was fixed. I don't really understand why this happens. Each task has a reasonable osDelay(), so I don't think any specific task is blocking the others. Also, if a task were blocking, I would expect the same problem to happen even after changing the priority. I also tried changing the heap size and the stack size, but that did not seem to be the cause. Has anyone experienced a similar issue, or does anyone know why changing all tasks from osPriorityLow to osPriorityNormal would make a difference?
MCU STM32H503KBU internal clock 64 MHz During a UART restart,the HAL_UART_Init function callsHAL_RCCEx_PeriphCLKConfig, which results in a HardFault_Handler void UART_Set_BaudRate(UART_HandleTypeDef *huart, uint32_t BaudRate) { if (HAL_UART_DeInit(huart)!= HAL_OK) { Error_Handler(); } huart->Instance = USART1; huart->Init.BaudRate = BaudRate; huart->Init.WordLength = UART_WORDLENGTH_8B; huart->Init.StopBits = UART_STOPBITS_1; huart->Init.Parity = UART_PARITY_NONE; huart->Init.Mode = UART_MODE_TX_RX; huart->Init.HwFlowCtl = UART_HWCONTROL_NONE; huart->Init.OverSampling = UART_OVERSAMPLING_16; huart->Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; huart->Init.ClockPrescaler = UART_PRESCALER_DIV1; huart->AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; if (HAL_UART_Init(huart) != HAL_OK) { Error_Handler(); } if (HAL_UART_Receive_IT( OW.huart, &uart_temp, 1) != HAL_OK) Error_Handler(); } If y
I'm currently developing an external loader on STM32H563ZIT6 development board.I'm facing an issue on programming with cube programmer in the image belowThe problem I think might be linked to interrupt handler of systick. I've attached the Loader_src.c file where I had developed the functions used by Cube Programmer; also attached the linker used. The low level functions linked to XSPI communication are properly working, because I had tested in debug erasing and writing sectors. I need help to figure out the problem.
hello,I encountered a problem while developing for stm32u585. When the stm32 wakes up from standby mode, the HAL_RCC_OscConfig() function occasionally fails, "Wait till LSI is disabled" timeout in HAL_RCC_OscConfig() (this project uses IWDG)The specific process is as follows:1. start boot HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_ICACHE_Init(); MX_UART4_Init(); boot to other address(app) 2. app init HAL_Init(); SystemClock_Config(); RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48|RCC_OSCILLATORTYPE_LSI |RCC_OSCILLATORTYPE_HSE|RCC_OSCILLATORTYPE_LSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.LSEState = RCC_LSE_ON_RTC_ONLY; RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; RCC_OscInitStruct.LSIState = RCC_LSI_ON; RCC_OscInitStruct.LSIDiv = RCC_LSI_DIV128; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLMBOOST = RCC_PLLMBOOST_DIV1; RCC_OscInitStruct.PLL.PLLM = 1
If the user uses "-Wundef" the header "stm32u3xx_hal_def.h" creates a lot of warnings due to a missing check if a preprocessor macro is defined before evaluating it.The warning gets emmited by the following #ifs used in STM32Cube FW_U3 V1.3.0 inside "stm32u3xx_hal_def.h":#if defined ( __CC_ARM ) || ((__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined ( __GNUC__ )e.g. in line 142This is how it was correctly checked in e.g. the STM32Cube FW_G0 V1.6.3 in the hal def header for the stm32g0 hal:#if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) Best Regards
Environment:Board: STM32H7S78-DKMCU: STM32H7S7L8H6Stack: AzureRTOS USBX (PIMA MTP + CDC ACM) + FileX.Storage: microSD Card.Host OS: Windows 11 Preliminary Note:A significant portion of this code is adapted from the official ST example:stm32-usbx-examples/Projects/STM32H735G-DK/Applications/USBX/Ux_Device_PIMA_MTP at main · STMicroelectronics/stm32-usbx-examples Current Status:I have successfully implemented the MTP class. The device is correctly recognized by Windows, the storage is mounted, and I can view and modify files located in the root directory.To manage MTP objects, I use a custom function SD_Scan, which traverses the FileX filesystem and builds a local object handle table (ObjectHandleTypeDef).VOID SD_Scan(VOID) { /* Estructura estática para no usar el STACK */ static FolderList_t folder_list[SD_MAX_HANDLES]; /* Variables de control de la cola con nombres claros */ UINT NextFolderToScan = 0; UINT TotalFoldersInList = 0; /* Variables de es
Hello,I want to generate an arbitrary waveform by a timer using DMA. The waveform is using different pulse widths and also varying periods in multiples of 25µs.By reading AN4776 and HAL documentation I figured out it should be possible with HAL_TIM_DMABurst_MultiWriteStart() function. Unfortunately I don't get an output signal except after reset where a short pulse can be seen. I assume this pulse is due to port configuration during initialization. After that pulse, the signal stays high.My setup (CubeMX):Nucleo32-L432, core clock 80MHzUsed timer is Tim16Prescaler is set to 399 => 80 MHz / 400 = 5µs resolutionARR and CCR preload enabledARR and CCR set to 0 (initialized in source code)DMA enablednormal modememory to peripheralWord / Wordincrement address on memoryinterrupt enabledFor a first run I want to use fixed pulse widths and varying periods, so all my code does is the following:/* USER CODE BEGIN 2 */ htim16.Instance->ARR = 39; //40 * 5µs = 200µs period htim16.Instance
Here is the config:mcu stm32h743iit6flash 4 lines 1 bank 32mb W25Q256JVsdram 32mb W9825G6KHhere is the flow 1 read image background from qspi 2 decode image with axi sram at #define JPEG_WORKSPACE_BASE 0x24040000 // AXI SRAM (fast) #define JPEG_WORKSPACE_SIZE (256 * 1024) // 512KB (up from 256KB)3 copy buffer to external sdram4 dma2d copy and display image . scenario1 is ok LIBJPEG_DecodeToBuffer((uint32_t)IMG_NEW6, IMG_NEW6_SIZE, (uint32_t*)DECODE_BUFFER1); uint32_t decode_time = HAL_GetTick() - start; printf("✅ JPEG decode: %lu ms\n", decode_time); // Test 3: Display the image start = HAL_GetTick(); //Display_ImageAt_Fast((uint32_t*)DECODE_BUFFER1, 1024, 600, 0, 0); Display_ImageAt((uint32_t*)DECODE_BUFFER1, 1024, 600, 0, 0); HAL_Delay(4000); Clear_SDRAM(); LIBJPEG_DecodeToBuffer((uint32_t)IMG_NEW8, IMG_NEW8_SIZE, (uint32_t*)DECODE_BUFFER3); // uint32_t decode_time = HAL_GetTick() - start; printf("✅ JPEG decode: %lu ms\n", decode_tim
Hello,I am currently working on a simple USB Power Delivery test project using the STM32G071C8.The system has two USB Type-C ports.I need to detect PDO information and eMarker capabilities in order to determine the appropriate power delivery behavior. However, eMarker detection requires VDM-related functionality, and I could not find any relevant examples or documentation on the official website to continue development.The usbpd_vdm_user files generated by STM32CubeMX are essentially empty, and I could not find any useful reference information in either STM32CubeG0 v1.6.3 or X-CUBE-TCPP.Could you please provide any related example code, application notes, or documentation that demonstrates:VDM handlingDiscover Identity floweMarker cable detectionSOP'/cable communicationAny reference material would be greatly appreciated and would help me continue development.Thank you.
Hello. STM32H5I'm used to cache operations using memory barriers (ISB/DSB), but looking at a function like HAL_ICACHE_Invalidate() or HAL_DCACHE_Invalidate() I can't find any. Are memory barriers not needed with STM32 ICACHE/DCACHE?
I am a beginner in electronics. I recently designed a board using the STM32F407VGT6 and DP83848, but after assembly and testing, I encountered a problem. The board can be programmed and it runs, but the Ethernet section does not work properly. It does not obtain an IP address. When I ping any IP address in network range, the Ethernet LED(pin 26) turns on and off, but the Ethernet connection is not actually established. I would appreciate it if you could guide me regarding the schematic and circuit so I can solve this issue.I attach my pcb schematic and board
I am working with the STM32H723ZG and trying to implement Ethernet communication without using an RTOS using LWIP(TCP/IP) Setup Details: Board: NUCLEO-H723ZG IDE: STM32CubeIDE v1.19.0 Ethernet stack: LwIP PHY interface: RMII Flashing tool: ST-LINK (onboard) Test performed: Ping test from PC Observed behavior: The Ethernet port LEDs (orange and green) remain solid ON after connecting the Ethernet cable. Ping is failing continuously, I got (Destination host unreachable) error. Troubleshoot taken: Checked with multiple Ethernet cables to ensure cable isn't a problem. I'm using static Ip and checked the Ip is correct in lwip.c while flashing the board. Rebuilt and reflashed the project multiple times. After all this still I can't ping the board. Assistance required : is there is any problem in cache coherency in the code? Kindly check with the MPU unit configuration and let me know is there is any issue? I'm
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.