Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I am working on UART communication between an STM32H563 and a Raspberry Pi CM4.Currently, I am using UART without hardware flow control (RTS/CTS disabled). During continuous communication, I am frequently getting ORE (Overrun Error) on the STM32 side.Configuration details:MCU: STM32H563Communication: UARTFlow control: DisabledUART mode: InterruptPeer device: Raspberry PiI would like to know:1. What is the best workaround to avoid ORE errors without enabling hardware flow control?2. Is it reliable to use UART communication continuously without RTS/CTS?3. What are the recommended UART settings or software handling methods for STM32H5 series?4. How should ORE recovery be handled properly in STM32H563?Currently, once ORE occurs, The data became lost.
Hello ,I am working on a project with the STM32L562CET6 microcontroller and have encountered an issue with the timer interrupt callback function. 1. I configured TIM6 as the clock source for the microcontroller. Consequently, the HAL_TIM_PeriodElapsedCallback() function is automatically triggered whenever the TIM6 interrupt occurs. 2. Now, I have configured TIM2 for a different purpose, but I noticed that when the TIM2 interrupt occurs, the same HAL_TIM_PeriodElapsedCallback() is triggered.Since the HAL_TIM_PeriodElapsedCallback() is defined with the weak attribute, I understand that I can redefine it in my user code. However, this causes conflicts when multiple timers (like TIM6 and TIM2) trigger this callback.Questions: 1. Is there a way to alias or redirect the HAL_TIM_PeriodElapsedCallback() to separate functions for different timers (e.g., one for TIM6 and another for TIM2)? 2. Is there any other specific callback function available for timers i
Hello, I am working on an SNMP implementation using STM32H753ZI with the LwIP Ethernet stack. Currently, SNMP v1 is working successfully, including trap generation and reception testing using Net-SNMP tools. I am able to send enterprise-specific traps from the STM32 device. Below is the trap code currently working for SNMP v1: void send_temp_fault_trap(void) { static const u32_t enterprise_oid_arr[] = {1,3,6,1,4,1,50598}; struct snmp_obj_id enterprise_oid; enterprise_oid.len = LWIP_ARRAYSIZE(enterprise_oid_arr); memcpy(enterprise_oid.id,enterprise_oid_arr,sizeof(enterprise_oid_arr)); ip_addr_t dst; IP4_ADDR(&dst, 192,168,0,255); snmp_trap_dst_ip_set(0, &dst); snmp_trap_dst_enable(0, 1); static const u32_t msg_oid_arr[] = { 1,3,6,1,4,1,50898,10 }; static struct snmp_varbind vb; static struct snmp_obj_id msg_oid; static char msg[] = "System Working"; msg_oid.len = LWIP_ARRAYSIZE(msg_oid_arr); memcpy(msg_oid.id,msg_oid_arr,sizeof(msg_oid_arr)); vb.next = NULL
Hello,I've been adapting the DRP1M1 USB-PD DRP reference design for use on a custom STM32U5A9 Board, and have run into an issue where it seems like ST's compiled USBPD library just stalls during negotiation as a SRC device.Hardware: STM32U5A9, custom board with TCPP03-M20Library: USBPDCORE_PD3_FULL_CM33_wc32.aConfiguration: DRP, PD3.0## ProblemOperating as SRC, the PE state machine sends ACCEPT in response to a REQUEST but never advances to PE_SRC_TRANSITION_SUPPLY. PS_RDY is never sent and the port partner eventually triggers a hard reset.## What We Have Verified**Protocol layer is working correctly:**- SOURCE_CAPABILITIES sent and GOODCRC received- REQUEST received and GOODCRC sent- ACCEPT sent and GOODCRC received- All confirmed on protocol analyzer**All DPM callbacks returning correct values:**- USBPD_DPM_EvaluateRequest() returns USBPD_ACCEPT (verified via debugger)- USBPD_PWR_IF_GetVBUSStatus(USBPD_PWR_VSAFE5V) returns USBPD_TRUE (VBUS at ~4.8V, threshold 4750mV)- USBPD_DPM_SetDa
Title edited to clarify that the "onboard PHY" refers to a Nucleo-H753ZIi have may issues related to implement the ethernet on stm32h753zi mcu like i am not able properly configure the mpu regions and linker script and its ethernet.c file ...and also have issue related to ping the static ip...if any supporting link related to this issue can be provided..that might be helpful
Hello everyone,I am developing a cellular IoT device using STM32L4 + SIM7600G-H 4G module. The goal is to create a highly reliable driver that can handle every possible disconnection, network drop, MQTT event, and recovery scenario without losing data or getting stuck.Requirements:Heavy use of UART DMA (Circular RX buffer + IDLE line detection)Full finite state machine for modem management (Power on → Network → PDP → MQTT → Operational → Recovery)Robust parsing of all URCs (+CMQTTDISC, +CLOSED, registration changes, etc.)MQTT communication with ThingsBoard (telemetry, client attributes, shared attributes, RPC, firmware OTA/FOTA)Reliable reconnection logic with exponential backoff, message queuing during offline periods, and modem watchdog (power cycle on repeated failures)Questions:What is currently the best recommended way in 2026 to implement such a driver on STM32L4?Has anyone successfully used X-CUBE-CELLULAR with SIM7600 series? Is it worth porting, or is it too LPWAN-oriented for
I would like to use the board's built-in microphone to display audio data visualization on an LCD screen. I want to add more display modes later, but at the moment I only have basic waveform time domain display.I use the built-in microphone to record audio, which I then convert to PCM using PDM2PCM middleware. However, there seem to be no correlation between the sound and the pcm values. Whether I speak, turn the music on, or do nothing at all - pcm values are about the same.Moreover, every position in the PCM buffer hovers around the same value. For example, some positions are about ~-11000 no matter what, and the other are about ~20k no matter what. So, the audio visualization is almost flat with some random noise.I assume that there is something wrong with how I use the mic or pdm2pcm. The I2S and middleware settingsExample PCM values The code/* Private variables ---------------------------------------------------------*/ /* USER CODE BEGIN PV */ /* USE
Hello, I was able to successfully implement a way to read motor status and various parameters through UART on putty with my B-G431B-ESC1. However, when I tried following tutorials to add a way to also control the motor status (turning it on and off), I keep getting no response from the motor when I type commands in putty. I don't know if something is wrong with my code or with the way I set up putty, but im leaning more towards the code since the TX part works well. Im quite a beginner with this so maybe its something very ***, but i really cant wrap my head around it. Linked to the post is my main.c. thank you.
Hello, I am developing a project using the TCPP03 (X-NUCLEO-DRP1M1) and the ST USB-PD stack on an STM32G0 with FreeRTOS. I am concerned about the thread safety of the FLGn interrupt handling. In the standard BSP examples, the EXTI interrupt calls BSP_USBPD_PWR_EventCallback(). I2C Contention: Since BSP_USBPD_PWR_EventCallback() performs blocking I2C reads (ReadFlagRegister), what prevents the PE_Task or CAD_Task from attempting an I2C transaction at the same time? ISR Safety: In an RTOS environment, is it considered safe to perform blocking I2C calls inside the FLGn ISR, given the risk of HAL_BUSY or kernel priority issues? Best Practice: Does ST recommend a Deferred Interrupt pattern (e.g., using USBPD_DPM_CADTaskWakeUp) to move the I2C diagnostic logic out of the ISR and into a thread context?
Hello, I am following this guide:How to integrate TouchGFX and camera middleware on an STM32N6570-DK and seem to be getting an I2C1 undefined reference (below). Is there something I need to change? I have I2C2 enabled in my .ioc, but don't see anything about enabling I2C1C:/TouchGFXProjects/VisionControlboard/STM32CubeIDE/Appli/Debug/../Middlewares/stm32-mw-camera/cmw_camera_customized.c:1951:(.text.CMW_CAMERA_IMX335_Init+0x144): undefined reference to `BSP_I2C1_Init' C:/ST/STM32CubeIDE_2.0.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: C:/TouchGFXProjects/VisionControlboard/STM32CubeIDE/Appli/Debug/../Middlewares/stm32-mw-camera/cmw_camera_customized.c:1951:(.text.CMW_CAMERA_IMX335_Init+0x148): undefined reference to `BSP_I2C1_DeInit' C:/ST/STM32CubeIDE_2.0.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltool
I need to use an external loader via single SPI for a project. Despite performing all the necessary steps. I'm getting an error through CubeProgrammmer./* Entry Point */ ENTRY(Init) /* Generate 2 segment for Loader code and device info */ PHDRS {Loader PT_LOAD ; SgInfo PT_LOAD ; } /* Highest address of the user mode stack */ _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */ /* Generate a link error if heap and stack don't fit into RAM */ _Min_Heap_Size = 0x200; /* required amount of heap */ _Min_Stack_Size = 0x400; /* required amount of stack */ /* Specify the memory areas */ MEMORY { RAM (xrw) : ORIGIN = 0x20000004, LENGTH = 112K-4 } /* Define output sections */ SECTIONS { /* The startup code goes first into FLASH */ .isr_vector : { . = . + 0x1FC; . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); } >RAM :Loader .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >RAM .ARM : { __exidx_start = .; *(.ARM.exidx*) __exidx_end = .;
Hi,I spent a few days trying to make Ux_Device_HID and Ux_Device_HID_Standalone to work on Ubuntu with latest versions of CubeMX and Cube IDE (STM32CubeIDE Version: 2.1.1, STM32CubeMX 6.17.0)The only way I managed Ux_Device_HID to work on NUCLEO-H723ZG was by the following steps:start MXselect example for nucleo board and start project directly in CubeIDE (not doing anything in CubeMX)compile project in CubeIDE without any changesflash to the board and it worksHowever, if I want to open it in CubeMX and generate code even without any changes - the resulting code does not work at all. I used git to do diff and changes are all over..Of course I could do changes in CubeIDE directly without nice MX interface, but I kind of like it simple ))Anyway, could someone form ST explain why *.ioc file from example cannot be used with Cube MX to generate a working code?
I am devoloping a low-power motion detector device using the STM32L071 mcu.The PIR sensor wakes up the system through wake-up pin, and after completing the RF packet transmission, the system goes back to sleep. In other words, I have a system that continuously switches between standby and run modes.How should I implement the watchdog in such a system ?I don't want the watchdog to keep counting while the MCU is in standby mode. I only it to run during run mode.My code like this (bare metal): int main(void) { /* USER CODE BEGIN 1 */ config_getresetflags(); /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ ws_register_sensor_driver(&ws_door_driver); ws_init_mx(); ws_wkp_src(); ws_init_se
Hello,In this file, the line:USBx_HC((uint32_t)ch_num)->HCSPLT |= USB_OTG_HCSPLT_XACTPOS_Pos;wrongly alters bits 1 to 3 of register HCSPLTThat can be fixed simply by removing this line, since middle payload is encoded by bits 00 in the XACTPOS field.
I am using STM32CubeMX 6.16.1 to configure a project for STM32F415.I use the FATFS on SD card and set it up as:According to FATFS documentation (https://elm-chan.org/fsw/ff/doc/config.html#lfn_unicode), the data type TCHAR should translate to char in this case. However, CubeMX generates Middlewares/Third_Party/FatFs/src/ff.h in which TCHAR is defined as WCHAR, i.e. a 16-bit type:The _STRF_ENCODE is correctly defined as 3 in FATFS/Target/ffconf.h, which corresponds to UTF-8:Is this a bug? How can I ensure that UTF-8 uses the 8-bit data type correctly?
Hello, I am working on an application that uses the SDMMC peripheral to read the contents alternating audio files every 150ms. The buffers i have to store the data are large enough to store the entire file in a single burst within RAM. The problem I am running into is that intermittently, the sound "loops" indicating a lockup on the sound subsytem. I've added a small timer in SysTick in order to quantify how long and often this lockup occurs as the logic is running in a lower priority interrupt. I find that the system locks up between 300ms-1200ms. When I listen for this audibly and stop the code, I find that the code is stuck in:if(BSP_SD_ReadBlocks_DMA((uint32_t*)buff, (uint32_t) (sector), count) == MSD_OK) { ReadStatus = 0; /* Wait that the reading process is completed or a timeout occurs */ timeout = HAL_GetTick(); while((ReadStatus == 0) && ((HAL_GetTick() - timeout) < SD_TIMEOUT)) { } /* in case of a timeout return error */ if (ReadStatus == 0) { res
On line 1695 of stm32h5xx_hal_eth.c ETH_MACTSCR_TSUPDT is used to set the timestamp counter, however page 2934 of RM0481 says this bit is used to add or subtract from the timestamp counter instead:Based on the description of this function, and its use elsewhere, this function should instead use ETH_MACTSCR_TSINIT to overwrite the timestamp counter. As it is at the moment, the current time is added to the counter every time there is a PTP sync meaning the time fluctuates wildly over a century and a half span, and the time is never close enough to use fine adjustment methods.Also consider adding a line to enable PLL1Q's output to the HAL Ethernet init function, that was another fun bug to track down...
So along time ago I created a very helpful program using an STm32H743ZI nucelo board. Then - STM discontinued that board -- GRRRR The recommended solution was:NUCELO-H755ZI-Q - so I purchased 4 of these. PROBLEM there are no usable examples in the STM32 cube suite that works with this board. I need to port my old STM32H743 code to this new chip GRRR Ok that should be easy. Turns out there is a huge problem with using this board because of the power supply, the key feature I need is exactly the ETHERNET interface. BUT - cubesuite does not have a ETHERNET example I can start from.. ie: that properly initializes the board to run at "some fast speed (i do not really care, speed is not important, I just need the 100mbit ethernet to work). The specific problem I had was I programed my board and evidently it locks the board up hard, jtag no longer works. The solution is to use a jumper force the chip into "BOOTLOADER MODE" then JTAG works again and I can flash-erase the chip via JTAG. I do no
I am working on an STM32F746G-Discovery board using LwIP (2.1.2) and FreeRTOS (CMSIS-RTOS V1) generated via STM32CubeMX. I am facing a persistent issue where the gnetif.ip_addr.addr field is populated with a garbage/static value before DHCP can complete, specifically 0xf44fd102. The Issue: Even after performing a memset(&gnetif, 0, sizeof(struct netif)) before MX_LWIP_Init(), the debugger consistently reports the following for the IP address variable: Hex: 0xf44fd102 Decimal: -196095742 Translated IP: 244.79.209.2 (Multicast) It appears the Ethernet DMA is writing multicast network traffic into the memory space allocated for gnetif, or I am facing a D-Cache coherency issue where the CPU is reading "stale" data from a previous boot/session. Current Configuration: CPU: STM32F746NGH6 (Cortex-M7) Cache: I-Cache and D-Cache enabled in main.c. PHY: LAN8742A (RMII mode). Clock: 216MHz (HSE used as source). MPU: I have attempted to configure the MPU to set the SRAM1 regio
Hello,i did the OEMiROT examples following How to start with OEMiRoT on STM32C5 using CMake by converting the EWARM project config. I would like to give that CMake config back as well as some fixes to the provisioning script / example_config. Where/How do I that?I know the GitHub Repo, however since there are no open/close tickets, I wounder if that is the right place.
Hello, I ran into an issue when testing a UART application on a STM32C562RE in loopback mode with RTS and CTS enabled. The app does the following:1. Start receiving 1 character at a time by using HAL_UART_Receive_IT.2. Send a string 3. After the received character is printed out I issue another call HAL_UART_Receive_IT.Everything works fine; the app prints out the string I sent. I wanted to make sure the hardware flow control was running correctly so I placed a HAL_Delay(1) after I print out the character received and before I issue a new call to HAL_UART_Receive_IT. This should stop the transmitter due to the CTS -> 1 (no more room in the Rx buffer) and it should restart it after I issue the HAL_UART_Receive_IT CTS -> 0 due to available room in the Rx buffer; and, it does. All the characters are received as expected however HAL_UART_Receive_IT returns HAL_ERROR. Everything seems normal except the error returned by HAL_UART_Receive_IT.I de
I have troubles using SPI3 on STM32U575VG. After some time the transfer hangs and it is not possible to amend it until whole reset.Configuration: Only transmit, is feeds LCD display, 240 lines, 54 bytes each.APB3 clock 48 MHz. Manual CS handling, SCLK 1.5 MHz.Everything looks ok, it works, but after some time and on some boards only it hangs. The problem appeared in the start of production. Symptoms: after configuration and LL_SPI_Enable(), the DMA transfers 16 bytes to the FIFO. That's ok, DMA works. But after LL_SPI_StartMasterTransfer(), the transfer doesn't start.Looking at the pins, SCLK remains low and MOSI contains some data, but very slow, one bit interval seems to be 8 ms. Reset of the SPI doesn't help. Reinit of the whole MCU after STOP2 (without reset), including all clocks doesn't help. The only thing that works is the reset of the whole MCU. I have no idea where to look at more. The SPI is not overclocked, it doesn't wait for any external signal. It happens sometimes
Hi,I am using one ADC with multiple channels on an STM32 device. I configured a timer trigger (external trigger) for the ADC, but I noticed that the trigger seems to apply to all channels of the same ADC, not just the selected channel.I would like to confirm:Is it true that one ADC has only one trigger source, and all configured channels share that trigger?Is it possible to configure different sampling/trigger properties per channel, or is the external trigger common for the entire ADC conversion sequence?My goal is to use different trigger timing per channel, but I am using only one ADC peripheral.Thank you.
Hi,I am building a program that can flash new firmware onto a STM32H743ZIT6 via CAN. It does so by utilizing the dual bank feature and ping-ponging between bank 1 and bank 2. It receives the firmware via CAN and buffers it. Before writing it to the inactive bank it first erases said bank.When running form bank 1 this works just fine and it is able to reboot to the newly flashed bank. When going from bank 2 back to bank 1 however, it encounters an issue. It crashes in the erase step and will not restart.After I manually disable the SWAP_BANK bit using STM32CubeProgrammer it runs again on bank 1 without flashing again. This (I think) tells me it is deleting bank 2 while also running on it.Attached you find the function in question, do you have any idea where i went wrong? void foc_erase_inactive_bank() { // Determine inactive bank from SWAP_BANK bit uint8_t inactive_bank = (FLASH->OPTCR & FLASH_OPTCR_SWAP_BANK) ? 1 : 2; uint32_t bank_to_erase = (inactive_bank == 1) ? FLASH
Hello All,On the STM32U575 is there any guidance regarding use of external resistors? I don't see any on the reference design so I didn't put it on my board either. USB data rates are fairly slow, is impedance matching even required?We are using TinyUSB so that we can avoid the RTOS and it works fine mostly, but occasional USB disconnects. We discovered by accident using a longer cable seems to resolve this. I am wondering if it is a fluke or if there is some rational reason for this.Thanks!
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.