Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello ST Community,I am currently working with the STM32N6570-DK board and trying to implement a UDP server using static IP (without DHCP).However, all the example codes provided by ST (both server and client) are configured with DHCP enabled. I am specifically looking for a working example that uses only a static IP configuration, and that can successfully respond to ping and UDP communication.I have noticed that many other users in the community have also waiting for it, but it seems an official example without DHCP is still not available with STM32N6.It would be very helpful if ST could provide or update an example project that:Uses static IP (no DHCP)Allows successful ICMP pingImplements a basic UDP serverLooking forward to a solution or guidance. I hope this update/fix will be considered soon by ST.Thank you.
Hello,I'm working on a custom board using the STM32F401RB MCU, aiming to implement a USB Audio Device. I'm using STM32CubeIDE with STM32CubeMX. My goal is to receive audio over USB from a PC and later play it via I2S.However, I'm currently stuck at the very first step: Windows 11 fails to enumerate the device, giving the dreaded:“Unknown USB Device (Device Descriptor Request Failed)”My Configuration:Clock:External crystal: 25 MHz HSEPLL config:PLL_M = 15PLL_N = 144PLL_Q = 5 → ✔ USB Clock = 48 MHz (confirmed)SYSCLK = 60 MHzUSB Peripheral:USB_OTG_FS: set to Device OnlyMiddleware:USB_DEVICE middleware enabledClass: Audio Device ClassAudio sample rate: 48000 samples/sDevice Descriptors (auto-generated):VID = 1155 (0x0483)PID_FS = 22336 (0x5730)LANGID_STRING = English (1033)MANUFACTURER_STRING = "STMicroelectronics"PRODUCT_STRING_FS = "STM32 Audio Class"CONFIGURATION_STRING_FS = "AUDIO Config"INTERFACE_STRING_FS = "AUDIO Interface"USB Parameters:Max interfaces = 1Max configuration = 1Max st
Hello I think I solved the problem but I do not know why. When I try to access the last address of a page it causes a hardfault.
Can anybody explain me what it the sense of having such functions separate for any peripheral that can choose the PLL as the source clock ?I mean... There is no independent "domains" for SYSCLK, ADC, I2S, etc.... There is only one instance of PLL and for me this is very confusing to haveLL_RCC_PLL_ConfigDomain_SYSLL_RCC_PLL_ConfigDomain_ADC LL_RCC_PLL_ConfigDomain_I2S1etc.. in ...ll_rcc.h fileEach of them reconfigures PLL which have nothing to do with peripherals that use it... Why there is no one function to set up dividers / multipliers for PLL generally and the source clock selection should be the API of particular peripheral driver? Is there any explanation why the LL drivers are designed this way ?
Hi. I have a NUCLEO-H723ZG board. And my basic goal is to create from scratch non-rtos project with ethernet support. But after many attempts i cant get it respond to pings from PC. I tried flashing udp echo sample and it works, so hardware isnt fault. Im using STM32CubeIDE Version: 1.18.1. Im doing next steps:1. Open CubeIDE and select File->Create->STM32 Project.2. Go to board selector and select NUCLEO-H723ZG. Create project with it.3. On the ETH tab enable RMII and change TX_EN and TXD0 pins according to board schematicsThese settings are default.4. Enable LWIP and set static IPSet PHY driverHeap options are default5. Enable cache and configire MPU.6. Add DMA sections to LD scripts, both FLASH and RAM7. Add MX_LWIP_Process() to the main loop8. Build project and flash it.I aslo tried different MPU configurations, setting GPIO speed in ETH settings to Very High, etc. But im stil getting "Host unreachable" when trying to ping board.
HelloI’m busy with the implementation of PTP support inside my project.I choose the STM32H745, because there is PTP support in hardware, with a nice offload function. After reading and try to understand the manual I create this code:uint32_t SubSecondValue = 43; #define ADJ_FREQ_BASE_ADDEND 0x35455A81 // Mask the Timestamp Trigger interrupt by clearing bit 12 of Interrupt enable register (ETH_MACIER). heth->Instance->MACIER &= ~(ETH_MACIER_TSIE); // Set bit 0 of Timestamp control Register (ETH_MACTSCR) to enable timestamping. //heth->Instance->MACTSCR |= 1; // Done at the END! :) //Program Subsecond increment register (ETH_MACSSIR) based on the PTP clock frequency. heth->Instance->MACSSIR = (SubSecondValue<<16); // if you use the Fine Correction method, program Timestamp addend register (ETH_MACTSAR) and set bit 5 of Timestamp control Register (ETH_MACTSCR) heth->Instance->MACTSAR = ADJ_FREQ_BASE_ADDEND; heth->Instan
Hello everyone, I am using the LWIP protocol stack on an STM32H743.I'm a bit confused about the MPU configuration here.I currently have the DMA receive and transmit descriptor addresses set to 0x30040000 and 0x30040100 respectively.The DMA receive buffer (RxBuff) address is set to 0x30040200.My configuration is as follows:HAL_MPU_Disable(); MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.BaseAddress = 0x30040000; MPU_InitStruct.Size = MPU_REGION_SIZE_512B; MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS; MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE; MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE; MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE; MPU_InitStruct.Number = MPU_REGION_NUMBER5; MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0; MPU_InitStruct.SubRegionDisable = 0x00; MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE; HAL_MPU_ConfigRegion(&MPU_InitStruct); HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT); MPU_InitStruct.
I am working on a project using the STM32H743ZI microcontroller.I want to implement SPI communication using the LL (Low-Layer) drivers instead of HAL. :question_mark: Can you confirm whether the STM32H743ZI supports LL SPI driver APIs like LL_SPI_Init, LL_SPI_TransmitData8, etc.? Also, are there any specific settings or header files (like USE_FULL_LL_DRIVER) required to enable these LL functions in STM32CubeIDE Does STM32H743ZI support SPI communication using LL drivers? I’m using STM32CubeIDE.SPI1 is enabled, but LL_SPI functions are disabled unless I define USE_FULL_LL_DRIVER.Is this the correct way to enable LL SPI support?
Hi, I'm using an STM32F767 with both USB OTG FS and HS in Host mode. FS is working fine with USB MSC + FatFS, and I can create files on a USB stick. HS is set to use internal FS PHY (no external ULPI). It detects the pendrive (HOST_USER_CLASS_ACTIVE), but FatFS fails to create/open any file (f_mount or f_open returns FR_DISK_ERR). This happens in both bare-metal and FreeRTOS.If I disable FS, HS works fine. But when both are active, only FS works for file ops. Is there any way to get FS and HS USB MSC + FatFS working together when HS uses internal FS PHY? Any example or suggestion to fix this dual-port issue would be invaluable. Thanks!
Hi, There would appear to be an error in the HAL_CORDIC_Calculate that results in errors when gcc optimsation O3 is turned on. I had the following code:void CORDIC_SineCalcSingleValue(float radiansNorm, float sin) { float angle_q31f; int32_t angle_q31[1]; /* Convert radians normalised over pi to Q31 format */ angle_q31f = radiansNorm * Q_31; angle_q31[0] = (int32_t)angle_q31f; // Convert to Q31 integer format int32_t result_q31[1]; // Output array Cos then Sin /* Calc sine and cos with CORDIC */ if(HAL_CORDIC_Calculate(&hcordic, angle_q31, result_q31, 1, 500) != HAL_OK) /* HAL_MAX_DELAY */ { // Handle error return; } // /* Compiler barrier to prevent reordering */ // __asm volatile ("" ::: "memory"); sin = (float)result_q31[0] / Q_31; // Convert back to float } My theory is the following although nit is probably wrong.This code fails because the HAL_CORDIC_Calculate argument result_q31 is not specified as volatile by the H
I am working on an audio application which is to be built on a custom board using STM32H723VG and the X-CUBE-AUDIO-KIT V1.1.1. I have demonstrated a prototype solution using the pre-built AUDIO-KIT binary loaded on the STM32H735G-DK development board and running LiveTune. I would now like to use AUDIO-KIT and create the similar real application for my target board with STM32H723VG.Being relatively new to the STM32CubeIDE (Version 1.16.00) environment I am unclear how to create a new project using the AUDIO-KIT as a foundation and then altering the BSP for my implementation of the H723. Can someone please point me to documentation or provide assistance for this?
I configured STM32CubeMX to have a timebase source as SysTick. I'm using this for my scheduler. its running at 1ms. I also configured tim3 for 1ms sortof.But for some reason this will not stay in synch with systick. They are drifting constantly apart.The green lines are racing across my screen. Even though they are 1ms period as well. But obviously they couldn't be. I just don't understand why. Or maybe I have an issue with my data??
hello,everyone,I used STM32CUBEMX+freertos+lwip to generate a project. Pinging 100 bytes was normal. Setting it to 1000 bytes would cause the program to freeze without any lwip error. The LWIP configuration file uses the default parameters. Has anyone encountered this problem before? Can you provide me with a solution? STM32CUBEM V6.14 STM32 firmware package V1.12.1 LWIP V2.1.2 /*----- WITH_RTOS enabled (Since FREERTOS is set) -----*/ #define WITH_RTOS 1 /*----- CHECKSUM_BY_HARDWARE enabled -----*/ #define CHECKSUM_BY_HARDWARE 1 /*-----------------------------------------------------------------------------*/ /* LwIP Stack Parameters (modified compared to initialization value in opt.h) -*/ /* Parameters set in STM32CubeMX LwIP Configuration GUI -*/ /*----- Default value in ETH configuration GUI in CubeMx: 1524 -----*/ #define ETH_RX_BUFFER_SIZE 1536 /*----- Value in opt.h for MEM_ALIGNMENT: 1 -----*/ #define MEM_ALIGNMENT 4 /*----- Default Value for MEM_SIZE: 1600 ---*/ #d
Hi all,I've been struggling so much to get wake from uart working on this board. It looks like it should be simple, I have this code which I am pretty sure should be everything needed, but it just doesn't wake up when I send data to the serial port.Can anyone see what I might be missing?#include <Arduino.h> #include <stm32u5xx_hal.h> #include <stm32u5xx_ll_usart.h> #include <stm32u5xx_ll_bus.h> #include "CustomPinsHub.h" static constexpr uint32_t LED_PIN = LED1_GRN; uint8_t aRxBuffer[10]; void SystemClock_Config(); // forward HardwareSerial stlinkSerial(rx_pin2debug, tx_pin2debug); void setup() { stlinkSerial.begin(115200); HAL_PWREx_EnableUltraLowPowerMode(); pinMode(LED1_GRN, OUTPUT); digitalWrite(LED1_GRN, LOW); stlinkSerial.println("→ Setup complete. LED is ON."); delay(500); UART_HandleTypeDef *huart = stlinkSerial.getHandle(); UART_WakeUpTypeDef wudata{}; wudata.WakeUpEvent = UART_WAKEUP_ON_READDATA_NONEMPTY; HAL_UARTEx_StopModeWakeUpSour
I'm running into a pixel mismatch issue when trying to capture frames over DCMI from a [B-CAMS_OMV with an OV5640 sensor board attached. I've used CubeMX and the stm32-disco F746 development board to successfully collect RGB565 and JPEG image compression data in various formats and resolutions.Below is my CubeMX generated DCMI configuration:hdcmi.Instance = DCMI;hdcmi.Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;hdcmi.Init.PCKPolarity = DCMI_PCKPOLARITY_RISING;hdcmi.Init.VSPolarity = DCMI_VSPOLARITY_HIGH;hdcmi.Init.HSPolarity = DCMI_HSPOLARITY_HIGH;hdcmi.Init.CaptureRate = DCMI_CR_ALTERNATE_4_FRAME;hdcmi.Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;hdcmi.Init.JPEGMode = DCMI_JPEG_ENABLE;hdcmi.Init.ByteSelectMode = DCMI_BSM_ALL;hdcmi.Init.ByteSelectStart = DCMI_OEBS_ODD;hdcmi.Init.LineSelectMode = DCMI_LSM_ALL;hdcmi.Init.LineSelectStart = DCMI_OELS_ODD; The OV5640 board is attached to an ST module, and I've written a driver heavily influenced by the [VISION-AI](https://www.st.com/en/emb
Hello,I have 2 STM32 Nucleo F746ZG boards, and I am trying to use one board (MCU 1) to program the second board (MCU 2) through its default bootloader through code. To do so, I used the following command in the MCU2 to start its default bootloader:#define DEFAULT_BOOTLOADER_ADDRESS 0x1FF00000 BOOT_JumpToAddress(DEFAULT_BOOTLOADER_ADDRESS); void BOOT_JumpToAddress(uint32_t address) { printf("Jumping to 0x%08X\r\n", address); // Function pointer to reset handler void (*app_reset_handler)(void) = (void *)(*((volatile uint32_t *)(address + 4U))); // Disable RCC, HAL, reset SYSTICK, and remap vector table offset HAL_RCC_DeInit(); HAL_DeInit(); SysTick->CTRL = 0; SysTick->LOAD = 0; SysTick->VAL = 0; SCB->VTOR = address; uint32_t msp_value = *((volatile uint32_t *)address); __set_MSP(msp_value); // Jump into application app_reset_handler(); } Then, on the programmer, I send the start byte 0x7F. When I receive ACK, I send the bytes for the "Go to applicat
I use the stm32g0b1 microcontroller to USB Host. I use the HAL library from STMicroelectronics. Class for FS IP: Communication Host Class (Virtual Port Com). And it works great with other microcontrollers that use Class for FS IP: Communication Device Class (Virtual Port Com). Both from ST and from other companies. But if I connect a device from FTDI (for example FT230X or FT232) or from WCH (for example CH340/343) to the host, nothing works. Everything freezes on Appli_state == APPLICATION_START.As far as I understand, many people have encountered this, but I have not found any solution to this on the Internet. Is it possible to somehow change the standard library for USB Host from ST so that it would be possible to connect such devices?
Hi everyone, I'm working on a project using an STM32H743 and LwIP (v2.1.2) without an RTOS (NO_SYS=1), and I've been debugging persistent issues related to LwIP's heap allocation and MPU configuration. After days of digging, I’d really appreciate the community's input. What I'm trying to do: I want to place the LwIP heap in RAM_D2 at address 0x30008000, enable MPU regions for protection, and successfully use Ethernet and ping using LwIP. My configuration: .ld file (.lwip_heap section): .lwip_heap (NOLOAD) : { . = ABSOLUTE(0x30008000); KEEP(*(.lwip_heap)) . = ALIGN(4); } >RAM_D2 In mem.c: attribute((section(".lwip_heap"))) attribute((used)) u8_t lwip_heap[MEM_SIZE]; #define LWIP_RAM_HEAP_POINTER ((void*)lwip_heap) In lwipopts.h: #define NO_SYS 1 #define MEM_ALIGNMENT 4 #define MEM_SIZE (64*1024) #define MEM_LIBC_MALLOC 0 #define LWIP_SUPPORT_CUSTOM_PBUF 1 The symptoms: With MPU disabled: I can receive ARP requests and the STM seems to process them correctly by trying to send a b
Hello,I'm using NucleoU575 with CubeMx and I want to make a file system on my SD card.I want to use FreeRtos but there are no Fatfs in CubeMx and the FileX cannot work with FreeRtos (image). Is there anyway i can use Fatfs with STM32U5 ?Thank you.
Hello,What is the simplest and best way to implement encrypted firmware update via DFU? I plan on building a custom bootloader but have not found any recent existing projects. I tried STM32-AES-Bootloader but it is setup for STM32F10 and I am using STM32F373 and am not sure about what memory settings/config I need to go with to make it work. I need it to work with CubeIDE as well ( STM32 project ) so I've started a new bootloader project to build my own instead of re-using an existing solution. ( unless there is something that will work well with STM32F373 )My uC currently detects an API 'switch to DFU' command, sets a magic value in memory and resets the hardware. I added reload function on bootup and jump to my app if the magic value is not found. This all works well but it's not encrypted. Any advice on how I should proceed?
Hi ST Community,I'm encountering an issue using the following function in STM32Cube HAL v1.11.3: HAL_UARTEx_ReceiveToIdle_DMA(&CLI_PORT_HANDLER, (uint8_t*)&cliPortRxBuff, sizeof(cliPortRxBuff)); HAL_UART_RegisterRxEventCallback(&CLI_PORT_HANDLER, (pUART_RxEventCallbackTypeDef)CLI_Serial_RxIdle_Complete); In this version, I observed that the callback registration depends on huart->RxState:if (huart->RxState == HAL_UART_STATE_READY) { huart->RxEventCallback = pCallback;} However, RxState is not in the HAL_UART_STATE_READY state at the time of registration, which causes the callback not to be assigned—leading to broken UART behavior.In contrast, previous versions (e.g., v1.11.0) checked gState, which allowed this registration to work as expected.Questions:Why was RxState chosen for the condition in v1.11.3 instead of gState?What is the recommended workaround or best practice to ensure the callback can be registered successfully in this new version?Appreciat
hi all,i am developing a project using stm32u585 microcontroller which can connect to the external devices using ethernet and USB protocols.i need to put the controller in sleep or any low power mode when ever a sleep command is reached through the USB communication and its need to be wake up when any command through the USB. i am new to the controller sleep part .is it possible to implement this if so can anyone please give some reference regarding the same.and am using azure RTOS environment for the development(threadx,netx,usbx).the same needs to implement on ethernet side as well since i am using an external chip for the ethernet and its using and external interrupt for transmitting and receiving data i can use that in case of ethernet. but in case of USB i didn't got any reference to work with any low power mode of the controller. (need to use the commands send through USB for put into sleep as well as wakeup from sleep).any reference regarding it will be a great help.
Hi everyone,I'm working on an STM32f103 project using Keil MDK (uVision) and could use some advice and practical insights from those who've handled intensive flash write requirements before.My use case:I need to reliably store and retrieve a single `double` value (8 bytes) in the STM32's internal flash memory. The challenge is that I have to support at least 3 million write cycles to this value over the product's lifetime—well above the typical endurance of a single flash page (which is around 10,000 cycles per page on my device).Constraints:- No external memory: The hardware is fixed; I have to use internal flash only.- Keil MDK: Development is in Keil uVision- Memory available: I can dedicate about 30 of the 128 internal flash pages for this purpose, which should provide enough headroom for wear leveling.Requirements:- Core functions: - Write a double value to NV memory with wear leveling.- Read the last stored value at startup and on demand.- Robust wear leveling: The solution
Hi All,Dears.I am studying how to make http requests with Nucleo-F429ZI. I have already had success with the web server example (HTTP Server), but now I need to make requests on another server, where a number of endpoints will be available. The difficulty I am having is that all the examples I found use the GET method, and I need to make some requests with the POST method. Is this possible?Could you recommend some reading material with examples?
Hello, I am trying to use one MCU to program another MCU, both of which are STM32 F746ZG boards.Let the MCU that is sending the commands be MCU 1, and the MCU in the bootloader mode be MCU2.I use the following command in the MCU2 to start its default bootloader:BOOT_JumpToAddress(DEFAULT_BOOTLOADER_ADDRESS); void BOOT_JumpToAddress(uint32_t address) { printf("Jumping to 0x%08X\r\n", address); // Function pointer to reset handler void (*app_reset_handler)(void) = (void *)(*((volatile uint32_t *)(address + 4U))); // Disable RCC, HAL, reset SYSTICK, and remap vector table offset HAL_RCC_DeInit(); HAL_DeInit(); SysTick->CTRL = 0; SysTick->LOAD = 0; SysTick->VAL = 0; SCB->VTOR = address; uint32_t msp_value = *((volatile uint32_t *)address); __set_MSP(msp_value); // Jump into application app_reset_handler(); }Then, on MCU1, I have coded the following functions so that I can send certain commands by typing them into my serial emulator PuTTY:printf("cmd: "); w
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.