Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello everyone,I apologize for posting a similar message again, but for some reason I can no longer access my previous post.I am currently studying how my Nucleo N657X0-Q board works, and for this purpose I am trying to create a TCP server project using a static IP address.However, despite what seems to be a correct configuration, my board does not respond to ARP requests. I checked this using Wireshark and the arping command on Linux, but the result is always TIMEOUT.The MAC address seems to be correctly configured, the LAN8742 driver also appears to start correctly, and all IP, TCP, UDP, ARP, and ICMP services return SUCCESS.In the meantime, I also used the .ioc file from the following link, as suggested to me, in order to compare it with my own project : webserver Despite my new modifications, the symptoms remain the same. I also tested the steps performed in the nx_stm32_eth_driver code, and I was able to see that Initialize, Enable, and Attach are being called.I added a printf out
I am trying to interface the EEPROM AT24C04C with STM32G4 series controllers. I have confusion in the function parametersHAL_StatusTypeDef HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size)Can you please clarify on the MemAddSize parameter what has to be sent to for the above EEPROM?2nd Question: 1 page is 16 bytes, is it possible for me to write data above 16 bytes as well?
I am using an STM32 Nucleo-F746ZG board and trying to establish a TCP/IP connection between the board and my laptop. The laptop is configured as the TCP server using Hercules tool, while the STM32 board acts as the TCP client. I have configured static IP addresses, and I am able to successfully ping the STM32 board from my laptop, which confirms basic network connectivity. However, when I start the TCP server on the laptop using Hercules, the STM32 client is unable to establish a connection to the server.I attach code and .ioc configuration for reference.
Several discussions on this topic have been lost in the forums transition, or not moved yet, I could not find them here. So I’ll post again to summarize.In recent changes of the Cube ETH drivers for several STM32 packages (H7, F7, maybe others as well) handling of ETH_MACFilterConfigTypeDef.BroadcastFilter seems to be corrected.The BroadcastFilter = ENABLE means that broadcast receive is blocked. This field should be left DISABLED.The hardware defaults are good for typical (UDP, TCP) apps. Especially, receive of broadcasts is enabled. In ethernetif.c of the ST LwIP examples, HAL_ETH_SetMACFilterConfig() is not called, because the default state is OK.The problem could occur with the old versions of HAL drivers, when the network software tampers with multicasts and other advanced filtering and calls HAL_ETH_GetMACFilterConfig - this one could return the BroadcastFilter bit inverted, so calling HAL_ETH_SetMACFilterConfig again with result of HAL_ETH_GetMACFilterConfig could block broadca
I would like to use the Stop3 low-power mode on an STM32U545RE (NUCLEO-U545RE-Q board) and to wake-up the device by the RTC. I have a working example for Stop2 mode for which I largely used the inspiration from the stm32u5 workshop. But when I replace the HAL_PWREx_EnterSTOP2Mode call(s) with HAL_PWREx_EnterSTOP3Mode, the device does not wake up from the stop mode anymore. At least the current consumption drops down to 3uA so I am confident that the Stop3 mode itself is working.The code parts of my main function which I believe are relevant look as follows:HAL_Init();SystemClock_Config();SystemPower_Config();MX_GPIO_Init();MX_ICACHE_Init();MX_RTC_Init();/* The SMPS regulator supplies the Vcore Power Domains */HAL_PWREx_ConfigSupply(PWR_SMPS_SUPPLY);/* Enable ultra low power mode */HAL_PWREx_EnableUltraLowPowerMode();/* Enable the Autonomous Mode for the RTC Stop0/1/2 */__HAL_RCC_RTCAPB_CLKAM_ENABLE();/* Set RTC wakeup timer for 2s */HAL_RTCEx_SetWakeUpTimer_IT(&hrtc,
Hi,I do have two STM32H563 devices connected together via UART. I would like to use one as a ‘programmer/flasher’ and the other as a ‘target’. On the ‘target’ MCU I would like to use an already in-built bootloader available over USART1. The only problem is the programming/flashing implementation on the ‘programming’ MCU. Is there any example code available somewhere that contains such an implementation? I can see that there is this code publicly available:https://github.com/STMicroelectronics/stm32-mw-openbl...but it only contains implementation of the bootloader protocol for the target device, not the programming/flashing one.I am trying to evaluate the effort needed to make such an implementation to happen. I would like to avoid writing my own bootloader with my own custom protocol (although at the moment this seems like an easier option to be honest).Kind regards
Iam triying to capture data using timer+hpdma cofiguration , but hpdma is not working, not copying data .. but the same configuration with gpdma is working fine.. how to configure hpdma any special configuration regarding RIF.. please give some brief explanation
I have a custom board with G491 and an LED driver (Kinetic KTD2037). MCU is the I2C master. Any attempt to read a register using HAL from the KTD2037 fails, ErrorCode = 0x2 (arb lost). Register writes are OK. I can read/write other devices on the same bus OK. The KTD2037 datasheet has this for an I2C register read:This doesn’t seem consistent with HAL_I2C_Mem_Read() or HAL_I2C_Master_Receive(). On a scope HAL_I2C_Mem_Read() results in S, 7-bit addr, write, ack, reg addr, ack, Sr, 7-bit addr, read, ack, 0xFF, nackI try setting the internal register pointer (it may not have one) using HAL_I2C_Master_Transmit(), which works OK. Then I follow it with HAL_I2C_Master_Receive() resulting in S, 7-bit addr, read, ack, 0xFF, nackIt looks like the master says arbitration lost because of unexpected nack from the KtTD037.The KTD2037 datasheet does not mention I2C repeat start.Any way to read this device without writing my own I2C driver?
This is a sister thread to this one.Essentially, I can’t get a ping out of either Nucleo-H755ZI-Q or STM32F779I-EVAL, the other thread focuses on the Eval board.I’ve tried many examples but I’m focusing on this one. There are other threads about this example but I think they may have got lost in the migration.I’ve attached the project as it sits on my computer.The STM32 device’s IP address is 192.168.2.180.If I ping it on my PC, I get Request timed out.This is my network configuration.The Nucleo board is connected to a TP-Link Ethernet switch, which my PC is also connected to.Do you have any idea why this is not working?Thank you.
In many NetX Duo Ethernet sample projects, HAL_ETH_Start_IT() is not called depending onthe timing of the PHY link‑up. When this happens, Ethernet communication never starts.The behavior appears to be related to how App_Link_Thread_Entry() handles link status:- nx_ip_interface_status_check() is used to check the NX_IP_LINK_ENABLED status.- nx_ip_driver_direct_command() issues NX_LINK_ENABLE or NX_LINK_DISABLE when the PHY link state changes.Normal behavior- If the PHY is link-up at startup, HAL_ETH_Start_IT() is called during initialization.- If the PHY is link-down at startup, App_Link_Thread_Entry() later detects the link-up, issues NX_LINK_ENABLE, and HAL_ETH_Start_IT() is called correctly.Problem caseIf the PHY is link-down at startup but becomes link-up before App_Link_Thread_Entry() starts running:- The thread does not issue NX_LINK_ENABLE or NX_LINK_DISABLE.- HAL_ETH_Start_IT() is not called.- Ethernet communication cannot be established.In PoE environments, the power‑on to lin
After an aborted attempt to get the PSSI interface on the STM32N6 to work with DMA, I have decided to try a different part, the STM32H7A. Running into a similar problem attempting to get the DMA to work.Here is a snap-shot of what I see:After receiving HAL_OK from HAL_PSSI_Receive_DMA(). I get the error interrupt with an error code of 0. As may be seen, there is a DMA Transfer error. This is running on the Nucleo-H7A3ZI-Q board. The clock tree has been changed to increase the clock speed:The PSSI clock is produced by a PWM Timer and set to a frequency of 10MHz. Data is from a 12 bit ADC with an active high Ready. DE is not used. I have a pull-up on Ready. With HAL_PSSI_Receive_DMA() in a loop from a frame timer, each call returns HAL_OK followed by the error interrupt.The PSSI setup:The DMA setup:I’ve been studying the examples given on this board for both the H5 and the H7. Whereas the N6 produced an immediate error response to multiple PSSI DMA attempts, the H7A does not. T
Hi all,I'm trying to read the DAC output value using the integrated ADC and the connection to it (channel 19). However, I only read random values between [0;2] units. The DAC works properly using the integrated buffer. I route the DAC output to the external pin and to on-chip analog peripherals, so I can confirm the output with a multimeter. The ADC seems to work properly too: I can read internal temperature, VrefInt, and 2 input pins with scan mode. However, when I enable the VDAC_OUT1 and add it to scan mode, I get random values between 0 and 2 (only for VDAC_OUT1, the other readings are fine). Sample times are abondant (few us); I have tried different sampling values, but, as expected, it doesn’t change anything.I configure this setup with the latest version of CubeMX. Readings and DAC configuration are performed using basic HAL (no interrupt and no DMA).Does anyone have an idea to fix this issue?
Hi everyone,I'm using an STM32H743 in USB device mode as a virtual USB drive (UF2 protocol) for firmware upgrade. Main program runs in Bank 1 Upgrade firmware is written to Bank 2 During the file copy process (from PC to the virtual UF2 disk), the USB connection drops unexpectedly (host resets the bus, captured by USB analyzer).However, if I connect the device through a USB Hub, the success rate improves dramatically.I understand that in dual-bank Flash architecture, erasing or programming Bank 2 should not interfere with: USB peripheral operation (running from Bank 1) AHB bus access Interrupt latency (if properly configured) But my test shows the opposite: Direct connection → frequent host reset Via Hub → mostly works fine Questions: What could cause the host to reset the bus when only the inactive Bank is being erased/programmed? Why does adding a Hub improve reliability — is it signal integrity, power filtering, or host timing tolerance? Could Flash write/erase temporari
Heyho,H723..H735, using DTCM a lot, also ITCM for some functions.Recently I found some strange behaviour:the global pointer sFlashIntCtl.pu8WrBuf to the buffer u8FlashIntPageBuf (global) is set in function A setting the pointer is working, printf via UART later on function A calls function B pointer sFlashIntCtl.pu8WrBuf is not changed anywhere, no IRQ or anywhere first thing function B is doing: check if pointer sFlashIntCtl.pu8WrBuf != NULL check fails, because sFlashIntCtl.pu8WrBuf = 0 (checked via UART, see below) Here’s the UART output:function A UART output:*** start *** wr SPI flash to APP flash&u8FlashIntPageBuf[0] 20000800sFlashIntCtl.pu8WrBuf 20000800 <- this OKAYsOspiFlashCtl.pu8RdBuf 20000800sFlashIntCtl.u32WrAddr 08040000sFlashIntCtl.u32ChkAddr 08040000sOspiFlashCtl.u32RdAddr 00000100sOspiFlashCtl.u32RdLen 32...function A calls function Bfunction B UART output:#E FlashIntWrPage(): pu8WrBuf = NULLsFlashIntCtl.pu8WrBuf 00000000 <- WTF ?&u8FlashI
Hi everyone!I have a project where I start, with the help of the Timer 3, three ADCs(ADC1, ADC2 and ADC4). Each of them samples 256 samples and then stops. Then I disable them and start a calibration process on all three ADCs.This is repeated with a frequency of 4Hz approx. Interesting thing is that after calibration I get very often different calibration values for ADC1, not really often for ADC2 and rarely for ADC4. Like this:60, 61, 6260, 61, 6261, 61, 6260, 61, 6260, 60, 6261, 61, 6261, 61, 6260, 61, 6260, 61, 62...Calibration is done with HAL function from ST. ADCs are turned of during calibration (ADEN = 0). Vref is external(3v) and it is stable, but I believe that offset calculation during calibration does not really use Vref voltage. Or it does?So I’m a bit confused. Is here some ADC guru of Yoda level?I appreciate any help.
I have an external loader with a starting address of 0xA0000000. I can perform read and write operations with this loader using CubeProgrammer. However, when I define the external loader via CubeIDE, it programs the address 0x080000000. Here is my flash.ld The external loader starts working when I start it with the external loader address 0x00000000, but I want to start with 0xA0000000. How can I fix it ?
Hello everyone,I am trying to built a communication through SPI between two stm32g474 mircontrollers in two seperate projects. One should act as a Master and the other as slave. The Master succesfully reads ADC values out and sends it. But unfortunately, the Slave does not Receive it. Here is my Code for Master:/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2026 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 comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes -----------
Hello, I am using the RTC wakeup from the power standby example provided in the STM32C5 repository. The example starts the RTC wake-up timer and places the device in standby mode. The device does go to standby, and it does wake up due to the RTC wakeup interrupt; however, the RTC initialization fails after wakeup. It is worth mentioning that the only way I can get rid of this error is to power cycle the board.The failure happens in HAL_RTC_WAKEUP_SetConfig due to RTC_WaitSyncrhroWUTW() returning an error due to RTC_CR_WUTE being set.static hal_status_t RTC_WaitSynchro_WUTW(void) { uint32_t tickstart; if (LL_RTC_IsActiveFlag_INIT() == 0U) { if (LL_RTC_WAKEUP_IsEnabled() == 1U) { return HAL_ERROR; // Code returns this error } tickstart = HAL_GetTick(); while (LL_RTC_IsActiveFlag_WUTW() == 0U) { if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE) { if (LL_RTC_IsActiveFlag_WUTW() == 0U) { return HAL_ERROR; } } } } return HAL_OK; }To make the examp
Hello, I am trying to make the lpuart1+dma_linked_list transferring data in stop1 mode.My setup is like this: SPI1 + GPDMA: // SPI clocked from HSI Start transfer Enter STOP SCK continues toggling DMA continues Transfer completes DMA irq wakes from stopLPUART1 + GPDMA: // LPUART clocked from LSE Start transfer Enter STOP TX line freezes DMA stops progressing Exit STOP TX resumes Both peripherals are using dma in linked list mode in a similar manner.My understanding is that since both peripherals are “autonomous” they should work in a similar way. I have no problem with the SPI1 working during stop1 mode but the LPUART seems to behave differently.This is my LPUART1 init code: void bsp_lpuart_init(void){ bsp_lpuart1_reset_hard(); LL_LPUART_SetPrescaler(LPUART1, LL_LPUART_PRESCALER_DIV1); // Disable before configuration LL_LPUART_Disable(LPUART1); while (LL_LPUART_IsEnabled(LPUART1)); LPUART1->BRR = 3495; //419430 LL_LPUAR
Heyy, I'm using an STM32u545 (on a Nucleo board), and I'm trying to wake up my MCU from stop 2 mode using wake-up pin 2. Wake-up pin 2 is connected to LPTIM3 (via a jumper wire), and LPTIM3 works. Besides trying to wake up the CPU. An LPBAM application is collecting data using the ADC4 and LPDMA with LPTIM1. Also, it does work. But now I don't know how to wake the CPU using LPTIM3. Did I miss something, or is this not the way to go/ is there an easier way to do this? The program should: - read data on a specific frequency - wake up every two seconds to write the data to an SD card (eventually) Thanks in advance :) int main(void) { /* USER CODE BEGIN 1 */ /* 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 Power */ SystemPower_Config(); /* Configure the sys
Hello,I am working with the official USBX CDC ACM example for the NUCLEO-C071RB:https://github.com/STMicroelectronics/STM32CubeC0/tree/main/Projects/NUCLEO-C071RB/Applications/USBX/Ux_Device_CDC_ACMHardware: STM32C071RBT (128 KB Flash, 24 KB RAM)Firmware: STM32Cube FW_C0 V1.4.0Toolchain: STM32CubeIDE 2.1.1The example runs successfully on the NUCLEO-C071RB board. However, after analyzing the RAM usage I am concerned about available headroom for my application.Current RAM usage (from .map file):- .data: 116 B- .bss: 23628 B (including ux_device_byte_pool_buffer: 8192 B, tx_byte_pool_buffer: 1024 B, three RTOS threads: 3x176 B)- ThreadX heap (._threadx_heap in .ld): 4096 B- Stack + Heap: 1536 B- Total: 23744 B- Free: 832 B (out of 24576 B)Current configuration:- UX_DEVICE_APP_MEM_POOL_SIZE = 8192 (app_azure_rtos_config.h)- USBX_DEVICE_MEMORY_STACK_SIZE = 4096 (app_usbx_device.h)- TX_APP_MEM_POOL_SIZE = 1024- ThreadX heap in .ld = 4096 BI need to add additional peripherals (UART, I2C,
I'm seeing a filesystem corruption issue on an STM32H7 when using FatFs with SDMMC DMA. Hardware / Software STM32H7 SDMMC1 DMA (and MDMA support enabled) FatFs generated by CubeMX D-Cache enabled 8 GB Swissbit industrial SD card Generated sd_diskio.c based on: /* Note: code generation based on sd_diskio_dma_rtos_template_bspv1.c v2.1.4 */ ProblemsThe SD card works normally while mounted: Files can be created Data can be written Data can be read back f_write(), f_sync(), and f_close() all return success However, after: Removing and reinserting the SD card, or Power cycling the system the SD card is detected by Windows as:RAW / Unformattedand must be reformatted before it can be used again.Important observationIf I only perform read operations:Mount cardRead filesPower cycle / reinsert cardthe filesystem remains valid. The corruption only occurs after write operations.Initial investigationBecause the STM32H7 uses D-Cache, I initially suspected cache coherency issues.I
Hi,I have developed an application for the STM32C562RET microcontroller that wakes up from standby mode, initially based on an example provided by ST. The non-FreeRTOS version of this application works fine (though there is a minor wake-up issue that is fixable). Subsequently, I created a FreeRTOS version of the same application that starts a task, and when the user presses a button, the vTaskEndScheduler() function is called to terminate FreeRTOS, which in turn calls void vPortEndScheduler(void) where the wake-up code is implemented. void vPortEndScheduler(void) { HAL_RTC_WAKEUP_Start(HAL_RTC_WAKEUP_IT_ENABLE); LL_PWR_ClearFlag_SB(); HAL_PWR_EnterStandbyMode(); } Despite the fact that FreeRTOS is no longer running, the MCU goes to standby and wakes up immediately.Do you have any suggestions on how to make this work?Thanks,-Gil
Hello everyone, I am new to STM32 development and I am working with the STM32H7A3ZIT6 microcontroller. I need to interface it with a BiSS-C encoder/sensor. I would like to know: Is there any ready-made or full BiSS-C communication library available for STM32? Does STM32CubeMX / HAL provide any support for BiSS-C? If no full library is available, what is the recommended way to implement BiSS-C on STM32H7A3ZIT6? Can BiSS-C be implemented using SPI, timer, DMA, or GPIO bit-banging on this MCU? Any example code, application note, or guidance would be very helpful. Thank you.
I set ETH to be working on RMII_PTP_SYNCHRO, However HAL_ETH_USE_PTP is still not defined by default.
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.