Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello STM Community,I have a project on STM32F407 with a web server. I am loading html pages and data from external USB storage using fs_open_custom() (fs.c) but in some cases I was still using internal flash with fsdata(_custom.c). For example, a 404 page for external memory error or disconnection cases to report a web server memory error.I recently updated to HAL 1.27.1 and reading data via fsdata_custom.c suddenly stopped working correctly. When requesting to read fsdata, the entire ethernet always dropped without reconnecting (must restart the MCU). After return back only the stm32f4xx_hal_eth.c/.h and ethernetif.c/.h files (the rest will remain in HAL 1.27.1), reading will start working correctly again.Is there any knowledge of this specific behavior or ethernet error after updating to HAL 1.27.1? Or is there already a fix please? I read here about the major overhaul of ethernet in the 1.27.0/1 update and the new problems it brought. Updating to HAL 1.28.0 (Cube 6.11) did not fix
Hello ST membersI've been having a problem with my STM32H745I-DISCO Board after my co-worker was trying to learn how to use and create projects with it.It was a simple project of using a digital button conected to the board via jumper and a potentiometer. it used sampling from gui to make the conection between the information that came from the model to the view.He used the option of solve clock issues in cubeMX to configure the analog ports. After that, the screen was blank, I tried to upload my previously working projects to the board but nothing changed. I tried erasing the flash and external memory via cube programmer, nothing changed.There were no build problems, and when flashing the project via touchgfx, no problems were announced in the monitor too.Then, I tried uploading the exemple project from ST called LTDC_Display_2Layers, and it worked perfectly.After that, I tried uploading the full demo for my board STM32Cube_Demo-STM32H745I-DISCO-V1.0.0_FULL.hex, it also
Hello I cannot manage to make my program working Nucleo 32 Board L412KB Time base of 1 s with TIM1 after debugging it appears that the programms never enters in the call back function of my code here below some explanations : - call to HAL_TIM_IRQHandler(&htim1); from the IRQ handler is OK Then /* TIM Update event */ if ((itflag & (TIM_FLAG_UPDATE)) == (TIM_FLAG_UPDATE)) { if ((itsource & (TIM_IT_UPDATE)) == (TIM_IT_UPDATE)) { __HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_UPDATE); #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) htim->PeriodElapsedCallback(htim); #else HAL_TIM_PeriodElapsedCallback(htim); #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ } OK as well Then the program goes to the weak function instead, while i expected he went to the standard call back function in my code where i toggle LD3 I suspect that i forget something important but i don't find I am not familiar with Interrupt handling, could you please help here Thanks Many thanks in advance Regards P
I have been testing the USBPD firmware examples SNK1M1_Sink and DRP1M1_DRP (the board is the NUCLEO-G474RE). When a PD source is connected to the board running either example and then the board is reset, it will then renegotiate the contract with the source.I have my own project (STM32G0B1RE) with two ports, a UFP (sink) and a DRP (sink/source). When I connect a source to either port and then reset the board, it doesn't renegotiate the contract like the firmware examples. I need to get this behaviour so that the board will behave correctly if it has to reset.Can anyone help me to work out why? I have tried resetting the board with the debugger attached, and confirmed that USBPD_DPM_UserCableDetection() gets called with State=USBPD_CAD_EVENT_ATTACHED on the connected port after reset (so the source is detected).For now I am focussing only on the UFP, so please ignore any DRP/tcpp03 code below.Here are the parts that I've changed from the defaults. Please let me know if you need any
Hello,I am using an STM32F777 with FreeRTOS and LwIP. A web server is running in a task, which has been working so far.Now I have updated to the CubeF7 firmware package 1.17.3 and migrated the firmware. Now there are build errors. In STM32CubeMX, the LWIP_SOCKET entry is disabled. It can no longer be activated because, as I have discovered, the entry NO_SYS=OS Not Used is set, even though I am using FreeRTOS. This was activated previously with CubeF7 firmware 1.17.2. However, I can no longer activate it.How can I switch LwIP to OS and activate sockets?I would appreciate some help.
Hello Folks I'm looking for suggestions / hints on what's the best way to troubleshoot a strange problem we're experiencing.We're running AzureRTOS/ThreadX + NetxDuo (Version 6.1.0) where we have a MQTT Client subscribing to a broker, waiting for a message and then reply back.As Phy, we're using LAN8742A. The problem we're experiencing is that while the application (based on pc) is flooding of messages the STM32F4 board, then it suddenly stuck somewhere on NetX side. The other part of application is correctly running, and in order to troubleshoot better the issue we're experiencing (which is highly replicable) we have: Increased the ip packet pool Increased the RX descriptors Disabled all the other task , just leave NetX ip instance and the task running the mqtt client(wait for message and then reply with a static message saying "Hello"). Force speed from 100MBit down to 10Mbit. None of the previous tries give us a clue on what's happening. The only thing we've noticed is that
I am reposting this issue because, while debugging, I've determined that the root cause is related to the Erase operation, not the reboot, as I had initially thought in my previous post. Previous post: https://community.st.com/t5/stm32-mcus-products/stm32h7-qspi-flash-incorrect-data-after-reboot-initial-write/m-p/830635#M284116 Board: STM32H747I-DISCODevelopment Environment: STM32CubeIDE 1.19.0Library: https://github.com/STMicroelectronics/stm32-mt25ql512abb My code executes in the following sequence:1. Initialize QSPI and the MT25QL512ABB flash memory.2. Erase a 4K block starting from address 0x0.3. Write 256 bytes (aTxBuffer) to address 0x0.4. Read back the 256 bytes from address 0x0 into aRxBuffer.5. Compare aTxBuffer and aRxBuffer.6. Erase a next 4K block starting from address 0x1000 (4096).7. Read the 256 bytes from address 0x0 again into aRxBuffer.8. Compare aTxBuffer and aRxBuffer. My expectation is that the erase operation in step 6, which targets the 4K blo
After updating the i2c library to the latest version, I got a write error. After reverting the library to the previous version, the error went away and the location where the error was returned is:stm32f3xx_hal_i2c.c / I2C_IsErrorOccurred()Line 7255It looks like there's probably something wrong with the acknowledge polling process to know when the write cycle is finished. CubeMX V6.13.0MCU Package STM32F3 Series V1.11.5STM32F334K6TxI2C EEPROM: AT24C16D
Dear ST Community,I'm trying to integrate I3C with DMA capability in my project (NUCLEO-H563ZI). Currently, I can run SPI/UART with DMA enabled, but I3C does not want to join the club (it works with IT, though).After I configure DMA for I3C in the STM32CubeMX interface (GPDMA1):RX CH2:TX CH3:And replace data transfer line:HAL_I3C_Ctrl_Transmit_ITtoHAL_I3C_Ctrl_Transmit_DMAI face issues with the later function. Particularly, it fails confirming the existence of the hdmacr handle:/* Check on hdmatx and hdmacr handle */ else if ((hi3c->hdmatx == NULL) || (hi3c->hdmacr == NULL))But I'm not sure what that means. The DMA handle from the DMA configuration tab is the same for both SPI/I3C since they both are in the same GPDMA 1:CH0: SPI TX.CH1: SPI RX.CH2: I3C TX.CH3: I3C RX.My first question would be, can SPI/I3C live with the same GPDMA resource?My second question, can I assign a different handle to I3C as they share the same names as in the SPI's TX/RX?TX: hdmatxRX: hdmarxAny ot
I'm doing some CAN messaging between the 2 CANs of F105 where I'm forwarding the message from one to the other but perform some modifications.Right now I set a flag in the FIFO callback functions that a message was received and the in the main while() I perform the actual work. Question is, is it safe to simply modify the original data param from HAL_CAN_GetRxMessage and then pass it to HAL_CAN_AddTxMessage or do I need to create a copy of the data and modify/pass that to HAL_CAN_AddTxMessage.Modifying the original data param works in development, but is it safe in real world application?
I am also failing in reproducing the DMA example from https://wiki.st.com/stm32mcu/wiki/Getting_started_with_HRTIM#To_go_further_about_DMA_burst. HAL_HRTIM_BurstDMAConfig() is mentioned in the text, but not present in the code example. Did you miss to put it into the example? Minor issue: I find it weird to edit HAL_HRTIM_MspInit() to change DMA_MEMORY_TO_PERIPH to DMA_MEMORY_TO_MEMORY as this gets overwritten by the next code generation. Would it be safe to put this in the user section below: /* USER CODE BEGIN HRTIM1_MspInit 1 */ hdma_hrtim1_a.Init.Direction = DMA_MEMORY_TO_MEMORY; if (HAL_DMA_Init(&hdma_hrtim1_a) != HAL_OK) { Error_Handler(); } /* USER CODE END HRTIM1_MspInit 1 */ This would result calling HAL_DMA_Init() twice. Is this OK? Kind regards, Guido
I've built a board around the STM32G0B1, hoping to get it to negotiate as much USB PD power as I can get. I've followed this tutorial: https://www.youtube.com/watch?app=desktop&v=-vsJhNIaHxE but see that some of the callback functions are deprecated: But this header doesn't say what the new function is or where to find out what the new interface is.This document is a lot of pages that don't tell me anything useful about how to actually use the library: https://www.st.com/resource/en/user_manual/um2552-managing-usb-power-delivery-systems-with-stm32-microcontrollers-stmicroelectronics.pdfThis one doesn't specify what are the functions to implement for the modern callbacks: https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_SinkCould someone point me to an up-to-date reference on what the requirements are to use this plugin?
Hey Team,I want to make LWIP and TouchGfx to work together for our next product. I have taken reference from here:https://community.st.com/t5/stm32-mcus/how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/493081. Touchgfx is working as expected2. I am not able to ping using etherenet. I am not sure the issue here.Please let me know what needs to be done here. Thanks.(Reposting this question as my previous post closed by mistake)
Hi all,I am using the MTFC8GAMALNA-AAT 8GB flash memory via SDMMC1, operating in MMC 4-bit wide bus mode, along with FATFS (M7). I now require the diskio.c file. Kindly provide it, or if you have any related example code, please share that as well. Please note that I do not want to use DMA or an RTOS for this implementation.Thanks
Hi everyone, I'm working on a project using an STM32H725 microcontroller running ThreadX and NetX Duo, and I've run into a persistent issue with the TCP server on port 502(Modbus). Setup: Networking handled by NetX Duo TCP server bound to port 502 listen_queue_size = 1 The socket is created once and reused (not deleted or recreated) Six other TCP ports are also in use and working without issues After running for a few minutes, Wireshark starts showing repeated [TCP Retransmission] packets being sent from the STM32, even though the socket on port 502 remains in the LISTEN state. At this point, the port stops accepting any new connections. Why is NetX Duo sending retransmissions when the socket is in the LISTEN state?How can I prevent the board from getting stuck and ensure it continues to accept new connections reliably? Any insights, suggestions, or similar experiences would be greatly appreciated!Regards, Rahul
NUCLEO F411RE I'm checking to see if I've got FreeRTOS integrated properly. So I've set up 2 tasks each with their own counter. In debug I was expecting to see the counter for Task1 to count up whilst Task2 never gets updated.When I step through the scheduler appears to set up just fine but when its to the call to start the first task (prvPortStartFirstTask()) it falls fowl to the HardFault_Handler.I initially had a stack size of 100 for each task & thought that maybe an issue but reducing the stack size to 30 hasn't made any difference.Any pointers (pun intended)? My code... * USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "arm_math.h" #include "FreeRTOS.h" #include "task.h" #include <stdint.h> /* USER CODE END Includes */ /* Private typedef --------------------------------------
I create A project for STM32F411 Discovery board with STM32CubeIDE 1.19.0 and coding : while (1) { /* USER CODE END WHILE */ MX_USB_HOST_Process(); HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin); HAL_Delay(500); /* USER CODE BEGIN 3 */ } and don't set anything else. (I saw that the connection settings for the leds were automatically created when Creating project) i Build and Run code sucessfully but i dont see led Blink. Thanks Edited to apply source code formatting - please see How to insert source code for future reference.
Hello. This is my first week with MCU's. I choose STM and want to stick with it. But it makes only pain :) So I was able to make some GPIO to work but have a complete disaster with LCD. The board came with some demo firm, and it was erased. So I am dealing with a complete new firmware. My helper is a chat GPT but he cant fix my Purple screen. I want to print some basic text like "Hello" and have no luck. Adding code here. Please advise that else I can share so there will be a clear mistake I made. Thank you. /* 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
Hi all static HAL_StatusTypeDef USB_CoreReset(USB_OTG_GlobalTypeDef *USBx) { __IO uint32_t count = 0U; /* Wait for AHB master IDLE state. */ do { count++; if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; } } while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_AHBIDL) == 0U); count = 10U; /* few cycles before setting core reset */ while (count > 0U) { count--; } /* Core Soft Reset */ USBx->GRSTCTL |= USB_OTG_GRSTCTL_CSRST; do { count++; if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; } } while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST); return HAL_OK; } at the USB_CoreReset function, my code keeps on getting stuck at the count++ and doesn't progress from there. I have even included RCC->AHB2ENR1 |= RCC_AHB2ENR1_OTGEN; // enable USB OTG HS clock RCC->AHB2ENR1 |= RCC_AHB2ENR1_USBPHYCEN; // enable ULPI clock before that function call but it does nothing.My board is stm32u5g9
Hello Community, I am trying to initialize SD card with FileX middleware standalone with my Nucleo-U545RET6Q board. I have initialized SDMMC1 with SD 4 bit wide , 48MHz with 0 divider. Later i had to put divider by 2 because the code was stuck at fx_media_open(); here is the picture: Later I have initialized the FileX middleware with SD interface, without changing any parameters. I then, edited the app_filex.c using code found with RTOS Based SD File edit program in U5 families. This is my app_filex.c file /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file app_filex.c * @author MCD Application Team * @brief FileX applicative file ****************************************************************************** * @attention * * Copyright (c) 2021 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory
I am trying to use the available example from software package - Microphone streaming. I Have installed audacity app, and follows the documentation related to X-NUCLEO-AMICAM1. LINK: UM2649 - Getting started with the X-NUCLEO-AMICAM1 analog MEMS microphone expansion board based on MP23ABS1 for STM32 Nucleo STEPS followed as per the document - hardware changes.4 microphone acquisition configurationStep 1. Open SB24 and SB26 to disconnect M1OB and M2OB on-board microphones from the ADCStep 2. Close SB23 and SB25 to connect M1 and M2 external headers to the ADCStep 3. Mount coupon boards on the headersCaution: Do not close SB23 and SB24 at the same time to avoid potential short circuit between M1OB on-boardmicrophone and M1 external microphone if the coupon is mounted.Do not close SB25 and SB26 at the same time: it will result in a potential shortcut between M2OB onboardmicrophone and M2 external microphone if the coupon is mounted. I cannot able to read the micro
Dear all,could need some advice how to continue debugging, IO am using an STM32F4- TIM1 capture compare IR enabled with highest priority (even above Time Base) - c&c callback just toggles a PIN two timesinline void HAL_TIM_OC_DelayElapsedCallback(TIM_HandleTypeDef *htim) { HAL_GPIO_TogglePin(DEBUG_PIN_GPIO_Port,DEBUG_PIN_Pin); HAL_GPIO_TogglePin(DEBUG_PIN_GPIO_Port,DEBUG_PIN_Pin); return; }- IR is called every 13us. However, sometimes the pin seams stuck for ~10us and then recovers.checking carefully, the next double toggle is also a bit late but the overall timing for the over next is fine.So looks to me that something interrupts my interrupt and delays it. But what should this be if it has already highest priority ?Any suggestions ? BR,BastelBaus
Greetings, I have a question about the touchsensing module. I am using a stm32u585rit6 mcu in a custom-made board and making a project using azure rtos. I needed to add touchsensing. I watched the app_azure_rtos_config.h and noticed that there is static memory allocation via threadX memory pools (#define TOUCHSENSING_APP_MEM_POOL_SIZE 5000). Then, at the app_azure_rtos.c file there is the following: __ALIGN_BEGIN static UCHAR tsc_byte_pool_buffer[TOUCHSENSING_APP_MEM_POOL_SIZE] __ALIGN_END; static TX_BYTE_POOL tsc_app_byte_pool; if (tx_byte_pool_create(&tsc_app_byte_pool, "TOUCHSENSING App memory pool", tsc_byte_pool_buffer, TOUCHSENSING_APP_MEM_POOL_SIZE) != TX_SUCCESS) { /* USER CODE BEGIN TOUCHSENSING_Byte_Pool_Error */ /* USER CODE END TOUCHSENSING_Byte_Pool_Error */ } else { /* USER CODE BEGIN TOUCHSENSING_Byte_Pool_Success */ /* USER CODE END TOUCHSENSING_Byte_Pool_Success */ memory_ptr = (VOID *)&tsc_app_byte_pool; status = MX_TOUCHSEN
Hello, I am trying to utilize the USB peripheral in STM32cubeIDE with the STM32H7S78-DK. It hangs forever in MX_USB_INIT on a function USB CORE RESET. With FS and HS this same issue seems to be happening. Pictures show config in the GUI and the aforementioned function.
Dear supporters,In a project I want to create a feedback mechanism to keep the top of a pulse-shaped signal between boundaries. Most of this seems working, except the control of the DAC channel, that should output a voltage for the diode-laser which produces the pulse to be controlled. Whatever I try, I get a more or less constant block shaped signal of 3.3V during ~7us and 0V for 5us. I checked the Reference Manual for the STM32H723VG processor chapter 31 but did find any clue.In pseudo code I do the following: - declare a DAC variable (DAC_HandleTypeDef hdac1; , auto-generated) - initialize the DAC within 'main.c' ( MX_DAC1_Init(); , auto-generated)/** * @brief DAC1 Initialization Function * @PAram None * @retval None */ static void MX_DAC1_Init(void) { /* USER CODE BEGIN DAC1_Init 0 */ /* USER CODE END DAC1_Init 0 */ DAC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN DAC1_Init 1 */ /* USER CODE END DAC1_Init
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.