Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I am using NucleoH563ZI board with threadx and netxduo.I have the following code, it makes http requests.The first completes ok, but the other 2 has a problem where the dns returns with 0xA3, basically can't resolve the host url. With wireshark i noticed that the url somehow contains one additional character: "firestore.googleapis.comD" and with the second case: "firestore.googleapis.comH"calloc (or malloc, does not matter which i am using) returns a valid and good pointer then strcpy copies the url string.In debug I can see that the url is copied succesfully. But after the next calloc suddenly an excess character appears at the end of the string, thus the dns fails to resolve.It does not matter what I put between the strcpy and the calloc, it always fails the same way.if I compile the program with only a single request, then it sometimes works. Any idea what is going on? //get public IP char* public_ip_str = calloc(30, 1); if(public_ip_str == NULL) { Error_Handler();}
I have read some posts about this topic already but unclear if this works or not. I used the STMCubeMX to create a project using FreeRTOS and USB Device CDC (USB-Serial) together and some LED GPIO's.I can only get one or the other to work, but never at the same time. I have tried adjusting the memory settings heap/stack as suggested in some of the forums but that didn't help. Just wanted to check if anyone has this working or if I should switch to a different scheduler/OS? I am using a STM32F303RE; any help would be appreciated. Thank you
Hello there, I'm using USB CDC application. I'm in a situation of receiving more than 250 bytes of data from the Windows(QT). Now my doubt is when the data is more than 64 bytes the USB FS it'll not consider right.But i revised some websites from there i came to know that "you can send larger than 64 bytes the usb will take care for multiplying the packets". But in my case it was not working. Later from our STM community i came to know that by changing this " CDC_DATA_FS_MAX_PACKET_SIZE" to larger number we can achieve receiving large number of packets.initially CDC_DATA_FS_MAX_PACKET_SIZE is 64U. Now I've changed to 256U. Now it's working fine, but i don't know about later. Does it cause any problems?
Hello,first, this is my first try on Keil uVision & MDK toolchain.My goal is to compile and run the same source using ST CubeIDE and Keil uVision.For this a generate code and 2 project files, one for CubeIDE and one for Keil, for a demo project with FreeRTOS and LWIP.I can sucessfully compile and run the project on CubeIDE. But if I compile the same code on Keil MDK, I get the following errors:Error: L6218E: Undefined symbol errno (referred from if_api.o).FreeRTOS.h(71): error: #5: cannot open source input file "reent.h": No such file or directory I googled around and I found out that I have to tweak some settings in CubeMx which dependent on choosen toolchain. But my intention is to use the same source and CubeMx configuration files for both toolchains. So I choose patching two configuration files. The 1st patch I added to the user code part of FreeRTOSConfig.h:/* The following flag must be enabled only when using newlib */ #define configUSE_NEWLIB_REENTRANT 1 : /*
I'm working on getting a minimum viable example functional using a U575 IC and a micro SD Card. The hardware I'm using is the Nucleo-U575 board along with an SD Card breakout from Adafruit. I've wired it up as an SDIO 4-bit setup. With just the autogenerated code when I enable the SDMMC peripheral, I'm finding that it runs into an error. HAL_SDIO_Init() -> SDIO_InitCard() -> SDMMC_CmdSendOperationcondition() -> SDMMC_GetCmdResp4() returns a errorstate of 4 (SDMMC_ERROR_CMD_RSP_TIMEOUT). What is timing out here? Is there something I need to do to set the SD Card into SDIO mode? Also, the SDIO_CLK looks to be running non-stop at ~800kHz. Is this normal? I would expect it to run only when something it happening on the bus (just like SPI), but this is my first foray into SDIO.This is using STM32CubeIDE 1.19.0 with the latest firmware pack (I installed it and it downloaded it today)
Hi All,I have constant measurement offset in Vbat internal channel from ADC3, ~30mV above the supplied value.Vref calculated by macro:__HAL_ADC_CALC_VREFANALOG_VOLTAGE((uint32_t)(measure->adcDataAverage[measureVref]) , ADC_RESOLUTION_16B);i see offset of 4 mV above the configured 2.5V (reading is 2.504 - 2.505)Vbat also calculated by macro:__HAL_ADC_CALC_DATA_TO_VOLTAGE((uint32_t)(systemObj->dump[MIN_NET_ADDR_NUMBER - 1].measurement[measureObjVref][dbgObjectNameVoltage - dbgObjectNameCurrent]) , measure->adcDataAverage[measureVbat] , ADC_RESOLUTION_16B);but offset is higher: 30mV above the input voltage.i check with NUCLEO-H753ZI by run of STM32Cube\Repository\STM32Cube_FW_H7_V1.11.2\Projects\NUCLEO-H743ZI\Examples\ADC\ADC_InternalChannelConversionand also observed offset around 20mV.According to DS: https://www.st.com/resource/en/datasheet/stm32h743vi.pdf page 109, Vref has max.15 mv "spread", but the Vbat deviation is not specified.Please advise.
Hi :I want to switch my project from HAL to LL because of flash size.But SPI doesn't work after switching.When I using HAL, the code below in main function works fine, uart will print OK.When I switch to LL, it will print NG.After switching to LL, I already add LL_SPI_Enable(SPI1); to MX_SPI1_Init function.Cubemx project and all code is as attachment. uint8_t data = 0x80; CS_GPIO_Port->BSRR = (uint32_t)CS_Pin << 16u; #ifdef USE_HAL_DRIVER HAL_SPI_Transmit(&hspi1, &data, 1, 100); HAL_SPI_Receive(&hspi1, &data, 1, 100); #else while (!LL_SPI_IsActiveFlag_TXE(SPI1)); LL_SPI_TransmitData8(SPI1, data); while (!LL_SPI_IsActiveFlag_TXE(SPI1)); LL_SPI_TransmitData8(SPI1, 0xff); while (!LL_SPI_IsActiveFlag_RXNE(SPI1)); data = LL_SPI_ReceiveData8(SPI1); #endif CS_GPIO_Port->BSRR = CS_Pin; if(data == 0x05) { while (!LL_USART_IsActiveFlag_TXE(USART2)); LL_USART_TransmitData8(USART2, 'O'); while (!LL_USART_IsActiveFlag_TXE(USART2)); LL_USART
Hello, I'm trying to use the HAL function to calculate a file MD5 on my STM32H750 MCU. I successully managed to calculate the MD5 of little files using HAL_HASH_MD5_Start. Now I want to calculate the MD5 of a large file, so I'm not able to store all the file content in RAM. How to use the HAL functions to calculate the MD5 in chunk? Thank you in advance,Matteo
Hi, I have a problem with pinging PCs with my adapter USB-Ethernet with an STM32F207. I'm currently working with CDC-ECM for Ethernet-Over-USB. First case: I have 2 VMs with Linux on them. The USB is connected to the first VM (VM1) and the Ethernet is connected to the second (VM2). I can ping VM1 with VM2 but I can't ping VM2 with VM1.Second case: I have one VM with Linux and a Windows machine. The USB is connected to the VM and the ethernet is connected to the Windows machine. When I ping the VM with Windows or Windows with the VM I have only loss packets... Does someone have any idea why ?Thanks,
There is inconsistency in the reference manual and the STM32CubeMX clock configuration tool as to what the maximum clock for the PLL DSI. Reference manual suggests it is 1000 MHz however, when set to that in STM32CubeMX, an error is generated at the PHY DSI lane byte frequency with a maximum of 62MHz instead of an expected 125MHz
Title:Hi STM32 Community,I’m working on a FOTA (Firmware Over-The-Air) project using the STM32G030C8T6. The setup consists of:- A custom bootloader at 0x08000000 (32KB)- An application at 0x08008000 (32KB)- Communication via UART2 with an ESP32, which sends Intel HEX files:white_heavy_check_mark:Working Bootloader Flow- On any reset (power-on or manual), the bootloader always runs first.- The bootloader listens for HEX data and writes the application to flash at 0x08008000.- When it receives "JUMP_2_APP" over UART, it jumps to the application.- This jump works correctly: the application runs, GPIO/LED blinks, UART works.__attribute__((noreturn)) void Jump_To_Application(void) { uint32_t app_addr = 0x08008000; uint32_t msp = *(__IO uint32_t *)app_addr; uint32_t reset_addr = *(__IO uint32_t *)(app_addr + 4); void (*app_entry)(void) = (void (*)(void))reset_addr; if ((msp < 0x20000000) || (msp >= 0x20002000)) { send_uart("[BOOT] Invalid MSP! Application not valid.\r\n"); while (1);
Hi. Last week I received my first STM32U5A5 board and tried to implement USBX HID standalone mode, following this tutorial. Guess what? I managed to make it work and It just works very well! I should call USBX_Device_Process(NULL); in the main loop so the STM32U5A5 serves as USB HID device. My question is that, is it appropriate to call USBX_Device_Process function in the main loop, while the USB polling rate is 1000 Hz (depending on settings)? When debugging, that function is called multiple times per milliseconds and I'm worrying about some malfunctioning due to the excess of USBX_Device_Process calling. Or is it totally fine repeating the USBX_Device_Process function without carefully configured timers or fitting the timing into the polling rate? Thanks in advance!
Good morning,I have recently made a piece of hardware which has a F722VET6 microcontroller and a W25Q128 flash chip onboard. When I set up all the peripherals (using quite a few other spi and i2c components) and write a simple LED flash in the main while loop the LED doesn’t flash. However if I comment out the MX_Qspi_init function code runs fine on the board. This happens with both the flash soldered and if it’s not populated on the board. I also have various sensors which I have tested and they run fine with regular spi. The only thing I can think of is that when the QSPI init is left in the code (not commented) it tries to use the external flash and boot from it which doesn’t have anything on so doesn’t do anything. I’m unsure if this is correct. Wiring is correct and I’ve tried various clock speeds for the qspi does anyone have any ideas?
Hello,I'm working with the STM32H745ZITx and trying to receive data over USART3 using RX DMA. However, the usart_rx_dma_buffer remains all zeros — as if no data is written. Here’s what I’ve checked::small_blue_diamond: DMA Configuration:DMA1_Stream0, Peripheral-to-Memory directionTried both Circular and Normal modeDMA RX request enabled for USART3HT and TC interrupts are enabledNVIC settings verified:small_blue_diamond: Memory & MPU:RX buffer is aligned using __attribute__((aligned(32)))Proper cache invalidation is applied using SCB_InvalidateDCache_by_Addr()Buffer region tested in .ld file using both D1 domain (0x2400xxxx) and D2 domain (0x3004xxxx)MPU region configured as Normal, Cacheable, Shareable:small_blue_diamond: What I’ve Tried:IDLE line interrupt is enabled — still no dataTX DMA works correctlyRX DMA callback triggers, but buffer is untouchedAll configuration steps follow the stm32-usart-uart-dma-rx-txCarefully reviewed DMA is not working on STM32H7 devicesNote
Hello,I am working on the STM32H745ZITx platform and using both CM7 and CM4 cores with FreeRTOS. I am trying to run a TCP server on the CM7 core using LwIP.However, when I call the accept() function, the system seems to hang. Specifically, after accept() is called, none of the tasks on the CM7 core continue to run — it appears as if the RTOS scheduler has crashed or is blocked.I have reviewed the example from this repository:STM32H745_Nucleo_M7_ETH and followed the STM32H745_Nucleo_M7_ETH project structure closely.Do you have any suggestions or guidance on what else I should check? Could this be related to interrupt priority, improper memory configuration, or something else I may have overlooked?I would appreciate any help or insights you can provide.Best regards,Kemal UZGOREN
Hello, i have been trying to measure the frequency of a pwm signal using input capture. I am using Nucleo-F429ZI I want to print the values of the frequency of the signal in question with UART. The frequency of my signal is 100 kHz but I read stuff like these on my serial monitor: (I printed diff instead of frequency to see what is the issue, it is the same with frequency just with bigger values.)The oldest data was removed. Continue...637130510862817410578482410364375355365365365131575163852855021820130200482000519942200442001619963(I cut most of the data so that the post isn't too long but it is roughly like this. Constant values near 365 and occasianl continous irrelevant high values)Below is the relevant parts of my code: ... /* USER CODE BEGIN 0 */ uint32_t captureValue = 0; uint32_t previousCaptureValue = 0; uint16_t diff; uint16_t frequency = 0; char uart_buffer[32]; static uint8_t first_capture_flag = 1; /* USER CODE END 0 */ ... int main(void){ ... HAL_TIM_IC_Start
Hi everyone,I have a problem with the Ethernet connection that I can't solve on the STM32H747I-DISCO board.I followed Adam Berlinger's guide step by step (https://community.st.com/t5/stm32-mcus/how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/49308) and the Ethernet works for a while, but when I send messages on udp or start the ping, after a while it stops working.can someone help me?, I've been trying to fix this problem for two months now but without success.thank you very much in advance.
I'm developing a program and we want to be able to flash it via bootloader in production with a UARTTo do that, we are using a NUCLEO-F302R8 board to flash a custom board with a STM32G0B1 following this post: https://community.st.com/t5/stm32-mcus/how-to-program-an-stm32-with-another-stm32-using-an-embedded/ta-p/612362It worked, but only when flash was erased. In order to work in case of accidental disconection of UART wires, we need to be able to flash it in any case by pulling BOOT pin highThe option bytes were:nBOOT1=1, nBOOT0=1, nBOOT_SEL=1. That means I was in the fourth line scenario, it attempted to boot from Main Flash and only booted from bootloader when it was empty regardless of BOOT0 pin stateTo fulfill the requirements of the project, I needed to set the first and second lines scenario, so it would boot from Main Flash when BOOT0 pin was low and boorloader when high. To do that, I changed the option bit nBOOT_SEL from 1 to 0Now, with nBOOT1=1, nBOOT0=1, nBOOT_SEL
Hardware environment: STM32 Nucleo-64 development board with STM32C071RB MCU.Software environment: Bare-metal operation without RTOS.I am currently working on a USB composite device without an RTOS. Previously, I used STM32CubeMX to generate and modify separate HID mouse and CDC virtual serial port programs, both of which worked fine.This time, I added a CDC component to the HID mouse program. After generating the code with CubeMX and supplementing the CDC interface functions, I encountered an issue with PMA endpoint memory allocation. I referred to the code example in the CubeMX repository (STM32Cube\Repository\STM32Cube_FW_C0_V1.4.0\Projects\NUCLEO-C071RB\Applications\USBX\Ux_Device_HID_CDC_ACM), which has the following memory configuration:HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x00, PCD_SNG_BUF, 0x14);HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x80, PCD_SNG_BUF, 0x54);HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x81, PCD_SNG_BUF, 0x94);HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x01
Starting from a working application based on the STM32U585A microcontroller, we changed the CPU to have the ETHERNET peripheral available. The flash is connected via quadSPI to the microcontroller, while the RAM is connected via octospi .Microcontroller Model: STM32H723ZGT6 FLASH MODEL: S25FL064L DRAM MODEL: APS6408LRegarding the configuration operations of both the flash and the RAM, everything seems to work, but when it comes to reading or writing, we receive incorrect data once out of 10 attempts. Note that we have a working application with the STM32U5 microcontroller using the same flash and RAM.Any idea on what I’m I missing?Flash initializzationvoid MX_OCTOSPI2_Init(void) { /* USER CODE BEGIN OCTOSPI2_Init 0 */ /* USER CODE END OCTOSPI2_Init 0 */ OSPIM_CfgTypeDef sOspiManagerCfg = {0}; /* USER CODE BEGIN OCTOSPI2_Init 1 */ /* USER CODE END OCTOSPI2_Init 1 */ hospi2.Instance = OCTOSPI2; hospi2.Init.FifoThreshold = 1; hospi2.Init.DualQuad = HAL_OSPI_DUAL
when i make the macro LUDWIG_SAI_DMA_MODE 0 i can hear audio in continous loop without noise because it runs in blocking mode.when give 1 to LUDWIG_SAI_DMA_MODE, I can able to hear the audio for sometimes after that i hear noise. When i hear noise i suspend the task it will point to while(updatePointer==-1). /* * audio.c * * Created on: Jun 30, 2025 * Author: KannikaMMallu */ #include "audio.h" #include "sai.h" #include "tx_api.h" /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ __IO int16_t UpdatePointer = -1; extern int16_t PlayBuff[PLAY_BUFF_SIZE]; /* USER CODE END PTD */ TX_THREAD audio_thread; UCHAR audio_thread_stack[4096]; /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM
I have an issue where a HAL_I2C_Mem_Read_IT transaction just seems to hang. It is plausible that this peripheral is temporarily unavailable and I already have working retry logic for the case where this call returns the "AF" error. The hang may or may not be related, but I'd like to abort it and try again. It isn't easy to get an I2C trace of this, but not impossible. In any case, I'd like to add some code to address this issue if possible.
I would like to highlight a compatibility issue we have encountered. The TL-SG116E is a smart managed switch, whereas our machine, which uses an STM32 F7 Nucleo board, is designed to operate with an unmanaged switch. As a result, we are experiencing communication errors when connecting through the TL-SG116E.The board is getting connected or in communication when we give it a hard reset ,while the reset button is pressed.
Please somebody can help me to correct my errors in stm32cubeide for stm32f401cdu6 project../Core/Src/main.c: In function 'HAL_UART_RxCpltCallback':../Core/Src/main.c:77:38: warning: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]77 | rxbuffer[bufferIndex]="\0";| ^../Core/Src/main.c:84:37: warning: passing argument 2 of 'HAL_UART_Receive_IT' makes pointer from integer without a cast [-Wint-conversion]84 | HAL_UART_Receive_IT(&huart6,uart_char,1);| ^~~~~~~~~| || charIn file included from ../Core/Inc/stm32f4xx_hal_conf.h:411,from ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:29,from ../Core/Inc/main.h:30,from ../Core/Src/main.c:20:../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h:748:75: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'char'748 | HAL_StatusTypeDef HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);| ~~~~~~~~~^~~~~../Core/Src/main.c: In function 'processs
Hello everyone. I am writing to you because I am trying to capture a thermal image (frame of temperature values) using a Lepton 2.5 thermal camera with Break Out board 2.0 connected to a Nucleo U5A5ZJ-Q board. First I connected the following pins of the Break Out board 2.0 to the Nucleo board, as shown in the table below.I have not inserted pull-up resistors or software pull-ups on SDA and SCL.Then I created the project and wrote the first lines of code in order to:-) Reset the Lepton thermal camera-) Read the register =0x000E-) Check that the thermal camera boot is finished (bit2 == 1 of 0x0002 register)-) Check that the interface is not busy (bit0==0 of 0x0002 register)-) Check that the system is ready (SYS FFC Status = 0x0000)Below is the code I used to implement this first part. // Lepton Reset (PC13 low -> high)HAL_Delay(100); // 100 ms to give time for the activationHAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_RESET); // Put Low for ResetHAL_Delay(500); // 500ms di rese
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.