Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hi, was wondering if someone can point me in the right direction on an issue I've been battling with regarding USB device enumeration. I'm using Cube FW_H5_V1.4.0 > Projects > NUCLEO-H563ZI > Applications > USBX > UX_Device_HID_CDC_ACM for STM32Cube IDE as the starting point. Closest example I could find but have had to make significant changes as I'm trying to create a bare metal version, don't want HID and of course am using a different micro on the STM32H573I-DK board. I've got the code running and get the "USB device not recognised" popup on Windows when I connect the board. I'm hitting a breakpoint in the HAL_PCDResetCallback function but HAL_PCD_SetupStageCallback() never runs to start the first SETUP packet. I can see that bits 10 and 11 are set in the ISTR register so it seems SETUP transaction was received and endpoint 0 RX is complete. I'm having a hard time working out exactly why, suspect endpoint 0 is not configured correctly but how to confirm and fix? Any
Board: STM32U5x9J-DK (Discovery) MCU: STM32U5xx (U5G9J series) STM32Cube package: STM32Cube_FW_U5_V1.8.0 Example path: STM32Cube\Repository\STM32Cube_FW_U5_V1.8.0\Projects\STM32U5x9J-DK\Examples\OSPI\OSPI_NOR_MemoryMapped File: main.c (write/read operations performed in switch(step), case 1) IDE / toolchain: (please mention your IDE, e.g., STM32CubeIDE v1.19.0) Running the example on the Discovery board: the write appears to run, memory-mapped mode is entered, but reading back returns garbage — the mismatch counter res always becomes 256 (I interpret that as every byte failed the compare). The write/read block is in case 1 of the main loop. case 1: if (CmdCplt != 0) { CmdCplt = 0; /* ... set up mem-mapped write/read ... */ /* Writing Sequence ----------------------------------------------- */ mem_addr = (uint8_t *)(OCTOSPI1_BASE + address); for (index = 0; index < BUFFERSIZE; index++) { *mem_addr = aTxBuffer[index]; mem_addr++; } HAL_Delay(MEMORY_PAGE_PROG_DELAY
They are defined like this in stm32h563xx.h:/*Buffer Descriptor Mask*/ #define USB_PMA_TXBD_ADDMSK (0xFFFF0000UL) #define USB_PMA_TXBD_COUNTMSK (0x0000FFFFUL) #define USB_PMA_RXBD_ADDMSK (0xFFFF0000UL) #define USB_PMA_RXBD_COUNTMSK (0x03FFFFFFUL)ADDMSKs are correct, but I was expecting both COUNTMSK to be 0xFC00FFFFUL since both COUNT_TX and COUNT_RX are 10 bits [25:16]. When double buffering is used there is BLSIZE and NUM_BLOCK but I dont see anything about these in the header. Is there a reason the TXBD and RXBD_COUNTMSK are defined like this ?
Hello,I'm struggling with setting up a environment to develop Zephyr applications using VS Code. I've little to no knowledge about VS Code, Zephyr and the underlying build system. I only used STM32CubeIDE in the past.What I have so far is a dedicated computer running Ubuntu, VS Code, Zephyr & Zephyr IDE extension for VS Code. I'm able to build e.g. the blinky example and I also can download it. Attaching to a running target is not possible.The launch.json file has been automatically created by Zephyr IDE and should provide configurations for launching (flash the MCU + debug with breakpoint at main()) and attaching (connect to MCU without flashing, probably halting the MCU). Interestingly, there was no difference in the behaviour of those configurations. Both flashed and connected to the MCU. So, by digging deeper into that launch mechanism I realized that both configurations used 'launch' as the request type. I changed the type to 'attach' for the corresponding attach configuration
I'm learning about the I2C interface. The polling method works properly, but the interrupt method is not working correctly.I enabled I2C listen mode, but when I send the address on the I2C line, the address match callback is not triggered.
I have NUCLEO - N657X0-Q board and it has an external flash.. Whenever i upload a code it gets uploaded and runs but when i restart it, it runs on the default code it came in. Can anyone guide me how can i upload the code to external flash. I have tried reading the manual but it didn't help much. Thanks
Hello,On a custom board based on the STM32WL55JC1, I managed to flash a version of the LoRaEndNode application. However, when I run it, I observe an unusually high power consumption of around 70 mA.In contrast, when the board is in programming mode or when I run the PWR_Stop2_PeripheralNoRetention example, the current draw drops to about 6–7 mA, which matches the expected value based on my calculations.I can share the schematics and code if needed, but I suspect the high current consumption is related to the firmware behavior rather than any hardware leakage or residual current on the board.Is there a recommended way to reduce the power consumption of this application (AN5568 ?), or would it be better to start a new project from scratch? Do i need to code something in particular in stm32_lpm_if.c ?Also, is this level of power consumption normal for the LoRaEndNode example?Finally, I’ve noticed no significant difference between LowPowerSleepMode (Sleep mode with a 1 MHz clock) and
Hello everyone,I’m currently working on setting up UDP communication using NetX Duo with a static IP address, configured through STM32CubeMX (IOC) in nucleo n657x0-q.Please note that the UDP communication needs to be initialized and executed in the Application (APPLI) — not in the FSBL.I’ve gone through several related threads in the community, but I still haven’t managed to get the communication working properly.Could someone please provide a clear, step-by-step explanation or example of how to configure and initialize UDP communication (client or server) with a static IP in NetX Duo under APPLI?I would greatly appreciate details on:The correct IOC configuration (Ethernet, NetX Duo, IP, UDP, MPU etc.)The proper initialization sequence in APPLI (how and when to start the network and socket)Relevant NetX Duo API functions (e.g., nx_udp_socket_create, nx_udp_socket_bind, nx_udp_socket_send, nx_udp_socket_receive)Common issues or pitfalls when moving UDP handling from FSBL to APPLIThank y
I'm using EVSPIN32G06Q2S1 board.PB0 is a DAC emulator controlled by PWM duty.But it’s always disabled. How can I enable it?
Hi, There's an image in the NUCLEO-WB55RG user manual (UM2435) with the phrase "Wrong Image". Not sure what this is suposed to mean, maybe an internal doc note? ST Doc team, can you please review? Best, Alessandro
I am using a nucleo-F103RB. This device was functional in the past. I am getting an error Error in final launch sequence: Failed to execute MI command:target remote localhost:61239 Error message from debugger back end:localhost:61239: Connection timed out.Failed to execute MI command:target remote localhost:61239 Error message from debugger back end:localhost:61239: Connection timed out.localhost:61239: Connection timed out. I have tried different cables to ensure it isn't the issue. I have also changed the port number. This is my debugger information: I am able to upgrade my stlink chip via cube ide as shown in the image below (it detects it)I have tried to use the stm32cubeprogrammer application too but that doesn't seem to work. I get the below error. However i know it is working on COM7 because the last thing i did was create a program to output some information through the USART, which it is still doing (image below). &n
Hello ST Community,I’m currently working on a project where I’m using the STM32L475RGT6 MCU to interface with the BlueNRG-M2SA Bluetooth module via SPI. The goal is to establish BLE communication between the MCU and a mobile device. However, I’ve encountered a few challenges and would appreciate guidance or reference material.If anyone has:A working DTM firmware or BLE SPI reference for STM32L4 + BlueNRG-M2SAA minimal working .ioc + main.c + app_bluenrg_2.cAny tips on pin configuration, middleware integration, or BLE stack setup
Hello, we are using a STM32H5 with TZ disabled. In firmware, we are doing the following:- set the product state to provisioning (0x17)- provision the debug authenticationThis already works fine. Afterwards, we can do a discovery an see the validity of the DA ( we read 0xeaeaeaea). Regression afterwards works fine.However, we would like to check this validity from within the firmware.1) where does this 0xeaeaeaea comes from? Can we also access it?2) reading back the storage area of the DA (0x0ffd0100) is not reliable. Sometimes, we can read the data we just wrote, sometime we just read 0xff... This depends on the code we execute after writing. It is not a timing issue, should we maybe set a certain flag or something like that? The code we used is based on the github project https://github.com/stm32-hotspot/STM32H5_DA_EmbeddedProvisioning Best regardsPeter
Hello superhero MCU enthusiasts,I'm playing with the STM32N6570-DK and have created a simple project with an FSBL that initializes the MCU and boots the Appl. Once booted, the Appl flashes a "Hello World" LED.Both can be loaded to external flash using the STM32CubeProgrammer.Now, I'm trying to map external PSRAM (XSPI1 -> 0x90000000) inside the FSBL, but it fails.To do that, I change a line in a file in the FSBL, stm32_extmem_conf.h, line 35 of (PSRAM disabled):#define EXTMEM_DRIVER_PSRAM 0Now I try to enable and map the external PSRAM by setting the definition to 1:#define EXTMEM_DRIVER_PSRAM 1However, it doesn't succeed.When debugging I see we land into a HardFault.The FSBL generates a HardFault when executing SAL_XSPI_EnableMapMode, because the function HAL_XSPI_MemoryMapped fails.I can't find the cause.Anyone?I posted a project here with a short Readme.md:https://github.com/AngryCarrot61/STM32N6570-DK_004Note: to see FSBL and Appl working one has to set EXTMEM_DRIVER_PSRAM
This works fine in an app without SM but when I run this from a non-secure app together with SM, the last step fails. This is the code: // Enable access to RTC and backup domain HAL_PWR_EnableBkUpAccess(); if (__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) { // Reset the backup domain (equivalent to LL_RCC_ForceBackupDomainReset) __HAL_RCC_BACKUPRESET_FORCE(); __HAL_RCC_BACKUPRESET_RELEASE(); // Ensure LSE is OFF and NOT in bypass mode CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON | RCC_BDCR_LSEBYP); // Set drive strength for startup (must be done while LSE is OFF) __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_MEDIUMHIGH); // Enable LSE __HAL_RCC_LSE_CONFIG(RCC_LSE_ON); // Wait until LSE is ready, with timeout if (SYSTIMER_WaitFlag(&RCC->BDCR, RCC_BDCR_LSERDY, true, 20000000)) { } else { // Disable LSE __HAL_RCC_LSE_CONFIG(RCC_LSE_OFF); // LSE activation error, handle as appropriate status = HAL_TIMEOUT; } // Select LSE as RTC clock source __HAL_RCC_RTC_CONFIG(RC
Hi, I'm using 3 channels of ADC4 with GPDMA1 (channel 4) in secure world of a TrustZone-project and the DMA-buffer stays always 0. The same ADC/DMA-configuration with the same application code (all mnus the security aspects) are working fine without TrustZone on the same hardware. I set the DMA-channel and the ADC-channel to secure and privileged, also the SAU-configuration for these peripherals is secure, the DMA-interrupt (circular) is triggered and calling HAL_ADC_ConvCpltCallback but there's nothing inside the DMA-buffer (which is defined as volatile inside a secure and privileged SRAM-area). I've tried different ADC conversion rates, clock rates and clock sources, checked for errors (especially overruns) and secure faults (with GTZC), there's absolutely nothing. I guess it must have something to do with secure/privileged areas or peripherals but since all the parts are secure and privileged I don't know what it could be. I'd be thankful for any suggestions; here is my ADC DMA-init
Hi,I'm try to communicate between my windows pc and my STM32GOB1RE Nucleo 64 board, with the CDC Class.To validate my hardware ( PA11 PA12 and gnd connected to usb pc), i did few dfu flahsing operation with CubeProg without issue. Windows detect properly my device in DFU mode, i can do the programmation and new firmware runs well. -> Hardware looks fine. I have generated the code with CubeMX and i'm using the HSI to 60mhz. Just this simple code with USB_DRD_FS Usb clock derived from it at 48Mhz.I'm also using the SOF detection and CRS SYNC Source USB.I have added th Code line in usbd_cdc_if, but it is not really the problem.Windows generate Error of not Descriptor reading.Here is the log of the USB Device Viewer, a windows tool that bring information:[Port7] FailedEnumeration : Périphérique USB inconnu (échec de demande de descripteur de périphérique)[Port7] FailedEnumeration : Périphérique USB inconnu (échec de demande de descripteur de périphérique) Is Port User
Hello, I have been following a few different Ethernet tutorials for my MCU (STM32H750VBT6TR) I have on a dedicated PCB. Thus far, I have been unable to get a simple ping test working. For reference, I am mostly using this tutorial in combination with this one, but I am not using freeRTOS at this time. I simply want to get LwIP to set up correctly and ping the board so I can then adapt it to a UDP server. I know my memory locations for the rx/tx designators, and rx pool base, and the LwIP heap are in the right locations (assuming they are as the tutorial states), but my code fails when the LwIP.c file calls netif_add(), which makes me think the issue does not lie within the memory. Can anyone who is more experienced in simple LwIP implementations help me out here? I am not sure where to turn at this point, as it does not seem people on other posts are having the same issues. I will attach my project files, namely the IOC, so anyone can look to see if there are
Hello,I am trying to set up an external flash memory (MX25V1635F) on a Nucleo-U575ZI-Q.I have successfully used the low-level drivers (LLD) from the manufacturer Macronix and integrated them into the Levelx functions. (more info : https://community.st.com/t5/stm32-mcus-embedded-software/difficulties-using-fx-media-format/td-p/845435 )Also, i use FileX to formand open my media, and it seems to work : UINT ret = FX_SUCCESS; /* USER CODE BEGIN MX_FileX_Init */ lx_stm32_nor_custom_driver_initialize(&nor_flash); /* USER CODE END MX_FileX_Init */ /* Initialize FileX. */ fx_system_initialize(); /* USER CODE BEGIN MX_FileX_Init 1*/ /* Format the NOR flash as FAT */ status = fx_media_format(&nor_flash_disk, fx_stm32_levelx_nor_driver, // Driver entry (VOID*)NOR_CUSTOM_DRIVER_ID, // Device info pointer (UCHAR*)media_memory, // Media buffer pointer sizeof(media_memory), // Media buffer size "NOR_FLASH_DISK", // Volume Name 1, // Number of FAT
Hi ST team, I’ve been testing I3C Target mode on STM32H563 using CubeH5 HAL.In mixed write/read transactions such as: START + DEV_W + DATA1 + RESTART + DEV_R + … + STOP the Target cannot know in advance how many bytes the controller will write before RESTART.However, HAL requires me to specify a fixed length when calling: HAL_I3C_Tgt_Receive_IT(&hi3c1, rx_buf, RxBufSize); and later, at frame completion (FCF), the driver checks: if (LL_I3C_GetXferDataCount(hi3c->Instance) == hi3c->pXferData->RxBuf.Size) HAL_I3C_TgtRxCpltCallback(); else hi3c->ErrorCode = HAL_I3C_ERROR_SIZE; In real usage, the controller might send only one byte (e.g. a register offset) before RESTART.This causes HAL_I3C_ERROR_SIZE even though the transfer is perfectly valid. Questions / suggestions Is this strict == Size check intentional?It seems unrealistic for Target side to know the controller’s write length. Can HAL provide a “short frame allowed” opti
Hallo motor control experts,I’m trying to get a B-G431B-ESC1 board running on an e-bike motor using the ST MCSDK 6.4.0. The motor spins with the Motor Profiler FW (B-G431B-ESC1#B-G431B-ESC1 3Sh#(6.1.2).hex) in the profiling phase, but the MCSDK project generated from those parameters won’t get the motor to turn. Hardware setup, power supply and so on ist exectly the same, so it must be a firmware problem. I’ve tried it both sensorless and with the encoder—same result.Is there any information which parameters the Motor Profiler FW uses?How it is posible, that the Motor Profiler FW get's the motor to run without knowing the motorparameter and the MCSDK project with the exact motor parameters does not run?Thank you!
Hello STM Community,I’m currently working on measuring a LiPo battery voltage using one of the ADC inputs (AIN6) on an STM32WB55RG. The battery voltage ranges from approximately 3.0 V to 3.95 V. Since the ADC reference (Vref) is 3.3 V, I used a voltage divider (two 10 MΩ resistors) to scale the voltage to half its original value. In firmware, I then multiply the measured voltage by two to recover the actual battery voltage.However, I’ve observed that the measured ADC voltage is roughly three times lower than expected. This suggests there may be an additional internal resistance or loading effect influencing the measurement — possibly an internal parallel resistance within the ADC input path. I checked the datasheet and reference manual but couldn’t find any specifications confirming the presence or value of such an internal resistor.I’ve attached my tentative schematic for reference.Has anyone encountered a similar issue or can shed light on this behavior? I’d like to make the measurem
Hello,I am using the B-G431B-ESC1 board with a fresh installation of X-CUBE-MCSDK-6 (v6.4.1).I want to use the Motor Profiler, but I am facing a problem:1. The precompiled profiler firmware (.bin/.hex file) for B-G431B-ESC1 is not included in the 'Utilities' folder. I understand this may be by design in newer SDKs.2. However, when I create a "New Project" in MC Workbench and select the B-G431B-ESC1 board, the option to create a "Motor Profiler" firmware does not appear. Only the "FOC" option is available.Because of this, I am completely stuck and cannot run the Motor Profiler.Could you please advise on the correct procedure to get the profiler firmware for the B-G431B-ESC1 on MCSDK 6.4.1?Thank you.
Hi, I want to design a board using a STM32H7Rx device that has only one Octo-SPI. I need this Octo-SPI to connect to an on board FPGA, so I can not use it for booting. Therefore I have some questions:Can I boot from standard SPI? I do not need to run from external memory. All program code can be copied to internal memory. Do we need to change the Boot-Rom and can that be done using the STM32CubeIDE software? How can we program the boards (Boot-ROM and SPI) during production? Will booting from SPI be slow? Can we have two code version inside the SPI to support a safe upgrade procedure?
I am working on a project to drive a door using a PMSM motor in position control mode.I've encountered a problem I can't solve. When the motor is positioned at some specific rotor positions, it fails to start properly and tends to spin out of control during the startup sequence.There are very similar 2 posts titled “Loss of control whenever the motor starts at some specific points” (https://community.st.com/t5/stm32-mcus-motor-control/loss-of-control-whenever-the-motor-starts-at-some-specific/td-p/143892) and “Motor sometimes starts in wrong direction, because of wrong sign of Iq measured” (https://community.st.com/t5/stm32-mcus-motor-control/motor-sometimes-starts-in-wrong-direction-because-of-wrong-sign/td-p/64553).Has anyone found a solution? If so, could you please share it with us?Thanks in advance for your help. Details:ST MCW Ver : 6.4.0STM32CubeIDE Ver : 1.19.0Driving algorithm &
ST Community highlights – April to June 2026
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.