Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello,when my rtc time goes to 23:59:59 to 00:00:00 then my program while loop is slow ex. some led toggle with 500ms toggle time is incress X2 so what is issue?
Title edited for clarity.I am trying to debug an application that is intended to run out of PSRAM on the STM32H7S78-DK. I have created a simple FSBL which initializes the PSRAM and puts it into Memory Mapped mode and then executes a software BKPT to halt the CPU. I then load an application image using the debugger (JLink) into PSRAM and start it. The application appears to run fine but I cannot get any interrupts to fire. The application running out of PSRAM establishes a new vector table in RAM and updates the VTOR register. I have tried both SysTick and an interval timer (TIM6) to generate interrupts but no success. Looking at the peripheral and NVIC registers everything appears to be correct.This is the MPU configuration for the PSRAM region: MPU_InitStruct.Number = MPU_REGION_NUMBER1; MPU_InitStruct.BaseAddress = 0x90000000; MPU_InitStruct.Size = MPU_REGION_SIZE_32MB; MPU_InitStruct.SubRegionDisable = 0x0; MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1; MPU_InitStruct.AccessPerm
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 and a linker script content. Please read this post: How to insert source code. Hello Community, I am working on STM32F746G-Discovery and trying to send ADC sensor data to a cloud server using Ethernet.Cloud API details: URL: https://iot.hummingbirdtek.com/api/dataMethod: POSTContent-Type: application/json What I Have Done: Enabled Ethernet (RMII) in CubeMX Enabled LwIP, set static IP Enabled ADC1, UART6 for debug Generated code (AC6/GCC) Added code to format JSON and send to cloud using http_post Issues I am facing: 1) HardFault occurs after LwIP initialization The crash happens during: MX_LWIP_Init(); netif_set_up(); 2) DMA Descriptor Memory Configuration Errors Compiler shows errors like: DMARxDscrTab memory out of rangeoraggregate value used where integer expectedI suspect incorrect MPU/Alignment/Section placement for: ETH_DMAD
I’m currently working on an STM32 project with Ethernet connectivity and LwIP. I want to know the IP address of the STM32 while configuring the network settings in CubeIDE. Here’s my setup: STM32 is connected to a router via an Ethernet cable and my laptop is also connected to same router via wifi. LwIP is being used as the TCP/IP stack. In LwIP settings, there is an option to choose DHCP or Static IP. My questions are: If I enable DHCP, how can I find out the dynamically assigned IP of the STM32? If I use a Static IP, what are the correct parameters to set (IP, Subnet Mask, Gateway) to ensure the STM32 is reachable from my PC? Are there any tips or methods to quickly verify the STM32’s IP on the network, such as through serial print, ping, or a network scanner?
Issue Description:I am unable to ping my STM32F2 board from another computer on the same network. The Ethernet link shows as UP and the MAC/IP addresses appear correctly, but ping requests timeout. I have been debugging this for a week without success.What I’m trying to achieve:Set up basic Ethernet communication using LwIP on STM32F2, assign a static IP (174.16.10.101), and make the board respond to ping.Clock Configuration:HSE: 25 MHzPLLM: 25, PLLN: 200, PLLP: 2 → SYSCLK: 100 MHzAHB: 100 MHzAPB1: 25 MHzAPB2: 50 MHzETH Clock Source: HSE (25 MHz) → RMII Ref Clock: 50 MHzPHY: LAN8742A, Address: 0x01What I’ve already tried (without success):Hardware & Cabling: Verified RMII pin connections, tried multiple cables/switches.Network Config: Static IP set correctly, firewall disabled, host PC on same subnet.Software: No compilation errors, added etharp_gratuitous(), MAC set to&nbs
Hi,I want to save the data in microSD memory card(for e.g. 4GB) as a file using STM32H573 discovery kit. And gone through with internet search and got some information. But unable to get the exact idea to how to start with or done it. Found one connector CN5 on the board for SD card. In order to get the above said what are the prerequisties need to be done and what need to be selected in IOC file . Can anyone tell a step wise procedure for this or give an example code would be a great help. Thanks in advance.
I am running into some issues standing up a basic non-volatile storage access with zephyr on the STM32F413ZH board. I am trying to provision for 128 bytes at sector 0x08C0000 but for soem reason the offset keeps jumping to the end of the Flash memory flash_stm32: Read range invalid. Offset: 1572864, len: 8Has anyone run into this or something similar? thanks!
Hi there!Im currently learning STM32 MCUs using Nucleo-F446REI wrote two 'Blinky' firmwares:*One using HAL and CubeMX (.ioc file)*A second one using just HAL (NO CubeMX)What does the FW does?: It just uses the user button on the nucleo, reads the state and "mirrors" that state on the user LED on the nucleoIn the project using CubeMX the firmware works in debug mode and in run mode (directly running on the board)But in the project that doesnt use CubeMX the firmware works fine in debug mode but it doesnt in run modeBoth projects compile with 0 errors and 0 warnings for both, debug and releaseI have read the RM and the HAL documentation but i dont have a clue where is the problemI tried all the solutions from chatGPT and still it doesnt workCan you help me please?What am i doing wrong?I let you the link to my projects if you need to check something Maybe the STM32CubeF4 version? (weird because both projects use the same version)Thanks in advance!Projects link: https://dri
Hello everyone, I am using an internal RTC on STM32L431. After running for 23:59:59 seconds, the time changes to 24:00:00 instead of 00:00:00, and the week day has not been incremented. Why is this?
In stm32l4_hal_flash.h: #if defined (STM32L4P5xx) || defined (STM32L4Q5xx) || defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx) #define IS_OB_USER_TYPE(TYPE) (((TYPE) <= (uint32_t)0xFFFFU) && ((TYPE) != 0U)) #elif defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) || defined(STM32L496xx) || defined(STM32L4A6xx) #define IS_OB_USER_TYPE(TYPE) (((TYPE) <= (uint32_t)0x1FFFU) && ((TYPE) != 0U)) #else #define IS_OB_USER_TYPE(TYPE) (((TYPE) <= (uint32_t)0x7E7FU) && ((TYPE) != 0U) && (((TYPE)&0x0180U) == 0U)) #endif The problem is that the L496/4A6 both have nSWBOOT0 and nBOOT0 option bits: #if defined (STM32L412xx) || defined (STM32L422xx) || defined (STM32L431xx) || defined (STM32L432xx) || defined (STM32L433xx) || \ defined (STM32L442xx) || defined (STM32L443xx) || defined (STM32L451xx
Hi everyone, dear.I have already managed to generate the necessary strings that represent the html pages, but I need to generate more complex pages. In the example that comes with CubeMX, it simulates a file system. How can I convert a small file structure to these headers?Thanks
Hi ST, i have one question for you. Could you please make "examples" more messy? Is it even possible? Lets see, i believe you can do it even worse. To be honest, i have never saw this nonsense and mess in my life. And i have also worked as ABAP developper. Have you ever heard about rule, that strongly recommends NOT to use "goto"? No? I thought so.Have you ever heard about spaghetti code? Because you created one really huge. That example about UsbX for Stm32u5 is awfull. Who did it? Intern? Student? What is wrong with you? Even renesas is now better than you.
Hi there,I am trying to add the STM32WL3xx chips to embassy-rs and for that I need to be able to generate the peripheral data. They use the SVD files for that information.I was able to find the SVD files for the STM32WL30, WL31 and WL33, but the ones I found seem to be lacking almost all `enumeratedValue` that are present in the other SVD files I could find of other chips. Instead it seems to be described in the description fields but that it way harder to parse.Are there SVD's available anywhere with the data in a way that is it more parse-able?Kind regards
I have an other issue at the moment. I cant use the GPIOD, VSSI02 is on 3.3V. Im using stm32g0b1kb. It wont toggle it wont read, it does nothing. I have created a small application far away from my main app just to test the GPIO functions.Hi, I a already Figured it out. But Thank you for the response. I have an other issue at the moment. I cant use the GPIOD, VSSI02 is on 3.3V. Im using stm32g0b1kb. It wont toggle it wont read, it does nothing. What am I missing.I cant toggle, read or write them? PB9 PB6, and PD1 to PD3/* 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
Hello!I am facing a problem when trying to connect to a remote server using NetXDuo and MQTT. We have a cloud service with which we want to establish a connection so we can send some data. I am basing my project on the example from the STMH573 MQTT Client. The exact problem I am facing is that when trying to establish the connection using the username and password, and the certificates an error occurs, when trying to secure connect. I get these two TSL alerts - alert level is 0x2 and alert value 0x28 (secure connection failed to be established). Using TLSv1.2.What I did:Converting CA certificate to the header file format openssl x509 -in ca.crt -outform DER -out ca.der # Then convert into the header file format using xxd.exe xxd.exe -i ca.der > ca.cert.hConverting client certificate to the header file format openssl x509 -in client.crt -outform DER -out client.der # Then converting it into the header file format xxd.exe -i client.der > client.cert.hConverting client k
On an existing, working project developed with stm32cubeide 1.19.0 and the stm32h743zit developed with azrtosh7 3.3.0 that uses usbhs as the host for msc and midi devices, I need to add usbfs channel management to connect hid and midi, but I'm having significant problems configuring the system with stm32cubemx. I haven't found any examples online that support both USB channels. Has anyone tried using both USB channels and can give me some advice? During testing, I found that creating code from stm32cubemx 6.15.0 with both USB channels has many problems. I had to make some manual changes to the code created because it starts running, but only partially works.
Hi everyone, I’m debugging an SMBus issue between an STM32H7, an LTC4100 Smart Charger, and an RRC2054 Smart Battery. I’m trying to write to the ChargingVoltage() register (command 0x15), but the SMBus frames captured on the logic analyzer appear corrupted and often contain NACKs or unexpected STOP/START conditions. My write function is: static HAL_StatusTypeDef SMBUS_WriteWord(PSMBUSDESC pSMBUSDesc, uint8_t addr, uint8_t cmd, uint16_t value) { HAL_StatusTypeDef status; uint8_t buf[3]; buf[0] = cmd; buf[1] = value & 0xFF; // LSB buf[2] = (value >> & 0xFF; // MSB status = HAL_SMBUS_Master_Transmit_IT( pSMBUSDesc->SMBUSinst, addr << 1, buf, sizeof(buf), SMBUS_FIRST_AND_LAST_FRAME_WITH_PEC ); while (HAL_SMBUS_GetState(pSMBUSDesc->SMBUSinst) != HAL_SMBUS_STATE_READY); return status; } The function returns HAL_OK, so the STM32 believes the transfer is successful.However, the logic analyzer shows clearly invalid SMBus traffic. These are examples
Hello, I’m working with an STM32H723 MCU and have a question about Flash behavior when caches are enabled.Both D-Cache and I-Cache are enabled, and I’m not using any additional MPU configuration. I'm using D-Cache invalidate after a Flash erase operation.Do I also need to invalidate the D-Cache after a Flash write? Below is my current code. The D-Cache invalidate is commented out.everything works fine, but I want to prevent any potential issues in the future. static int32_t flash_write_words(uint32_t addr, uint32_t *data) { volatile uint32_t *flash = (uint32_t *)addr; const uint32_t num_words = FLASH_NB_32BITWORD_IN_FLASHWORD; // check erased for (uint32_t i = 0; i < num_words; i++) { if (flash[i] != 0xFFFFFFFFU) { return -1; } } // write words if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, addr, (uint32_t)data) != HAL_OK) { return -1; } // SCB_InvalidateDCache_by_Addr((uint32_t *)addr, 32U); return 0; }
Hello!I try to use dual bank option on the stm32l476 (256kB) for implementing a custom bootloader. I want just read new program (bin) by custom protocol and write it to another bank. After that I want to switch the banks, reset mcu and start the new program (from another bank). Sounds easy!My actions:I built the program for bank1, load it to the address 0x08000000.Then I loaded the same program to the bank 2 by address 0x08020000. (either with the st-link utility or just by writing to the flash directly from my program, tried both of variants).After that I set option byte bfb2 from 0 to 1 (also either with st-link or just from program). But my mcu does not work at all.I`ve compared the program in both banks and original .bin file with the help of the st-link utility and found that there is no difference between it (no corruption during program).I`ve even tried to build program for bank 2 (with offset), but it also did not help.I`ve noted that when I change the bfb2 bit, the value in th
Hello everyone, I am trying to get an IP for my controller using the DHCP i can able to detect the Link up and link down but i can't able to get the IP. I had refered the example code for the ethernet(lwip https server netconn rtos) But i can't able to integrate with my main code can someone please help to either identify the issue or help me to integrate the example code with the main file. Thank you.Output Of my code LWIP Stack InitializedDHCP Started...DHCP Task StartedLink Task StartedDHCP State Changed: 255 -> 6DHCP State: UNKNOWN (6)Ethernet Cable: CONNECTED DHCP Restarted
generally i use cubemx choose cubeF1,but the hal driver in github is ahead of official website,for example lateset version of cubef1 is 1.8.6.however hal driver has updated later for bug fix. so if i want to use the newest hal driver,i need download form github,and replace it in local repository. it is ok?
Hi everyone, I am working on an STM32G4 project using the HRTIM1 peripheral. My goal is to generate a burst of exactly 3 PWM pulses on Timer A and Timer B simultaneously, triggered by an External Event (Sync Input / EEV). The Goal: System waits for an external trigger (e.g., from TIM3 via TRGO or physical pin). Upon trigger, HRTIM Timer A and Timer B start. They output exactly 3 PWM cycles. They stop and wait for the next trigger (Single-Shot Retriggerable). The Configuration: I am using STM32CubeIDE and HAL, but I also tried direct register access. Master Timer: Acts as a dummy/pass-through for synchronization. Timer A & B: Mode: Single-Shot Retriggerable. Prescaler: Div1. Period: 1000 ticks. Repetition Counter: 2 (Targeting $N+1 = 3$ pulses). Start on Sync: Enabled. Reset on Sync: Enabled. Preload Enable: Disabled (To force immediate register update). The Problem: Despite setting REPxR = 2, I consistently see only 1 pulse on the scope when t
Hi STM32 community, I have ordered those the Evalboards: NUCLEO-G0B1RE X-NUCLEO-SNK1M1 - USB Type-C Power Delivery Sink I have followed all of your existing applications, but none of the had lead to an similar result as displayed by your application descriptions. Lets stick to the newest one:(24) How to build an USBPD Sink application using the X-Cube-TCPP software pack - YouTubeI followed every step accurately several times now, but the result is always the same, Contract -> DEFAULT 5V no current. What am I doing wrong? I have studied all of your AN, watched all Videos, read and did the Wiki but never got any positive result as described..... Im frustrated and hoping for your help. Thank you very much! Br,KUDAThe usbc_test_3.zip is the zipped project.
GOAL To use Ethernet + LwIP on the STM32H743 chip without cache. Explanation We don't want to use the cache when using Ethernet because when the cache is enabled and data is sent and received via DMA on the SPI line, the correct data doesn't propagate to the bus due to a cache miss. Disabling the cache resolves this issue, which is why we prefer not to use the cache when using Ethernet. Cube Versions: STMCubeIDE v1.18.1 STMCubeMX v6.14.1 STMCubeFW_H7 v1.12.0 We used the settings in the following link to configure the project by @Adam BERLINGER 's project: https://community.st.com/t5/stm32-mcus/how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/49308. The CubeMX configurations are as follows: CORTEX_M7 configurations ETH configurations LWIP configurations Problems Encountered When Cache is Disabled 1. Usage Fault: The device enters a Usage Fault error when the program execution branches into the function SCB_InvalidateDCache_by_Addr() within the fo
I am working on a simple mp3 player project and have spent a few days on the Spirit library, as offered by ST.This comes in a binary (.a) form only lib_mp3decoder_cortex_m4_v2.2.0.a and has apparently been built for soft floats, using some weird mode where they drive the FPU directly - the "VFP reggister arguments" thing. My project uses the FPU for a lot of stuff, and since you apparently cannot mix these floating modes at link time, I get these errorsSearching online finds a 2021 reply from ST on same topic, where ST say the Spirit company no longer exists so they can't help. But the website is still there, so I emailed them. I got a reply, surprisingly:They don't support users, so I need to contact ST, to which I replied that I am not a car manufacturer, and I am happy to give them some money for a cortex-m4 lib which is actually usable :)Lots of people have been around this. I have a hardware float compiler setting but this mp3 lib uses something different. One poster suggests
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.