Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hello,I'm trying DUAL BOOT on STM32L471 and having a problem with SYSCFG->MEMRMP FB_MODE bit.I modified Dual Boot Bank Swap Boot Loader Example for STM32G4 project to fit my board, and everything goes well when the firmware put from the start of BANK1 (0x08000000). It starts from BANK1 and copies itself to BANK2, sets BFB2 of OPTION BYTES and calls HAL_FLASH_OB_Launch(). Then it starts from BANK2 (with address of 0x08000000 since FB_MODE=1) without problem.Then I put it from 0x08070000 (the last sector of BANK1) and adjusted VTOR, so that it's called as a sub-program from main which is positioned at start of BANK1(0x08000000), copies itself to 0x08080000, sets BFB2, and calls OB_Launch() but it doesn't boot from BANK2.VTOR must be set at the beginning of main like this:uint8_t bank = getActiveBank();if (bank == 1) SCB->VTOR=0x08070000;else SCB->VTOR=0x08000000; and modified linker script too.After calling HAL_FLASH_OB_Launch() to set BFB2, FB_MODE is also s
Hi,We are facing the same issue like the below community post. https://community.st.com/t5/stm32-mcus-products/flash-via-i2c-bootloader-problem-for-stm32g0b1kbu6/m-p/636467#M234685 But we are using 'STM32G431RBT6' in our project, kindly let us know if any specific pins need to be handled in this MCU for proper operation.Kindly reply on this as early as possible. Thanks,Ananthu
I created a custom STM32F411 PCB. I can program it and blink a LED for example just fine. I also have a STM32 blackpill board which uses the same MCU. When I run some USB HID code it works fine on the blackpill but once uploaded to my custom PCB and I plug it into my windows PC, it says the usb device malfunctioned and is not working. I followed all the guidelines from the datasheet for the USB design. (I dont need external pull-ups for D+, no need for VBUS sensing). Also I have a 25Mhz HSE clock that is properly configured for the precise 48Mhz USB clock even though its only running at FS. Any ideas to why this might be happening?
Hello,I’m working with STM32WB55CGU (UQFN68) on a WeAct WB55 board and trying to achieve ultra-low power during BLE idle / non-advertising periods using the STM32 WPAN framework.Expected behaviorAccording to ST documentation and examples:STOP2 mode with BLE stack idle should be in the tens of µA rangeI previously verified 10–20 µA STOP2 current without BLE enabled, so the board itself is capable of low powerActual behaviorWith BLE enabled (advertising):Idle (non-advertising period): ~1.1–1.4 mAAdvertising peak: ~8 mABLE communication works correctlyPB6 debug pin toggles, confirming STOP2 entryRemoving ST-LINK reduces only ~100–200 µAHardwareMCU: STM32WB55CGUBoard: WeAct WB55External LSE presentMeasured using shunt resistor + scope (differential measurement)Software setupBased on BLE_p2pServer exampleCube FW: STM32Cube FW_WB V1.23.0IDE: STM32CubeIDERF firmware loaded correctly (same as NUCLEO examples)USB, ADC, PWM, DMA disabled for low-power testMain loop while (1) { MX_APPE
Here is a more professional and technically concise rephrasing of your post, optimized for a developer forum or technical support ticket:Subject: Clarification on VBUS Sensing and Internal Pull-up Management for STM32WB55Hello,Based on the STM32 USB Training MOOC, it is highly recommended to implement VBUS sensing to distinguish between a "Suspended" state (no bus activity) and a "Disconnected" state (physical cable removal). This prevents back-powering the host via the internal D+ pull-up resistor when the device is self-powered.However, I’ve noticed a few discrepancies regarding the STM32WB55 implementation:Tooling: In STM32CubeIDE (Device Configuration Tool), there is no dedicated "VBUS Sensing" pin option available for the USB peripheral on this specific MCU series.Reference Hardware: Looking at the P-NUCLEO-WB55 schematics, there is no voltage divider or direct trace connecting VBUS to a GPIO for sensing purposes.Could someone please clarify the following for a self-powered
Hi, I have started from a project by Adam Berlinger.I have two UDP sockets, one receiving data max 500 bytes/s one sending data 200 bytes every 5 seconds and one TCPIP sending 4K every 20 ms.Netconn Api I have no problem. With BSD sockets, If I work receiving data from UDP socket from a single or maximum 2 clients the UDP socket works well, but if I have 3 or more clients sending data on that UDP port, after a while the sockets returns no data even if they are.If I ask to print stat at display everything seems to be correct and as I imagined there is full of available memory and of all, no error at UDP level.Do you have any idea on what is happening? I used the same code on LWIP 1.1 on another microcontroller slower with less memory but no dma, and everything worked very well.Best Regards
Just wanted to see if anyone could point me in the right direction regarding a problem I'm having with implementing a USB device using MSC in standalone mode. The code initialises correctly as far as I can tell but as soon as it gets into the main loop, a HardFault is generated - this seems to be because ux_device_tasks_run() is trying to access ux_system_slave->ux_system_slave_dcd which is not initialised. I cannot see a function in the CubeMX (v1.5.1) code base that performs this. I have a reference project for the U385 micro and have confirmed the ioc files for USBX are essentially identical. I can't see a DCD registration function in that project either but apparently it works (I have no way of confirming without the hardware). I think in previous Cube versions, a function called ux_device_stack_dcd_register() was exposed but that no longer seems to be the case. The intention must be for it to be carried out another way but I'm having a hard time working out what this
Hello. I have two setups: one STM32H5 Nucleo eval board and a custom STM32H5 board. The Nucleo runs with the LAN8742 PHY while the eval board runs with the KSZ9567R switch. Both are configured to use RMII. I'm using the NetXDuo stack for both. The Nucleo board works just fine, but the custom does not. The custom board SW is based on the Nucleo SW, except removing the LAN8742 interface. I've checked out the HW on the custom board and it looks fine. I'm trying to do a simple ping from the PC. The first message is an ARP message. I see it on Wireshark and it arrives just fine on the STM32. I see the MAC address and the source and destination IP which look correct in _nx_arp_packet_receivemessage_type : 1sender_physical_msw : 11352sender_physical_lsw : 3116224427sender_ip_address : 3232235781target_ip_address : 3232235787Then the SW creates the ARP reply and calls _nx_driver_packet_send. I can see the RMII Tx lines toggle after the ARP packet is sent, but for
Good morning, I've been trying to create a simple program for several days that allows me to ping from my laptop to my Nucle F767ZTI board, but to no avail. I'm using CUBE IDE 1.18. I initially followed a tutorial and was able to do it, but only in debug mode, not with the board in running mode (normal operation), without using FreeRTOS but only by enabling ETH and LWIP. Is there a project I can import and then continue making my subsequent changes from there? This is because the ping is only the initial part of my project that I'm about to create. Can you send me a link where I can download and import the project? Thanks in advance.Here some lines codes that I use: /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All rights reserv
I am using the STM32H725RE (68-pin package).My goal is to have full duplex SPI communication with a 16 bit shift register using the stm32h7 as the SPI master (with no dma controller).I am using the SPI3 with the following pin (12MHz)PA15 (SPI3_nCS), PC10 (SPI3_SCK), PC11 (SPI3_MISO) and PC12 (SPI3_MOSI).With the following code it is already possible to write the data successfully and the shift register also sends the data correctly to the MISO wire. (as you can see in the logic analyser screenshot)But I have problems reading the receive buffer, the flags are set correctly (RXP is set correctly), but when I read the RXDR I only read the data 0xFFFF, although other data should be read as shown in the logic analyser screenshot?#include <stm32h7xx.h>#include "stm32h725xx.h" #define pSpiSR SPI3 static void initSPI3() { RCC->APB2ENR |= RCC_APB2ENR_SPI1EN; // SPI1 Peripherie Enable (FLASH)// PA15 (SPI3_nCS)GPIOA->MODER &= ~(GPIO_MODER_MODE15);GPIOA->MOD
Hi Is it possible to run Zephyr RTOS on the STM32F411RET6 Nucleo board? If it is possible, how can I set up and use Zephyr RTOS on it? Please suggest the steps.
I am trying to flash a .bin file to an STM32F767ZI Nucleo board using UART via STM32CubeProgrammer. While I can successfully connect to the board using ST-LINK, I am unable to establish a connection over UART and encounter the following error: I have tested USART1, USART2, and USART3 with various baud rates, and configured the BOOT0 pin to logic high followed by pressing the reset button, as described in the reference manual. However, the issue persists. Please suggest possible causes/solutions for this problem. Thank you. Arun Badiger,
During stress testing involving repeated startup and shutdown, a fatal error was encountered in the STM32F407 Ethernet (ETH) module.The issue was observed during the startup phase, where a problem occurred in the ETH DMA. The DMASR register indicated a Fatal Bus Error.The following are the ETH register values captured when the error occurred:MACCR : 0x0200CE0CMACFFR : 0x00000000MACHTHR : 0x00000000MACHTLR : 0x00000000MACMIIAR : 0x000007D0MACMIIDR : 0x00001058MACFCR : 0x00000080MACVLANTR : 0x00000000MACRWUFFR : 0x00000000MACPMTCSR : 0x00000000MACDBGR : 0x00000000MACSR : 0x00000000MACIMR : 0x00000208MACA0HR : 0x80000103MACA0LR : 0x0AE18000MACA1HR : 0x0000FFFFMACA1LR : 0xFFFFFFFFMACA2HR : 0x0000FFFFMACA2LR : 0xFFFFFFFFMACA3HR : 0x0000FFFFMACA3LR : 0xFFFFFFFFMMCCR : 0x00000000MMCRIR : 0x00000000MMCTIR : 0x00000000MMCRIMR : 0x00020060MMCTIMR : 0x0020C000MMCTGFSCCR : 0x00000000MMCTGFMSCCR : 0x00000000MMCTGFCR : 0x00000001MMCRFCECR : 0x00000000MMCRFAECR : 0x00000000MMCRGUFCR : 0x00000003PTPTS
Split from Zephyr RTOS on Nucleo-F411RE ? - which has been answered.This is a new question.Hi T_HamdiThank you for your response.I have installed the Zephyr IDE and used the Blinky LED example. The firmware was flashed successfully; however, the LED is not glowing.I have attached an image for your reference. Please take a look.
I am trying to launch a dma of the input capture of the timer2 ch2 latched captured register to a memory buffer. I am using the DMA to allow me to record 75 captures so as to be able to determine the time for 75 cycles of a 500 KHz input signal. Set up is - TIM2 - internal clock (250MHz) - ch2 input capture direct modeIC CH2 - rising edge - direct - no division - filter 0GPDMA1 CH0 - standard - circular disable - request TIM2_CH2 - DMA Handle hdma(TIM_DMA_ID_CC2) - Block single - Priority low - Transaction normal - Dir p to m - Source increment disable - Width word - Burst 1 - Port 0 - Destination increment enabled - Width word - Burst 1 - Data handling disable - Trigger disable - Transfer event half endAt the moment Icache is disabled but I have tested in all three options. I am using HAL_TIM_IC_Start_DMA(&htim2, TIM_CHANNEL_2, periods, SAMPLE_SIZE) called from an interrupt routine triggered by a separate timer. Periods is my memory buffer and SAMPLE_SIZE is set to
Hi all,I failed to run Nucleo-G431RB board using Simulink "Monitor & Tune" mode via Simulink XCP protocol.I've got the error message at Simulink,"Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command"There has been no problem for Simulink "Build, Deploy & Start".I followed an example from the link below.https://www.mathworks.com/help/ecoder/stmicroelectronicsstm32f4discovery/ug/STM32F4XX-ADC-example.htmlI've already changed Simulink model configuration to run Nucleo-G431RB LPUART.- Hardware board = STM32G4xx Based- Hardware board settings> Build options> Create> Select hardware = NUCLEO-G431RB- Connectivity > USART/UART = LPUART1- Connectivity > Serial port = COM1 (same port for STMicroelectronics STLink Virtual COM Port)MATLAB related version:- MATLAB 2023a- Embedded Coder Support Package for ARM Cortex-M Processors V23.1.0- Embedded Coder Support Package for STMicroelectronics STM32 Processors V23.
Hello!I have a custom PCB using the STM32U5A9 microcontroller.I've been developing my code using Cube IDE with CubeMX generated software including TouchGFX.I need to implement secure boot and OTA. I am following the SBSFU example for the B-U585I-IOT02A board and struggling to incorporate my project in the Non-secure user application segment of that demo project. I’m also trying to go the other way around and implement the SBSFU infrastructure and files into my custom project.First question - all I need is secure boot and OTA is it true that I do not need to enable the Trust Zone? If so, how should I modify the SBSFU build process to only include one image?Second question - It’s been difficult to follow the SBSFU code especially the slot addresses and programming to replicate it within my custom project. The postbuild script for the SBSFU_Boot project pulls firmware size values from image_macros_preprocessed_bl2.c to populate addresses in other scripts like SBSFU_Update.sh. How is this
helloDescription:I'm currently working with the STM32U585 and encountered an issue related to GPIO behavior after waking up from standby mode.Before entering standby, I configure certain GPIO pull-up:(No external pull-down resistors on the affected pins)HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_D, PWR_GPIO_BIT_14); HAL_PWREx_EnablePullUpPullDownConfig();However, after the MCU wakes up from standby (via wakeup pin), I observe a brief voltage drop on those previously GPIOs, about 300ms. This drop occurs before the firmware reinitializes the GPIO configuration:i added a delay(implemented with i--)before calling the HAL_Init() function, and the voltage drop became less pronounced:Questions:Is this behavior expected due to the standby mode reset mechanism?Is there a recommended way to retain GPIO output levels across standby wakeup?Could this be related to the IO pull settings or the boot configuration?Are there any hardware-level workarounds to avoid this voltage dip?Why does delay have such an
We used a DAC with a sample-and-hold circuit on one of our custom boards. The RC filter was not mounted; instead, the DAC output was directly connected to an SMA connector. We enabled the DAC in the firmware, and after testing, we observed a large amount of current flowing through the STM32 board. Upon inspection, we found a short between the 3.3V rail and ground on the STM32 board. Please find the attachment for your reference.
Hello everyone, I am using the STMicroelectronics IHM16M1 motor driver board with STM32 MC Workbench–generated six-step PWM firmware. Before connecting a real BLDC motor, I want to test the inverter stage using a purely resistive load to verify: PWM switching behavior Absence of shoot-through Proper high-side / low-side commutation I would like guidance on the correct way to connect a resistive load to this board. My specific questions are: Load connection Should I connect three equal resistors in star (Y) or delta (Δ) across the U, V, W motor outputs? Is one end of the star point left floating, or tied to DC-? Resistance & power rating What resistance value per phase is recommended for low-risk testing? What minimum power rating (W) should each resistor have to avoid overheating? DC bus considerations Is it safe to power the board with the rated DC bus voltage when using resistive loads, or should the voltage be reduced? Any recommendation on current
I have seen the question asked many times, references made but the question never gets answered with precision. So, once again...I want to use HAL_I2C_Master_Seq_Transmit_IT along with receive to read an I2C device register.1. START SLAVEADDRESSWR (N-Byte RegAddress)2. REPEATEDSART SLAVEADDRESSRD (N-Byte returned data) STOPStep 1 would us HAL_I2C_Master_Seq_Transmit_IT Step 2 would use HAL_I2C_Master_Seq_Receive_ITWhat are the "Option" parameters such as I2C_FIRST_FRAME, etc. for each of these calls to avoid a STOP between the sequences and make the REPEATEDSTART occur, and of course finish up with a STOP?And using the memory read/write calls does not work because the register memory address cannot be of arbitrary length. Don't have a scope handy to see the protocol generated, so I won't know things are working until my device actually returns correct default register values.
Using the information from the chip's datasheet and reference manual:I have the following routine (using the HAL routines). My issue is that I have verified code execution and setting of the two OB values via JTAG, but when the system reset is issued I go right back into user code at 0x0800 0000 and not the DFU loader as expected (0x0BF9 0000).This seems like it should be simple... what am I missing or doing wrong? void EnterFirmwareUpdateMode(void){HAL_StatusTypeDef status; // See RM0438 STM32L562 Ref Manual - pg 193 sect 6.4.2 option bytes programming// See boot configuration pg 98 table 6, line 4 - Set Flash OPTR nBoot0 to 0 and nSWBOOT0 to 0status = HAL_FLASH_Unlock();status = HAL_FLASH_OB_Unlock(); CLEAR_BIT(FLASH->OPTR, FLASH_OPTR_nSWBOOT0_Msk);CLEAR_BIT(FLASH->OPTR, FLASH_OPTR_nBOOT0_Msk);SET_BIT(FLASH->NSCR, FLASH_NSCR_OPTSTRT_Msk); // Seems un-needed since Launch supposedly reboots processorstatus = HAL_FLASH_OB_Lock();status = HA
Hello, In the MCU datasheet, there is a table on page 200: Table 72. Typical dynamic current consumption of peripherals.What is the meaning of the current writing in the peripherals on stop modes, since in this mode, all clocks in the core domain are stopped? I saw that there is an option to enable MSIS/HSI16 in stop mode if a peripheral requests it, but according to what frequency? The frequency of the processor or the frequency that entered the clock tree for the peripheral that required it?moreover, I tried to simulate it on STMCube and saw that adding peripherals does not increase current consumption in stop mode, while on datasheet writes that they consume current in units of uA/MHz. thank you amit
Hello, I am working with the STM32WL55 core and I started the FreeRTOS test and a problem occurred to me that I would like to share with you.The only thing I have done is define pin 15 of port B as output and I have created a FreeRTOS task, and within the task I have performed the LED switching:In addition to that, as is already known, FreeRTOS works with Sistyck and the HALs should use another clock source to avoid generating conflicts, in this case I have used timer 1.After configuring that way, I run the program and the LED stays on on the board, it does not switch as done in the programming.Something different happens when I let the FreeRTOS and the HAL use the Systick as a clock source, the LED does blink.What do you think is happening?
Hi, I am configuring the ADC in single-channel continuous conversion mode using DMA. However, once I call HAL_ADC_Start_DMA(&hadc, &AD_RES, 1), the main loop stops executing, and the HAL_ADC_ConvCpltCallback() function is not triggered.I noticed that setting hadc.Init.DMAContinuousRequests = ENABLE causes the main loop to become blocked.How can I configure DMA to continuously retrieve ADC values without blocking the main loop and the HAL_ADC_ConvCpltCallback() will be called continuously? I'm following this ADC tutorial: https://deepbluembedded.com/stm32-adc-continuous-conversion-mode-dma-poll-interrupt-single-channel/ /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. *
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.