Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello everyone, I have a problem with my STM32L011G4U6, I want to put it in stop mode or in standby mode, but the two modes are not taken into account, only the sleep mode works, I must surely make a mistake but where? here is my function: void Enter_MCU_Sleep(void) { HAL_Delay(1000); HAL_UART_Transmit(&huart2, (uint8_t *)"Dort\r\n", 33, 300); // Configurer et lancer le timer __HAL_TIM_SET_COUNTER(&htim2, 0); HAL_TIM_Base_Start_IT(&htim2); // Timer doit générer une IT de réveil // Désactiver les périphériques pour réduire la consommation //HAL_ADC_DeInit(&hadc); HAL_UART_DeInit(&hlpuart1); HAL_UART_DeInit(&huart2); //__HAL_RCC_ADC1_CLK_DISABLE(); __HAL_RCC_LPUART1_CLK_DISABLE(); HAL_NVIC_DisableIRQ(EXTI4_15_IRQn); HAL_NVIC_DisableIRQ(DMA1_Channel2_3_IRQn); HAL_NVIC_DisableIRQ(DMA1_Channel4_5_IRQn); // Désactiver le RTC et l'oscillateur LSE HAL_RTCEx_DeactivateWakeUpTimer(&hrtc); // Désactiver le wakeup timer RCC
Hi all, this is my first project with the STM32H5 and the new FileX/UsbX, before I was using G0 and F4 chips and knew my way around the FatFS and USBD software packages... A new project made the use of the H5 necessary because it has a USB and SDMMC peripheral. I want to configure the H523RCT6 as a USB mass storage device that gets detected by a PC and provide mass data storage via the SD-card (SDMMC1 peripheral). As soon as the PC puts a file on the SD card I need to detect it and stream it via UART to a different device... My problem is that I can't find a configuration that allows me to simultaneously use the SD-card as mass storage for the PC and detect when the contents were changed on the card. Right now every possibility I considered are suboptimal or do not work. Option 1: periodically init the FileX on the SD-card, check for files and transmit them via UART, then de-init FileX and init USB MSC. The problem here is that I cannot detect when the USB transfer is finished. I
I try to write my Bootloader using stm32l1 MCU and project from link but my mcu not powerful 32MHz max and have slow flash write memoryhttps://github.com/sfyip/STM32F103_MSD_BOOTLOADER/blob/master/Src/Principle: emulate Fat32 file system and directly write new firmware to flash memory with decoding it from STORAGE_Write_FS() function. Everything works, but when file size >100KB, sometimes errors occur. 50% of write tests fail. Bootloader check CRC firmware, Windows sent error, or end copies but not full firmware write. Maybe you have ideas how to solve this problem?
Split from this thread. (new question) You might be right. However it was made based on the well described example I have found. https://deepbluembedded.com/stm32-adc-multi-channel-scan-dma-poll-single-conversion/ I was trying tu run DMA but it was not working at all. I mean it was never transfering the data from ADC to the memory. Thats why I moved back to simpler example. Below you have DMA (one shot mode) that didn't work for me. Was trying the Circular mode as well but no change. /* 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 i
Hi,Looking into STM32CubeN6\Projects\STM32N6570-DK\Examples\SD\SD_ReadWrite_DMA example,I see that quite heavy operations are used:SCB_CleanDCache_by_Addr (aTxBuffer, BUFFER_SIZE); // ... SCB_InvalidateDCache_by_Addr (aRxBuffer, BUFFER_SIZE);while the aRxBuffer[] and aTxBuffer[] are located in a noncacheable memory region.uint8_t aTxBuffer[BUFFER_SIZE]__NON_CACHEABLE; uint8_t aRxBuffer[BUFFER_SIZE ]__NON_CACHEABLE;Could you please explain why?Regards,A
STM32H757 has FreeRTOS running. The goal is to stream JPEG data to the display using HAL interfaces to get performance. However, it is not working yet and I am here to get some guidance. I have it working with using third party library libJPEG. HAL Interfaces I am relying on: HAL_JPEG_DeInit(m_phjpeg) HAL_JPEG_Init(m_phjpeg) HAL_JPEG_DecodeCpltCallback() and HAL_JPEG_ErrorCallback() have been setup to release semaphore. HAL_JPEG_Decode_DMA() for non blocking decode DMA2D: RGB888 To ARGB8888 HAL_DMA2D_Init(&hdma2d) HAL_DMA2D_ConfigLayer() HAL_DMA2D_Start() HAL_DMA2D_PollForTransfer() with 1000 timeout DMA2D: BlendARGB To RGB888 (Blend to FG) stm32h7xx_hal_dma2d.h has the following macros that I am using: #define DMA2D_BACKGROUND_LAYER 0x00000000U /*!< DMA2D Background Layer (layer 0) */#define DMA2D_FOREGROUND_LAYER 0x00000001U /*!< DMA2D Foreground Layer (layer 1) */ Once the dma2d handle members are setup, the following happens: HAL_DMA2D_Init(&hdm
The STM32CubeG4 package comes with CMSIS v5.6 (https://github.com/STMicroelectronics/STM32CubeG4/tree/master/Drivers/CMSIS) which I think was released in July 2019.Is it necessary to use this version or can I upgrade it to a later release? Currently v6.1 is the latest CMSIS release.
Hi all, I'm using the STM32F746ZG Nucleo (CubeF7 LwIP HTTP Server Netconn RTOS example). I start my app when the netif gets a valid IPv4 using netif_set_status_callback (LWIP_NETIF_STATUS_CALLBACK=1) and then bind a UDP socket on the assigned IP. Calling getaddrinfo with service “0” (ephemeral) returns EAI_SERVICE (201): “udp: listen: getaddrinfo: <ip>:0 (error 201)”. What’s the recommended POSIX/LwIP way to bind a UDP socket with an ephemeral port on STM32—should I skip getaddrinfo(…, “0”) and bind with sockaddr.sin_port=0 directly? Also, is starting sockets from the netif status callback (after DHCP assigned IP) the correct timing on F7?
Hello everyone,I am working with an ST M 32 U 585 V I T micro controller and I would like to use an SD card for file read/write operations using Azure File X.I have enabled Thread x and File X middle ware in S T M 32 Cube IDE (Cube M X), but I am not completely sure about the hardware connections, Cube M X configuration, and code implementation for SD M M C with File X.
Greetings! So, I used the OpenBootloader project, and then flashed a GPIO_IOToggle firmware in other area of the flash, close to the example in the video Introduction to Open Bootloader, Part 3: Loading an Application. In that example the CubeProgrammer flashes through the DFU and check "run after programming". When I unplug the board and turn it back on, the OpenBootloader starts (as expected). What I want to do is, as soon as I flash the application, when I turn off the board and turn it on again, the application starts to run and not the bootloader, OR, it starts the bootloader, it checks if there's any application installed, and if yes, it jumps to the application immediately. Any clue on how to do that?Thank you!
Hi,Could you please let me know if you’re planning to provide an example of a USB Audio device based on USBX in the near future?By the way, the ST X-CUBE-AUDIO package is based on TinyUSB that is not officially supported. I’m wondering whether it’s feasible to implement a USB microphone using USBX instead.Regards.
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code. Hey Folks, I am writing firmware on a STM32U5A5ZJ-Q board, I am using FreeRTOS, and am running into some issues with SysTick, originally noticed when HAL_Delay() would just hang. I was also able to verify that uwTick does not change (this may be strange, because SysTick->Val does change as expected). I read in some other forums that WARNING:When RTOS is used, it is strongly recommended to use a HAL timebase source other than the SysTick. The HAL time base source can be changed from the Pinout tab under SYS. My understanding is that an RTOS that has SysTick_Handler implemented overrides the __weak handler that exists in the generated code and thereby forces things using SysTick as their timing source to a low priority. Since I already have my code written, so can I just updat
Hello,I have been trying to setup Ethernet on a NUCLEO-H563ZI to no avail. As recommended I am using the NETXDUO middleware. When setting up my project with CubeMX I enable DHCP but the MCU never seems to send any DHCP packets (Checking through wireshark). This is with completely unmodified code provided by the NX Core Init which generates the nx_app_thread_entry. After some further debugging it seems like the program hangs while waiting for the DHCP Semaphore which says that an IP Address is ready. Specifically this line:tx_semaphore_get(&DHCPSemaphore, TX_WAIT_FOREVER) != TX_SUCCESS Memory is not an issue in this case as those have been previous issues. I now assign well over 20kb for tx_app and nx_app.This sample program was also tested on a fresh board out of the box. I also have another script that seems to work halfway with messages for DHCPDiscover and DHCPOffer.Bellow is the main code for that program. In this case I don't use the pre-generated nx_app_thread. 
Hello everyone, Im trying for along time to try to create a sime UDP server that will handle packets reception on a BSD socket using the api. I took the following example:https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects%2FNUCLEO-H743ZI%2FApplications%2FLwIPAnd then instead of creating a task for the netconn i did one for a udpserver. Also tried to look at: https://github.com/stm32-hotspot/STM32H7-LwIP-ExamplesBut its support only old MX & HAL @Adam BERLINGER maybe can guide of how to integrate to the new MX and HAL? Im able to read packets one by one or only a few when sending in a burst. But if sending lets say 10 packets in a burst from python to the ST.The ST isnt capble of reading these packets. It would be awosome if one can try to help me debug this issue. Thanks alot, Ariel.
Does anyone know of an existing external loader for the NUCLEO-H7S3L8 that uses the 4-bit QSPI rather than the more conventional 8-bit. Because of shared pins on the demo board, I needed to use 4-bit QSPI for my build.
Hi,I just stumbled upon something interesting (at least for me). For my current project I need to store data from a float array with two elements in an uint8_t array with eight elements. I use the following code to archive this:pnt = (uint8_t*)out; for(i = 0; i < 8; i++) { uart_tx_buffer[i + 3] = *(pnt + i); }While it technically works, the bytes from each float element get stored in the buffer in a reversed order. I can give you an example from what I am looking at in the debug session. The float array has the values out = {0x41bef708, 0x4478a1d7}. So the result I exacted for the buffer is uart_tx_buffer = {xx, xx, xx, 0x41, 0xbe, 0xf7, 0x08, 0x44, 0x78, 0xa1, 0xd7}. But in reality it looks like this uart_tx_buffer = {xx, xx, xx, 0x08, 0xf7, 0xbe, 0x41, 0xd7, 0xa1, 0x78, 0x44}.At first I thought the values in the buffer are completely random because I made a mistake. It took me a while to figure this out. What is the reason why this happens? Can I avoid this, because now
Hi,I am implementing PTP slave on bare metal H743II with firmware 1.12.1 and LwIP 2.1.2.Timestamps for transmitted PTP datagrams can be received by implemented a callback function HAL_ETH_TxPtpCallback(). The callback is called from stm32h7xx_hal_eth.c:HAL_ETH_ReleaseTxPacket(). There was no call to HAL_ETH_ReleaseTxPacket(), so I added a call to it after calling udp_sendto().The callback function was never called because HAL_ETH_ReleaseTxPacket() never found a packet in use with timestamp in the descriptor. I copied the timestamp handling from HAL_ETH_ReleaseTxPacket() to HAL_ETH_Transmit(). That seems to work, but is a workaround that probably conflicts with the design.Any suggestion for a better solution is appreciated.
Hi Michel I am working on an Audio project using STM32H7A3VGH6 and STM32H743VGH6. I am interested in rate conversion from 44.1K to 48K ( I have a float version ) in Int16 and the Multi band DRC mentioned above. I did find the SRC441 in the X-Cube-Audio libray though the documentation mentions support for the STM32F series. Hope this will work for the H series as well. I did not find the MB-DRC though there is a SVC code. Is this the same as MB-DRC ( the document seems to indicate it as a single band only ). Is there a link where I can get the code for this ? Rgds Edit: Moved from X-CUBE-AUDIO-KIT Audio Latency
HelloI'm using a NUCLEO-N657X0-Q board and trying to bring up ethernet in RMII mode using STM32CubeIDE. :small_blue_diamond: Issue Description:When I run the application in the non-secure project, the Ethernet DMA bit (in ETH_DMASR) does not clear after transmission.The same configuration works correctly when running in Secure mode.:small_blue_diamond: Clarifications Requested:In which context should Ethernet initialization (MX_ETH_Init()) be performed — FSBL, Secure, or Non-secure?Should the ETH clocks and DMA be configured in the Secure project, with only application-level operations done in non-secure?Any guidance or official examples on the proper initialization flow and DMA handling for Ethernet on STM32N6 would be greatly appreciated.I have attached my CubeMX .ioc file (for both Secure and Non-secure projects) and a snippet of my memory configuration for reference and analysis.Is there an example project or reference demonstrating Ethernet initialization (LAN8742,
Hello everyone,I'm working with a NUCLEO-N657X0-Q board and trying to read audio data from an INMP441 I2S microphone using SAI2 in Master Receive mode with DMA. I have configured everything in STM32CubeIDE, but the DMA transfer complete interrupts are never firing.Here is a summary of my setup and the troubleshooting steps I've taken.Hardware Setup:Board: NUCLEO-N657X0-QMicrophone: INMP441Connections:PE12 -> SCK (SAI2_SCK_B)PE13 -> WS (SAI2_FS_B)PE11 -> SD (SAI2_SD_B)Mic L/R pin is connected to GND.Mic is powered by the board's 3.3V supply.STM32CubeIDE Configuration (.ioc):Project Type: FSBL only (no Appli).SAI2_B Configuration:Mode: Master ReceiverProtocol: I2S Philips StandardData Size: 24 BitsNumber of Slots: 2Audio Frequency: Set to 16 KHz.DMA Configuration:SAI2_B is linked to HPDMA1_Channel0.Mode is set to Circular.NVIC Configuration:HPDMA1_Channel0 global interrupt is enabled.Clock Configuration:SAI2 Kernel Clock is configured to ~2.048 MHz (derived from PLL2). It is not
Hi,I’m currently working on the STM32G491 series MCU. Our requirement is to support OTA firmware upgrades. In case the flashing process fails, the system should automatically revert to the previous firmware.Does the STM32G491 support this feature by default, or do I need to implement a custom bootloader to handle the fallback mechanism?
Hello Everyone, Am looking for a little help on what I hope is a simple issue. A quick summary is when I use freeRTOS + STM32Cube and set a breakpoint in one of the default task lines it never triggers. Breakpoints enabled before the scheduler is started work ok. Can anyone point me in a direction to remedy this? Will provide more details below. BTW, I'm new to the community and this is my first time posting. Happy to hear any suggestions from any of you that will improve my posts. Details purchased a STM32F769I-DISCO eval board. I have a simple project that blinks the DISCO board LEDS originally it was done without the RTOS enabled. Breakpoints and all worked great added the FreeRTOS and moved the blinking code over to use OS related stuff in the default task. the program ran ok. however, when a breakpoint is set it never pauses the app i configured the RTOS proxy and that all appears to be working fine if I manually pause the app. i also fou
I have GPDMA working on STM32U5 with a circular buffer. However, when I add a GPDMA "trigger" to the setup, the DMA no longer works. GPDMA1_C2TR2.TRIGPOL=2 GPDMA1_C2TR2.TRIGSEL=11 GPDMA1_C2TR2.TRIGM=3 LPTIM1 setup to clock away at a 50% duty cycle. What I would expect to see is the DMA transfer working slower than normal based on the ARR period of LPTIM1. But, the above combination of values along with a few variations just results in stopping the DMA. What would be helpful is some example application running on a nucleo board which makes use of a GPDMA driven device where both a DMA request and a DMA trigger are being used. (Documentation seems to be lacking. They do describe what the triggers are and from what I can tell how they should work, but because it is not working some vital clue is missing or hidden.)
Hi,I noticed there is no Stm32H7 Ethernet PTP example available anywhere. The ST support for PTP is very poor. I wanted to make an example and get it out for review to bring more visibility to the issues with PTP and see if I could solve some issues which are bugging this implementation. Link: https://github.com/chris1seto/Stm32H723NucleoPtpExample ST, could you please comment on the issues covered in this example? For any others, if you have solutions to any of these problems, could you fork/PR to add fixes or just post here so I can include fixes? Issues are detailed in the readme, but I copy and pasted them below:"Tail pointer issueWith the stock HAL code which is supposed to correctly implement Eth RX tailpointer calculation, reception doesn't work with timestamping enabled.In this project's Eth hal driver, I simply write the tail pointer to 0. It's not clear how the tailpointer is supposed to work and the documentation doesn't clearly explain it.The Stm32CubeH7
Hi All, Trying to setup timer triggered DMA for the STM32H7S3V8T6 micro and cannot seem to get it workingI have tried a number of things and eventually resorted to asking chatGPT but so far no dice... What I want to achieve1. Timer 1 toggles CH1 output (PA8) this works 2. I want the DMA to trigger off of the TIMER_CH1 and shove the word into GPIOA->BSRR to toggle the GPIOA pins 0,1,2,3Here's my main. c code - really stumped as to what is causing this to not work... Any thoughts?? /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : STM32H7S3 GPIO output driven by TIM1 using GPDMA1 linked-list ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include <stm32h7rsxx_hal_dma_ex.h> /* Private variables ------------
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.