Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi Forum! Previous experiments, but it still could not work, I have no idea how to fix this problem:https://community.st.com/t5/stm32-mcus-embedded-software/hmd-application-stm32f1-with-bno055-via-vcp/td-p/876235 Therefore, I revisited the literature review. I found this paper from meta oculus, they using the HID to transfer the IMU data, so I want to imitate their steps. (using notebookLm to learn it )https://msl.cs.illinois.edu/~lavalle/papers/LavYerKatAnt14.pdf HID read/write tool(software)https://github.com/benbaker76/SimpleHIDWrite Problem: Custom HID could be detected by host, the IMU could send the data at 100Hz, host could send the data to STM32 MCU, but only the first time was successful, the second time will let the HID read/write tool(software) crash, STM32 could send data after receiving the data first time. ----------------------------------------------------------------------------------------------------------------------------------------------------------
Hello ST,I'm trying to communicate the STM32F411RET6 with IMP34DT05 mic, i have enabled the I2S in ioc configuration, i have downloaded and added the library file from https://www.st.com/en/embedded-software/x-cube-memsmic1.html, while building the project getting 15000+errors coming, i'm assuming this library file is incorrect, could you please review as attached and provide Specific working library for this project.Advance Thanks,Sridhar.
Hello ST community, I configured my project in STM32CubeMX 6.17.0 and use STM32CubeIDE 2.1.1 to debug. The goal of the program is to receive a raw ethernet frame.I followed this tutorial, of course I adapted the pins to NUCLEO-N657X0-Q, and I skipped the part with the transmission, I didn't change anything in the HAL_ETH functions. I am sending from the PC (I can see that the frame is sended with wireshark):from scapy.layers.l2 import Ether from scapy.packet import Raw from scapy.sendrecv import sendp #Terminal ipconfig /all dst_mac = "00:80:E1:00:00:00" src_mac = "AA:79:39:37:92:EA" payload = bytes([0x01] * 86) frame = Ether(dst=dst_mac, src=src_mac, type=0x88B5)/Raw(payload) sendp(frame, iface="Intel(R) Ethernet Connection (13) I219-LM", verbose=True)I placed a breakpoint in :void HAL_ETH_RxCpltCallback(ETH_HandleTypeDef * heth) { }This callback should be executed when an Ethernet packet is received, but it never happened.I also tried by defining USE_HAL
This is an improvement request post.STM32 HAL on every family has tons of following code constructs:tickstart = HAL_GetTick(); while (!condition) { if ((HAL_GetTick() - tickstart) > TIMEOUT_VALUE) { return HAL_TIMEOUT; } }When using HAL with (Free)RTOS or interrupt based scheduler, then these while loops delay same priority tasks (until time-slicing kicks in), block everything that has lower preemption priority, waste energy (crucial for battery powered devices) and decrease responsiveness.There are multiple ways to improve it. One of the simplest is to supplement non-critical* loops with optional user-definable yield macros.__weak void HAL_Yield(void) { } tickstart = HAL_GetTick(); while (!condition) { if ((HAL_GetTick() - tickstart) > TIMEOUT_VALUE) { return HAL_TIMEOUT; } HAL_Yield(); }Now user can implement something like this when using CMSIS OS v2 API:#include "cmsis_os2.h" void HAL_Yield(void) { /* Kernel running and call not from ISR? */ if ((osKernelG
Hi everyone, I am currently developing an image capture project using the STM32N657 (Cortex-M55) and have encountered an extremely bizarre DMA2D write issue (a silent failure). Goal: Use DMA2D (M2M_PFC) to convert an RGB565 buffer to RGB888 and write it to CPUAXI_RAM1 (0x34080000). [Problem Description] I wrote a "minimal isolation test" to bypass all camera/GPDMA variables. I forced the CPU to fill the source buffer with pure white (0xFFFFFFFF), and then manually triggered the DMA2D to transfer it to the destination buffer. The Result: The DMA2D finishes successfully. The DMA2D->ISR register reads 0x00000002 (the TCIF Transfer Complete Interrupt Flag is set, and there are NO Transfer Errors). However, the destination buffer remains completely filled with 0x00000000. [Troubleshooting Done] To isolate the issue, I have verified the following, but the problem persists: CPU Read/Write Test (Pass): Before triggering the DMA2D, I forced the CPU to write 0xDEADBEEF to the destinatio
Title edited to clarify this is about CMSIS-RTOSHello, everybody!I don't know where to look for information on which CMSIS versions are supported by specific STM32 microcontrollers. I asked one of the ST employees and STM32 Sidekick about this, and I got no definitive answers.STM software tools confuse me further. For example, STM32CubeMX (6.17.0) allows me to choose CMSISv2 the interface for FreeRTOS in my STM32F769I‑DISCO board project, but LwIP in the same project does not see the operating system used unless I change the CMSIS version to v1 (you can find more details about this specific issue in this thread). I couldn't find any document that would say which interfaces are supported by LwIP either.That's why I would like to ask You, where should I look for information about which CMSIS versions are supported by specific STM MCUs and, ideally, middlewares and software packages?
I configured a nucleato-L152RE LED program using CubeMX6.17+STM32L1 Firmware Package V1.10.6 and found that the program kept restarting automatically. After adding the following code to the SystemInit() function generated by CubeMX, the problem was solved. What is the reason for this? And my other projects never need to include this line of code, such as F103, F411, G431, L051, and so on.SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET;
Dear all,I have a working camera + video encoder solution running with LCD display disabled.I have one preview thread that displays camera data on the LCD, this thread can be suspended and restarted. While the first run looks fine, the output has a green tint from the second start on:First iteration: Second+ iteration: The code is quite straigh-forward, initializing the hw blocks as needed and freeing resources when it is stopped:void ui_thread_func(ULONG arg) { while (1) { run_ui(); // wait until being woken again: tx_thread_suspend(&ui_thread); } } #define FRAME_BASE 0x34050000 #define FRAME_SIZE ( 800 * 480 * 2 ) #define FRAME_0 (FRAME_BASE) #define FRAME_1 (FRAME_BASE + (FRAME_SIZE)) static void run_ui() { /* Initialize camera */ if(BSP_CAMERA_Init(0, CAMERA_R2592x1944, CAMERA_PF_RAW_RGGB10) != BSP_ERROR_NONE){ Error_Handler(); } /* start camera acquisition */ if(BSP_CAMERA_DoubleBufferStart(0, (uint8_t *)(FRAME_0),(uint8_t *)(FRAME_1), CAMERA_MODE
Hello STM Community,I am a beginner working with the STM32H7B3I-EVAL evaluation board based on the STM32H7B3LIH6Q MCU, and I am currently setting up my development environment on Ubuntu 24.04.3 LTS.I installed STM32CubeIDE 1.18.0 using the following installer:st-stm32cubeide_1.18.0_24413_20250227_1633_amd64.sh.zipI am facing a few issues and would really appreciate your guidance.1. Need existing demo codes for STM32H7B3I-EVALI would like to get the existing/demo example codes available for this board, especially the examples related to the firmware version currently flashed on my board, which shows:Firmware Version: V1.0.1Could anyone please guide me on where to find the exact demo code corresponding to the factory-flashed board behavior, if available?I am specifically looking for separate demo examples for:LEDADCGPIOUARTSPII2CTFT/LCDTouchCameraWi-Fiother onboard peripheralsI am using Linux Ubuntu 24.04.3 LTS, so Linux-compatible steps would be very helpful.At the moment, I mainly need
Hello, What HAL2 API can I use to turn on/off the output of a timer? In HAL (ver 1) this could have been done like this:TIMx->CCER &= ~TIM_CCER_CC1E; // Example for Channel 1: ~TIM_CCER_CC1E // or __HAL_TIM_MOE_DISABLE(&htimx); Thank you,-Gil
I've been using a nucleo l476rg with a LIS2DUX12 sensor and I need to use the SPI protocol, but came as a surprise that the MISO line is not working. When it's not getting 0xFF (should be 0x47), gets inconsistent values. Tried changing CPHA, CPOL, prescale and none of that is working.// 1. Tx and Rx arrays uint8_t tx_wakeup[2] = {0x3E, 0x01}; // Register 0x3E, value0x01 (Soft Power-Down) uint8_t tx_whoami[2] = {0x8F, 0x00}; // Read 0x0F (WHO_AM_I) uint8_t rx_buffer[2] = {0x00, 0x00}; char msg[50]; HAL_Delay(100); // Wake up sequence HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_RESET); HAL_SPI_Transmit(&hspi1, tx_wakeup, 2, 100); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET); // Read who_am_i HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_RESET); //HAL_SPI_TransmitReceive(&hspi1, tx_whoami, rx_buffer, 2, 100); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET); // print data sprintf(msg, "WHO_AM_I = 0x%02X\r\n", rx_buffer[1]); HAL_UART_Transmit(&huar
Hello my friends, I hope you are doing great.I am trying to create a custom driver for UART peripheral with CMSIS register header files.I have created a build system using the board files and linkers and make. So far I have been able to make drivers for the GPIO pins.Now I am trying to create my own driver for the UART peripheral via the CMSIS. So far I have created this: int uart_params_init(uart_t *uart){ if (!uart) return -1; // defualt configs: uart->tx_pin = 9; uart->rx_pin = 10; uart->baudrate = 115200; uart->tx_port = GPIOA; uart->rx_port = GPIOA; uart->instance = USART1; uart->tx_af = 1; uart->rx_af = 1; return 0; } int uart_init(uart_t *uart) { if (!uart || !uart->tx_port || !uart->rx_port) return -1; if (uart_initialized) return 0; // Enable GPIO clocks for the port: if (uart->tx_port == GPIOA || uart->rx_port == GPIOA){ RCC->IOPENR |= RCC_IOPENR_GPIOAEN; } else if (uart->tx_port == GPIOB || uart->rx_po
Hi, I am using the STM32N6570-DK development kit and I want to flash my FSBL and Application firmware into external flash using USB. Currently, I am able to flash the firmware using ST-LINK, but I want to perform flashing through USB as well. I configured the boot pins as mentioned in the datasheet: BOOT0 = High BOOT1 = Low Current behavior The device is detected in STM32CubeProgrammer when connected via USB. USB connection is successful. Partitions such as FSBL, RSSE_FW, RSSE_BLOB, RSSE_PLUGIN, etc., are visible. However, the Download / Erasing & Programming option is disabled. Questions Is flashing external flash through USB supported on STM32N6570-DK? Do I need to configure any OTP boot source or BOOTROM settings to enable USB flashing? Any guidance or examples on how to enable external flash programming via USB would be very helpful.Thank you.
Hey ST-Community,I’m working with an STM32H7S78-DK board and trying to get Ethernet running. TouchGFX and FreeRTOS are working fine, but I’m stuck with lwIP. The task starts, but DHCP never succeeds (the printed IP is always 0.0.0.0). I also tried with a static IP, but I still can’t ping the board. Deactivating TouchGFX didn't help.I've followed this video: STM32 : How to Get an IP Address via DHCP on STM32H7S78-DK with LwIP using IAR EWARMLwIP has the following memory settings:MEM_SIZE = 14*1024BytesTCPIP_THREAD_SIZE = 4 * 1024BytesI've configured the MPU as well following the given Video.I’m not sure where to look next – maybe I’m missing some configuration step? Has anyone successfully used lwIP with this board and could give me a hint?Thanks a lot in advance!
Hello I am trying to implement I²C slave on a STM32U385RGTxQ in non-blocking mode, on I2C2.To match I²C standard I tried to use the Address macthed interruption but the interruption is never trigged. I used the function HAL_I2C_EnableListen_IT(&hi2c2) to enabled it; My issue is, I don't reach neither the I2C2_EV_IRQHandler(void), the I2C2_ER_IRQHandler(void) or the HAL_I2C_AddrCallback() when sending the slave address. Please found attached my project. And bellow some pictures of my I2C2 init, an oscilloscope capture and my I2C2 register when I am in debugger : Best Regards Thibaud HABRAND
I am not able to erase a section of internal flash of the NUCLEO-H633RE.Using the debugger I see the Flash is all 0x00 before I try to erase. I verify that Flash is not locked i.e.if (*FLASH_NSCR && LOCK) { *FLASH_NSKEYR = 0x45670123; *FLASH_NSKEYR = 0xcdef89ab; }then I try to erase a section of Flash i.e./* ************************************************************************* */ /* */ /* EraseFla - Erases 8K page of Flash, Waits for Flash not busy. */ /* Inputs: uint32_t page holds the page to erase. */ /* Outputs: None */ /* */ /* ************************************************************************* */ void EraseFla(int EraPage) { while (*FLASH_NSCR && BSY){}; n = *FLASH_PRIVCFGR; // just testing n = EraPage >> 7; if (n && 0x0800) { n &= 0x07C0; n |= 0x80000004;} // BKSEL and SER else { n &= 0x07C0; n |= 0x00000004;} *FLASH_NSCR |= n; *FLASH_NSCR |= STRT; while (*FLASH_NSCR && BSY){}; } With the debugg
English language:STM32H7 Ethernet + DMA + Cache Explained + LwIP (EN) One of the most common sources of confusion when working with STM32H7 microcontrollers and Ethernet (via LwIP + HAL ETH) is data cache (D-Cache) behavior.When using DMA (like Ethernet MAC DMA), if D-Cache is enabled (which it is by default in STM32H7 projects), you must manage cache coherency manually. Otherwise, the DMA peripheral and the CPU will not agree on what data is in RAM.I encountered this exact issue myself and spent significant time identifying the root cause. Since many others using STM32H7 are likely to face this same problem, I'm sharing this explanation to help save your time and effort.Problem:If you fill a pbuf->payload buffer with data and send it using HAL_ETH_Transmit() without cleaning the D-Cache, the CPU will still be holding the most recent data in its cache, but the DMA will read stale or uninitialized data from RAM.Result: corrupted Ethernet frames, broken ping replies, UDP iss
Hello, Using STM32F4 USB USB_OTG_HS, PCD_SPEED_FULL for USB Device CDC we are transmitting data to Host.After some minutes the transmission gets stuck. Although the TXFE IRQ is received, no XFRC IRQ happens and consequently TX state is not set back to 0. The DTXFSTS counter stays on 0x40 (empty is 0x80).The USB trace looks normal. When the problem occurs the peripheral answers all IN Transactions with a NAK.Why does the peripheral not transmit the data but does NAK instead?The problem is seen with different types of Hosts (PC or other embedded devices).Attached Log Output and Screenshot of the Trace.HAL 2.4.2 us used. The TxState fix was applied (Enable/Disable IRQ moved to USBD_CDC_TransmitPacket)Many thanks for any help.
Hi@all Curently i was using STM32F407VGTX but i found that there is no support of snmpv3 on this board so i decided to go for stm32H753ZI. Kindly please suggest that does this board supports snmpv3 or not and if not please suggest me the board that supports snmpv3 i want to deploy in my products
Hello,I currently need to transfer ADC data from a nucleo-n657x0Q to a PC. I've configured the stm32n6 using ST's example on GitHub, but I still don't know how to use the `ux_device_class_cdc_acm_write` function to transfer the data.Can anyone guide me on how to transfer data using this USB HS?
Hello Community, I am working on an STM32N657X0H3Q project and have successfully configured both USBX and X-CUBE-FREERTOS (v1.4.0) within the same Application runtime context using CubeMX. My goal is to implement a USB CDC Composite device. Since USBX traditionally relies on Azure RTOS (ThreadX) for its RTOS primitives, I am seeking the recommended best practice for running USBX on a FreeRTOS-based system. Should I configure USBX in standalone mode? If running USBX in Standalone mode, what is the best way to handle thread safety when accessing the USB CDC interface from multiple FreeRTOS tasks? Are there any known issues using the USBX Composite Builder when the underlying kernel is FreeRTOS instead of ThreadX?
I am using STM32H7R7L8H with MX25L12833F external memory. I created a project with has bootloader, application and external memory loader.Before starting this project I opened another to test if I can read/write/erase MX25L12833F. By using XSPI in Quad mode I could do all the operations. Below I shared the configuration: XSPI1: EXTMEM_LOADER: EXTMEM_MANAGER: With this configuration I built the project and it generated external loader. In STM32CubeProgrammer I can read MX25L12833F memory, it can do mass erase too but it can't do sector erase. I created an application hex which is located at 0x90000000 and tried to write this file to external memory by using generated loader. Here is the result: 00:51:51 : Opening and parsing file: Appli.hex 00:51:51 : Memory Programming ... 00:51:51 : File : Appli.hex 00:51:51 : Size : 8.54 KB 00:51:51 : Address &n
Hardware: STM32G473QETXHAL Version: STM32G4 HALI2C Mode: Slave mode using HAL_I2C_Slave_Seq_Receive_IT()Application: DS1307 RTC emulation Issue DescriptionWhen implementing an I2C slave device (DS1307 RTC emulation), we observe that HAL_I2C_ErrorCallback() is consistently called with error code HAL_I2C_ERROR_AF (0x00000004 - Acknowledge Failure) at the end of successful write transactions from the I2C master Transaction FlowMaster sends START + Address (0x68) + WRITESlave ACKs (address match detected)Master sends data bytes (8 bytes total)Slave receives all bytes correctly via HAL_I2C_SlaveRxCpltCallback()Master sends NACK (to signal end of write)Master sends STOPHAL_I2C_ErrorCallback() is called with HAL_I2C_ERROR_AFHAL_I2C_ListenCpltCallback() is also calledExpected BehaviorAccording to I2C protocol, the master sending NACK at the end of a write transaction is normal behavior to signal "I don't want to send more data." This should not be reported as an e
I am using the STM32L433 MCU and both the HID and VCP interfaces are not working even though the DFU is.I am simply using the STM32CubeMX software to generate a standard default USB Setup but I keep getting the same Windows USB Error "USB Device Not Recognised" which is the "Device Descriptor request failed".My hardware is a custom design and believe that I have the correct differential impedance or the DFU would not have worked. VBUS is at 3.3V (<4V)D+/D- traces > 2 inches but differential impedance has been matched to 90 Ohms using Altium.I have a 12MHZ Crystal, the MCU can run Crystal-less.USB is 48MHz but runs from RC, also used PLLSA1 from HSE.STM32CubeIDE v2.1.1MX_USB_DEVICE_Init() called. If the DFU is working then why not the other USB Interfaces?
Hi ST Community,,I’m working with the STM32N6570-DK board and trying to implement a USB Video Class (UVC) device.From my exploration in STM32CubeMX, I couldn’t find any native option to enable or generate a UVC class . Based on this, my understanding is:UVC is not directly supported in STM32CubeMXIt may require manual porting (e.g., from X-CUBE-WEBCAM or other examples)Could you please confirm:Is UVC officially supported on STM32N6570-DK?Is there any roadmap to include UVC support in STM32CubeMX?Are there any reference implementations (for STM32N6 or similar series) available?What is the recommended approach:Should we start from a CubeMX-generated USB project and manually integrate UVC class?Or is there a preferred middleware/package for this?Additionally, it would be very helpful if you could outline the high-level steps for implementing UVC on this platform .
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.