Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi,I'm developing a composite USB device on STM32N6 with:- 2x CDC ACM interfaces (Dual Virtual COM Port)- 1x UVC (USB Video Class) interface for camera streamingThe CDC ports work correctly. The UVC class enumerates successfully and the camera application opens without errors. However, the video stream shows a black screen - no actual frame datais being transmitted. What Works1. USB Composite device enumeration succeeds2. Both CDC ACM ports work (LOG port sends heartbeat, DATA port echoes)3. UVC class registers correctly with USBX4. Host can open camera application (VLC, Cheese, etc.)5. UVC GET_DEF(PROBE) requests are handled correctly6. SET_CUR(PROBE/COMMIT) requests are handled correctly7. StreamChange callback fires when host starts streaming (alt=1)8. Packets are queued via ux_device_class_video_write_payload_get() (returns success)9. ux_device_class_video_transmission_start() returns UX_SUCCESSWhat Doesn't Work→ PayloadDone callback is never triggered→ No video data reaches the ho
I’m trying to use the FMC and SDRAM (IS42S16400J) to expand the H7’s running memory. I have the FMC configured in SystemInit and the linker setup to put all readwrite into SDRAM. I’ve verified that I can create variables normally, they’re placed in SDRAM, and can be read and manipulated normally.Now that I have minimal functionality, I’m starting to add more peripherals and functionality.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 clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_SDMMC2_SD_Init(); MX_USB_OTG_HS_PCD_Init(); MX_FATFS_Init(); /* USER CODE BEGIN 2 */ MX_USB_DEVICE_Init(); /* USER CODE END 2 *
Hi everyone,I am working with the STM32C071 and experiencing problems with USB enumeration after my bootloader execution.I wrote a custom bootloader that performs checks (like CRC, metadata, etc.) and can also trigger the embedded STM32 DFU bootloader in System Memory using this method:void boot_jump_to_bootloader(void){ uint32_t i = 0; void (*SysMemBootJump)(void); uint32_t BootAddrC0 = 0x1FFF0000; __disable_irq(); SysTick->CTRL = 0; HAL_RCC_DeInit(); for (i = 0; i < 8; i++) { if (i < (sizeof(NVIC->ICER) / sizeof(NVIC->ICER[0]))) { NVIC->ICER[i] = 0xFFFFFFFF; NVIC->ICPR[i] = 0xFFFFFFFF; } } __enable_irq(); SysMemBootJump = (void (*)(void)) (*((uint32_t*) ((BootAddrC0 + 4)))); __set_MSP(*(uint32_t*) BootAddrC0); SysMemBootJump(); while (1) { /* Code should never reach this loop */ }}After performing my bootloader-specific instructions, I jump to the main firmware application using this f
There seems to be a recurring error in the HAL documentation (e.g. UM2570, but also in others STM32L5?) UM2570 - Rev 2 page 60/2926The description of the flag does not match the flag nameHAL_FDCAN_ERROR_FIFO_EMPTYPut element in full FIFOHAL_FDCAN_ERROR_FIFO_FULLGet element from empty FIFO
My MCU is STM32H753 on custom PCB. It is running at 480 Mhz. I use USB USB_OTG_FS it is clocked by RC48.On “Middleware and Software packs” I have enabled “FATFS”, “FREERTOS” and “USB_HOST”I generated project by using CubeMX 6.17 with “STM32Cube_FW_H7_V1.13.0”.For more details see attached pictures with configurations. I use FreeRTOS function uxTaskGetSystemState to get info about CPU time per task.In my project I have FatFS test module that performs some read write tests. When I check CPU usage I get this numbers for tasks: “fatfs_test” CPU: 43% “USBH_Queue” CPU: 46% left 11% are utilized by GUI.I ran tests with USB DMA enabled and disabled - there is no difference. So, the question is: Is it OK for “USBH_Queue” task to utilize that much CPU when read/write operations in progress??? For example I have similar test for SD-card, and I get this numbers for tasks: “fatfs_test” CPU: 51% “IDLE” CPU: 35% GUI and other tasks CPU: 14%USB OTG FS pinsUSB OTG FS parametersUSB OTG FS NVIC SettingsU
I have activated spread spectrum on two of the three PLLs I’m using in an STM32H7S7 via codeLL_PLL_SpreadSpectrumTypeDef sspr2;LL_PLL_SpreadSpectrumTypeDef sspr3;// in SystemClock_Config LL_RCC_PLL2_EnableSpreadSpectrum(); LL_RCC_PLL3_EnableSpreadSpectrum(); sspr2.DitheringRPDFN = 1; sspr2.DitheringTPDFN = 0; sspr2.IncrementStep = 1200; sspr2.ModulationPeriod = 10; sspr2.SpreadMode = LL_RCC_PLL_SPREAD_CENTER; LL_RCC_PLL2_ConfigSpreadSpectrum(&sspr2); sspr3.DitheringRPDFN = 0; sspr3.DitheringTPDFN = 0; sspr3.IncrementStep = 214; sspr3.ModulationPeriod = 60; sspr3.SpreadMode = LL_RCC_PLL_SPREAD_CENTER; LL_RCC_PLL3_ConfigSpreadSpectrum(&sspr3);Is there a way in CubeMX to activate it to make the settings generated automatically, as everything else I’m using?I’ve checked the RCC section in System Core as well as the Clock Configuration tab, but I can’t see anything regarding spread spectrum
Hello, I wrote a code to erase BANK2 flash memory for STM32G0C1VET6. The thing is that in some cases the erasing part works but in some cases it fails.I wrote the code to be ran in BANK1,the production code will use the proper start address and size, for this testing I’m forcing the erasing to happen in BANK2 for pages 0 and 1. As I commented, in some cases the erasing works, but sometimes there is an error returned by HAL_FLASHEx_Erase, which is HAL_TIMEOUT. I added proper refresh to watchdog and also some PREFETCH calls but even with that the issue persist. Attached is an image of the SR register once the HAL_TIMEOUT is returned. If I continue the execution of the code there is a hard fault caused when calling the HAL_FLASH_Lock (image attached). What could be wrong?I'm using STM32CubeIDE along with Stlink - V3.If the flash is already erased, calling the Erase function could cause the problem?Could it be related to some FLASH latency configurations?bool __attribute__((optimize("O0"))
UART independently working fine but with CAN, it is not working. Even simple welcome msg also no coming over UART . Even when I comment CAN init, issue is there. The error has been conveyed by a member earlier also. Any resolution provided by ST?
This is really a minor one. More an inconvenience than an actual problem. But it would be nice to get it solved, and to gain some understanding of what actually happens.I have a few different applications for various STM32 families, with a homemade bootloader added to it. The bootloaders are placed from address 0x08000000, and the applications begin at a higher address. Typically 0x08010000. The bootloaders and applications run fine. Bootloaders can start the applications, and applications can invoke the bootloaders. No problem there.The only issue I have is when uploading a new application from STM32CubeProgrammer, through the ST-LINK V3. I typically do this when debugging. But when I do it, even if the “Run after programming” checkbox is checked, the microcontroller isn’t started correctly after upload. When I debug this issue, the microcontroller seems to be stuck in an endless loop in the application. (Not the bootloader.)In the code I’m currently working on, this is the place wher
I have followed the instructions in GIT to make ethernet works correctly on STM32H750 (setup TX/RX descriptors and their MPU config, also the LWIP heap and its MPU config, and the RX buffers).Everything seems working correctly after hours of setup and debugging, but the thing that break Ethernet and make it not working is when handling the unicast UDP or the UDP IO stream of OpEner it trigger a BUS Error in MAC DMA and stop everything from working, the explicit communication based on TCP works correctly and doesn’t break the Ethernet.I debugged for days of what could generate a bus fault error, then i find the udp when uses netconn it doesn’t copy the prepared buffer on lwip heap for sendig and in other way it give it directly the address of udp payload from the task stack, and this trigger a Bus Error when calling HAL_ETH_Transmit_IT because the task stack is not DMA accessible.So I made a workarround in low_level_output to detect the payload from outside lwip heap and copy that payl
Hello:Observation (empirical, multiple boundaries confirmed):When placing DMA linked list nodes (36 bytes each = 9 words) sequentially in SRAM1,if a single node spans certain addresses, the GPDMA channel enters DTEF statewhen fetching that node. Confirmed problematic boundaries in SRAM1 (192KB, 0x20000000 - 0x2002FFFF):- 0x20010000 : crossing FAILS- 0x20020000 : crossing FAILS Both boundaries appear at 64KB intervals within SRAM1, which suggeststhat SRAM1 may be internally organized as multiple 64KB blocks/banks. Test cases:Test 1: Node array starting at 0x20011A54 (natural placement)- Nodes 1-1633: within bank containing 0x20010000-0x2001FFFF → OK- Node 1634: spans 0x2001FFF8 - 0x2002001C → FAILS (crosses 0x20020000) Test 2: Node array starting at (0x20010000 - 44)- The first node spans 0x2000FFD4 - 0x2000FFF8 (OK)- The second node spans 0x2000FFF8 - 0x2001001C → FAILS (crosses 0x20010000) Test 3: Node array starting at (0x20010000 - 36)- The first node ends exactly at 0x20010000- No
Device Under Test: PXN V9 Gen2 Steering Wheel (operating in native D-Input mode) Hardware Platform: STM32F446RE Nucleo Board acting as a USB Host. Toolchain: STM32CubeIDE. Driver Framework: Custom embedded USB Host HID stack implemented by extending and adapting the native usbh_hid.c library provided by the STM32Cube firmware package. Analysis Tools: Wireshark with a USBPcap I am attempting to initialize a force feedback (rumble) effect sequence from the STM32 host. According to the USB PID specification, the transaction sequence rules: Send Create New Effect Report (Report ID 0x05) via a Control Out transfer. Read PID Block Load Report (Report ID 0x06) via a Control In transfer to retrieve the allocated Effect Block Index. The Symptom: When performing the Control In transfer to fetch Report ID 0x06, the data payload returned to the STM32 memory buffer is entirely filled with 0x00 bytes instead of a valid allocation status or a non-zero block index handle. No asynchronous data
Hi guys, I’m using lwip libray with netconn api on stm32h7, I want to enable the receive timeout using netconn_set_recvtimeout method. In order to do that LWIP_SO_RECVTIMEO macro should be set to 1 (default value is 0). There is no LWIP_SO_RECVTIMEO macro in the LWIP section of the .ioc file.How can I configure it ? Shoudl I set another macro in the .ioc or should I change LWIP_SO_RECVTIMEO value in the header file ?
custom board, The USB D+ and D− lines are connected directly from the MCU to the USB Type-B connector, with no intermediate components. There is no pull-up resistor on the D+ line, as I understand that the MCU provides the pull-up internallyAs far as I know, the stm32u595 supports USB High-Speed using its internal PHY.CubeMX Version: 6.18.0Reference project:https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/STM32U5G9J-DK2/Applications/USBX/Ux_Device_CDC_ACMI configured my .ioc file to match the reference project as closely as possible. UART is not used.Issue:I implemented a simple CDC ACM echo function to verify USB communication.In Full-Speed (FS) mode, the echo function works correctly. The PC recognizes the device, and both transmit and receive operate normally. In High-Speed (HS) mode, however, the PC does not recognize the USB device at all (it reports an unknown or unrecognized USB device), so communication cannot be established.What could I be missing, or what
I'm trying to disconnect a ethernet cable after flashing a code Then I'm getting [00:01:50.522,000] <err> net_tcp: net_send_data()[00:01:52.200,000] <wrn> net_if: iface 1 is down[00:01:52.200,000] <err> net_tcp: net_send_data()[00:01:52.480,000] <wrn> net_if: iface 1 is down[00:01:52.480,000] <err> net_tcp: net_send_data()[00:01:52.900,000] <wrn> net_if: iface 1 is down[00:01:52.900,000] <err> net_tcp: net_send_data()[00:01:53.530,000] <wrn> net_if: iface 1 is down[00:01:53.530,000] <err> net_tcp: net_send_data()[00:01:54.475,000] <wrn> net_if: iface 1 is downThis is expected since trying to connect it backWhen I reconnect ethernet cable Im getting an below error [00:01:54.475,000] <wrn> net_if: iface 1 is down[00:01:54.475,000] <err> net_tcp: net_send_data()[00:01:55.282,000] <inf> phy_mii: PHY (0) Link speed 100 Mb, full duplex[00:01:56.212,000] <err> os: ***** USAGE FAULT *****[00
Hello, I may be missing something, I cant generate the SPI_init() method within main() (also pins are yellow ?)…I have generated; HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); Cheers
Hello,I have completed this guide successfully:How to integrate TouchGFX and camera middleware on an STM32N6570-DK However, I am running into an issue when I try to add SDMMC2 or ETH in the .ioc. After I generate code then build in the IDE, I get the below error: C://TouchGFXProjects/VisionControlboard2/FSBL/Core/Src/main.c:334:(.text.startup.main+0x12c): undefined reference to `HAL_SD_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: (HAL_SD_Init): Unknown destination type (ARM/Thumb) in ./Application/User/Core/main.oC://TouchGFXProjects/VisionControlboard2/FSBL/Core/Src/main.c:334:(.text.startup.main+0x12c): dangerous relocation: unsupported relocationProject in link below:https://app.box.com/s/bdbyzi5eqvqhgib90klxgehmhs8pkynsWhat is the best method to get this resolved? I am using STM32CubeIDE Version 2.1.1
Hi.I’m working on a custom board with a C551VET6 and trained on a NUCLEO_C562RE with ADC. I attempted the conversion in polling mode in several ways (mode=single + discountinuous=disabled / mode=continuous + discountinuous=3ranks) by varying the implementation of the FOR loop (including or excluding the calls to HAL_ADC_REG_StartConv and HAL_ADC_REG_PollForConv according to the selected mode); no matter what I did, as soon as I needed to convert 3 or more channels, only the first two showed distinct values, while all the other channels in the sequencer returned a value identical to that of the second channel.I found no example using more than 2 channels in a basic regular sequencer. Have you tried it at ST ?By the way, I’m working with a CTN temperature sensor and two HDC3120 giving both temperature and humidity, thus 5 channels in my case.Do I need to lower the resolution or something when the number of channel increases ?I’m not familiar with ST community mechanisms, shall I open a
Hello,I am working with an STM32N6570-DK board and facing an issue while setting up the SD card. I created a project using TouchGFX Designer, generated the code, and opened the .ioc file. In there, I enabled SDMMC2 with 4-bit Wide mode and enabled global interrupt:After checking the schematics, I noticed that the CK pin was incorrect, so I assigned the correct pin (PC2:(I made the following additional configurations:Changed all SDMMC2 pins to pull-up and set Max output speed to Very HighEnabled PWR_SD_EN (PQ7) as output level high with context FreeChanged clock from HCLK to IC4 (should not affect anything)Enabled SD_DETECT (PN12) to detect when the SD card is inserted or removedEnabled EXTI Line4 and EXTI Line12 for interruptsEnabled FileX with mostly default settings, except for increased memory and FX driver initialization:After this setup, I attempted to initialize the SD card with the following call:fx_media_open(&sdio_disk, "SDIO_DISK", fx_stm32_sd_driver, NULL, fx_sd_media_me
Hi,I am using the STM32N657-DK and running the NetX Duo WebServer example provided by STM32Cube. The application works correctly when the Ethernet link is negotiated at 100 Mbps and 1 Gbps. However, when the link speed is 10 Mbps, the web server is not reachable and communication fails.SetupBoard: STM32N657-DK Software: STM32CubeIDE / STM32Cube firmware NetX Duo WebServer example PHY: (RTL8211F-CG, if applicable) Interface: RGMIIObservations1 Gbps: Works correctly. 100 Mbps: Works correctly. 10 Mbps: Link appears to come up, but the web server cannot be accessed and network communication fails.QuestionsDoes the STM32N657-DK NetX Duo Ethernet driver fully support operation at 10 Mbps? Is there any additional MAC or PHY configuration required when the negotiated speed is 10 Mbps? Are there any known limitations or issues with the NetX Duo Ethernet driver or HAL Ethernet driver when operating at 10 Mbps? Has anyone successfully run the NetX Duo WebServer example at 10 Mbps on the STM32N65
Cannot wake from Stop mode using LPTIM1Board: STM32N6570-DK (STM32N657X0, Cortex-M55)RTOS: Zephyr 4.4.0Goal: Enter Stop mode and wake periodically via LPTIM1 auto-reload interrupt (~200ms)What works:Sleep mode (WFI without SLEEPDEEP) — enters and wakes correctly from GPIO EXTI and LPTIMLPTIM1 initialization — confirmed running, ISR fires (verified via counter incrementing in HAL_LPTIM_AutoReloadMatchCallback)LPTIM1 EXTI line 52 enabled — EXTI->IMR2 |= EXTI_IMR2_IM52 via __HAL_LPTIM_LPTIM1_EXTI_ENABLE_IT()NVIC LPTIM1_IRQn enabled — interrupt registered and working in normal (non-Stop) operationClock restore after Stop — SystemClock_Restore() re-enables HSE, PLLs (PLL1/2/3), IC muxes back to 800 MHzWhat does NOT work:Stop mode entry → CPU never wakes. After HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI), the MCU halts permanently. No interrupt wakes it.LPTIM1 configuration:__HAL_RCC_LPTIM1_CLK_ENABLE();// Clock: LSI (~32 kHz)RCC_PeriphCLKInitTypeDef pclk = {0};pclk.Per
I have made a bootloader for STM32F4 with dual bank and single bank structure. I have done so rudimentary testing with it and written test logs in a md file. Here is the link:-https://github.com/Tank4676/stm32-dualslot_bootloader
Hi, I use STM32H7 with STCUBE 11.1.I use RNDIS module usbd_cdc_rndis.h to communicate with a PC.Sometimes when the PC sends a frame the STM32 replies with NAK, here is the sequence that repeats:SYNCPID OUTAddressCRCEOPSYNCPID DATA0data 30 bytesCRCEOPSYNCPID NAKEOPWhat might be the issue? Can I change the USB interval (CDC_RNDIS_FS_BINTERVAL)?BRJonas
Good day,We are using a composite USBX device class combining CDC and MSC over USB Full Speed, built on X_CUBE_AZRTOS-H7 version 3.3.0 (USBX 6.4). During testing we discovered that a certain Windows PC sends a MODE SELECT(10) command (opcode 0x55) and causes an endpoint stall.After a rather long debugging session, it was found that the USBX source _ux_device_class_storage_mode_select() is explicitly not implemented — it stalls the OUT endpoint, UX_FUNCTION_NOT_SUPPORTED (which is not checked in the thread) and never recovers:The MODE SELECT(6) SCSI command is not even implemented and the storage thread falls through to the default case, also triggering a endpoint stall. So:- Are there any plans to implement these MODE SELECT(6/10) commands properly in a future USBX release?- Does anyone already have a workaround for this?- Wouldn't it be cleaner to reply with an ILLEGAL REQUEST instead of stalling the endpoint?System details:- MCU: STM32H7- USBX version: 6.4 (X_CUBE_AZRTOS-H7 3.3.
I am working with an STM32 microcontroller and a VL53L0X sensor. The sensor readings are transmitted over UART1 at 115200 baud, 8N1.I have verified: UART initialized at 115200 baud, 8N1, no parity XCTU terminal set to ASCII mode (Hide Hex enabled) Line endings set to \r\n Any suggestions for reliable output?Numeric values are printed correctly, but the text parts like "Distance" and "mm" are missing or appear as dots in XCTU’s terminal. For example, instead of:CodeDistance: 25 mmI see:CodeD..ta..e: 25 mm
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.