Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Split from: HAL_UARTEx_ReceiveToIdle_DMA return HAL_ERROR when stm32's partner restart. That thread is solved; this is a new question. I think I'm seeing a similar problem if I call `HAL_UARTEx_ReceiveToIdle_DMA()` when the UART receive line is actively receiving data (when the other end is transmitting). A good percentage of the time it returns HAL_ERROR. I'm using STM32L4 HAL 1.13.6 (Cube 1.18.2). The problem is that the UART generates an overrun error immediately when `UART_Start_Receive_DMA()` enables the overrun error. The overrun error overwrites `huart->ReceptionType = HAL_UART_RECEPTION_STANDARD` which causes `HAL_UARTEx_ReceiveToIdle_DMA()` to return HAL_ERROR as shown in the code snippet from `HAL_UARTEx_ReceiveToIdle_DMA()` below: /* Set Reception type to reception till IDLE Event*/ huart->ReceptionType = HAL_UART_RECEPTION_TOIDLE; huart->RxEventType = HAL_UART_RXEVENT_TC; status = UART_Start_Receive_DMA(huart, pData, Size); /* Check Rx process has
Hardware/Software Environment:MCU: STM32G030K6T6SDK: MCSDK v5.4.8 (CubeMX v6.3)Current Sensing: Single-Shunt (Rshunt = 0.1Ω, Op-amp Gain = 7.5)Motor: PMSM, Nominal 900 RPM.Observer: STO-PLL, Min Reliability Speed = 350 RPM.The Problem:I am trying to start a motor that is windmilling at 500 RPM in the CCW direction. My application requirement is to run in the CW direction at 900 RPM.Currently, when I call MC_StartMotor1(), the motor slows down slightly but continues to rotate CCW. The State Machine transitions from IDLE -> START, stays in START (Rev-up) for the duration of the phases, and then returns to start-up fault.Normal start from 0 RPM works perfectly.Rev-up Table: Phase 1 is 0 RPM (Alignment) for 2000ms at 90% nominal current. Subsequent phases ramp to +450 RPM.Manual Braking: I have implemented a PWMC_TurnOnLowSides() call for 500ms in the CLEAR state to dissipate CCW energy, followed by PWMC_SwitchOnPWM().Observation: Despite high alignment current, the motor "slips" and ne
Hello,I am currently preparing the documentation package for CE certification of a device that uses the STM32G071RB microcontroller.Could you please clarify whether there is any official CE compliance documentation available for this MCU (or for the STM32G0 series), such as:CE declaration or compliance statementRoHS / REACH declarationenvironmental or material compliance documentationany other certificates typically provided for regulatory documentationIf a direct CE certificate is not applicable to the microcontroller itself, could you please advise which official documents from ST are recommended to include in the technical file for CE marking of the final product?A link to the relevant documents or the ST compliance page would also be greatly appreciated.Thank you in advance for your help.Best regards
Hi, I'm using an STM32WL5MOC where the LPUART is used to wake up the module from Stop2 mode. Since I have a lot of data to transfer, I would like to ask how I can switch to the HSI clock after waking up, and then, of course, switch back to the LSE to allow wake-up functionality. Thanks.
Hello, I have used DMA for timer outputs, input compares, memory to memory, etc. and all has worked fine, however I can't seem to get a timer-triggered DMA from memory to GPIO outputs (as this post seems to have managed).I have tried using the ODR register, the BSRR register, 16 bit transfers, 32 bit transfers, reordering the initialisation of different components, setting TIM1->DIER = TIM_DIER_UDE in different places, etc. etc. The timer is definitely incrementing and resetting correctly and I am getting a TEIF1 on DMA1.I am less familiar with DMAMUX (I used the F401 previously) so I may be making a mistake there.#include <stdio.h> #include "main.h" #include "stm32g0xx_hal_tim.h" void SystemClock_Config(void); static TIM_HandleTypeDef htim1 = {0}; static DMA_HandleTypeDef hdma = {0}; #define GPIO_BUF_LEN 4 static uint32_t gpio_buf[GPIO_BUF_LEN] = { 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0x00000000, }; static void Init_GPIO(void) { __HAL_RCC_GPIOA_CLK_E
Hello,I am wondering why the STmicro example code (STM32CubeH7) does not use the interrupt attribute for defining exception handlers.The difference I have noted when using this attribute is that it forces the stack alignement to 8 bytes:Example: void f(void); void handler(void) { return f(); } compiles with arm-none-eabi-gcc 10.2.1 and -O1 -mthumb -mcpu=cortex-m7 in: handler(): push {r3, lr} bl f() pop {r3, pc} whereas if I add the attribute "interrupt": handler(): mov r0, sp bic r1, r0, #7 mov sp, r1 push {r0, lr} bl f() pop {r0, lr} mov sp, r0 bx lr One can see the difference is in the 3 first instructions that align the stack to 8 bytes. Indeed the stack is not always aligned to 8 bytes inside a function. From the Procedure Call Standard: 6.2.1.1 Universal stack constraints At all times the following basic constraints must hold: Stack-limit ≤ SP ≤ stack-base. The stack pointer must lie within the extent of t
Post edited by ST moderator to be compliant with the ST community rules especially for sharing a code. The latest Cube H5 package (STM32Cube FW_H5 V1.6.0) has broken the use of ADC2_INP0 with the following changes to LL_ADC_EnableChannel0_GPIO and LL_ADC_DisableChannel0_GPIO in STM32H5xxLL_ADC.H. Previous, __STATIC_INLINE void LL_ADC_EnableChannel0_GPIO(const ADC_TypeDef *ADCx) { /* Prevent unused argument(s) compilation warning */ (void)(ADCx); SET_BIT(ADC1->OR, ADC_OR_OP0); } Current, __STATIC_INLINE void LL_ADC_EnableChannel0_GPIO(ADC_TypeDef *ADCx) { SET_BIT(ADCx->OR, ADC_OR_OP0); } Previous, __STATIC_INLINE void LL_ADC_DisableChannel0_GPIO(const ADC_TypeDef *ADCx) { /* Prevent unused argument(s) compilation warning */ (void)(ADCx); CLEAR_BIT(ADC1->OR, ADC_OR_OP0); } Current, __STATIC_INLINE void LL_ADC_DisableChannel0_GPIO(ADC_TypeDef *ADCx) { CLEAR_BIT(ADCx->OR, ADC_OR_OP0); } According to the reference manual t
Hi,in AN5225 an anylzer is used (e.g. Fig 22, page 33). Can anyone tell me which analyzer it is?Best regards,Achim
Hello STM32 community!I'm relatively new to the embedded field and have been diving into communication protocols through small projects. Currently, I'm working on implementing USB CDC on an STM32H563ZI, and I've been facing challenges for the past two weeks.I've extensively searched the internet and followed various tutorials, but unfortunately, none of them seem to work.One of the tutorial(from STM community) that I followed: https://www.youtube.com/watch?v=LdY2bieaPwkI have added read functions to receive the data. I have made two separate semaphores for read and write functions. (It should work even without semaphores though). When I run the code, it's not taking any input from the terminal. Inside app_usbx_device.c file,these two threads(for read and write) were created inside MX_USBX_Device_Init() function.I am giving semaphore inside the while loop here...Inside ux_device_cdc_acm.c file,I am declaring variables...I am defining the read and write functions like this
I’m trying to get a USB Full-Speed Host Mass Storage example running on the STM32H753I-EVAL2 using ThreadX, USBX, and FileX.I’ve generated the base project from CubeMX, but I’m running into a few issues:VBUS Enable/Detection: VBUS is not being enabled correctly via the MFX (IO expander).Even when manually configuring, the stack doesn’t seem to handle VBUS properly in host mode.Memory Pool & Stack Sizes:Default memory pool size and system/stack sizes seem insufficient, causing failures with Mass Storage class. tried increasing but did not succeed and ended up in memfaultsI’m looking for:A working USB FS Host Mass Storage example for STM32H753I-EVAL2 with ThreadX, USBX, and FileX.Guidance on properly enabling VBUS via MFX or directly on the board.Recommended USBX memory pool and stack sizes for Mass Storage class.BSP package for STM32H753I-EVAL2Any example projects, tips, or guidance would be greatly appreciated.Thanks in advance!
Hi everyone, I'm struggling with a critical synchronization issue between TouchGFX Designer (4.2x) and IAR Embedded Workbench (9.60.2) on an STM32H563 project.Whenever I modify the UI (e.g., deleting a Button or adding a ToggleButton), TouchGFX correctly generates the new .cpp and .hpp files in the "generated/" folder.However, upon flashing the device, the UI is completely corrupted:- Images are replaced by random noise or other assets.- Texts disappear- Moving a widget "off-screen" instead of deleting it works, but adding new ones breaks everything again. I'm using Nucleo-H563ZI with Riverdi screen.I tried these steps without success:- Delete IAR folders: Obj, BrowseInfo and regenerated- Deleted TouchGFX/generated and TouchGFX/build and regenerated- Full chip erase (Internal + External Flash) via STM32CubeProgrammer- Forced "Rebuild All" in IAR Any idea on how to fix this issue?
I see in STM32CubeMX that a STM32G411 exists but it has the status "restricted". I'm curious why this type is not widely available. I'm currently using the STM32G431 in an application, mainly because of its raw clock speed of 170MHz. I don't actually need its analog functions but the flash size might become too tight. In that case, my only option would be to switch to the G491, which is more expensive and contains even more unneeded peripherals... So... why is the G411 not available to the public?
Hi Team,I'm recently using the STM32U5G9ZJT6Q part in one of my design. I couldn't find the package mechanical information in Datasheet. For now, I'm using the LQFP-144 form the STM32H573ZIT3Q part number. Will it be okay? Can you please help to verify it? Attaching the below Screenshots,Screenshot from the STM32U5 Datasheet. Not having the LQFP-144 details.Screenshot from the STM32H5 Datasheet. Having the LQFP-144 details
Greetings,I am in the process of integrating the OpenBootloader Middleware application onto a STM32C011 device.I got the code from the STM32Cube/Repository/STM32Cube_FW_C0_V1.4.0/Middlewares directoryI have the code in an STM32CubeIDE project, and it is not compiling?For example:The C file, Interfaces/Patterns/OPTION BYTES/optionbytes_interface.c, has code to write to aFLASH control register. WRITE_REG(FLASH->PCROP2ASR, (*(Data + 56) | (*(Data + 57) << 8)));Yes, the STM32C0 has not such field name PCROP2ASR in the FLASH_TypeDef structure? ../OpenBootloader/Interfaces/Patterns/OPTION BYTES/optionbytes_interface.c: In function 'OPENBL_OB_Write':../OpenBootloader/Interfaces/Patterns/OPTION BYTES/optionbytes_interface.c:162:22: error: 'FLASH_TypeDef' has no member named 'PCROP2ASR'; did you mean 'PCROP1ASR'?162 | WRITE_REG(FLASH->PCROP2ASR, (*(Data + 56) | (*(Data + 57) << 8)));| ^~~~~~~~~How can this
Hello.I'm currently working on the above cpu and trying to implement a custom ble p2p server app. I have 1 service and 2-3 characteristics and i want to add Freertos for time critical constraints managenments. Correct me if im wrong, but it seems that the Freertos stack is incompatible with a custom ble p2p server template. The only thing that i can choose to use when enabling Freertos is the heart monitor template. Is there any work around or do i have to ditch free rtos all together and go bare metal instead ?
Hello,I'm attempting to work with the SAI using DMA on the H7S using the NUCLEO-H7S3L8, unfortunately there is no SAI example. There is an I2S example using DMA on the STM32H7S78-DK:https://github.com/STMicroelectronics/STM32CubeH7RS/tree/main/Projects/STM32H7S78-DK/Applications/USB_Device/Audio_StandaloneI've generated a project for the Nucleo using CubeMX, and then brought over the DMA code in the HAL_SAI_MspInit from that I2S example, and modified it for SAI. The result runs, but a user settings error is reported in the DMA interrupt:Here's the complete project:https://github.com/mojolabsdotnet/saiDmaH7SWhat is the right way to setup DMA for the SAI on the H7S?Thanks!
I am working with the STM32U083RCT6 and I need clarification regarding the exact physical memory addresses of the option bytes.In the reference manual, I can see that the option bytes are located in the system memory area:0x1FFF7000 – 0x1FFF7FFFHowever, the manual only describes the FLASH option registers (OPTR, PCROP1SR, PCROP1ER, WRP1AR, WRP1BR) with register offsets from the FLASH peripheral base address. It does not clearly mention the exact non-volatile storage addresses inside system memory. I would like to confirm:1.What is the officially documented physical start address of the option byte storage in system memory for STM32U083?2. Is 0x1FFF7800 the confirmed start address of OPTR in non-volatile memory?3. If this information is not in the reference manual, in which official document can I find the exact byte-level storage mapping?4. What is the exact physical start address of Option Bytes in STM32U083?5. In which official document is this address explicitly mentioned?I am
Hi ST Community,During my application startup I am facing an issue where TIMx_UP_IRQHandler is constantly triggered while using HAL_Delay(). It seems that the Motor Control SDK is using TIM1 which periodically fires the TIM IRQ handler, interfering with my startup routine.To verify this, I commented out MX_MotorControl_Init() in main.c and my startup routine completed successfully.My startup routine must not be interrupted by the Motor Control tasks. Therefore I need to delay the Motor Control initialization until my startup is complete.Is there an official API to temporarily disable Motor Control Tasks during startup and re-enable them once the application is ready? ( I would like to avoid shifting the MX_MotorControl_Init() function in my startup code) int main(void) { ... /* Initialize all configured peripherals */ ... MX_MotorControl_Init(); MX_IWDG_Init(); MX_SPI2_Init(); /* Initialize interrupts */ MX_NVIC_Init(); // Disable IWDG if core is halted __HAL_DBGMCU
Split from How to program and debug the STM32 using the Arduino IDE.Hi,I am new to this forum having just bought a Nucleo STM32G431 which I want to program using Arduino 2.3.4 on MAC OS 11.7.11. On trying to upload the simple blink example I get the error:Warning: long options not supported due to getopt from FreeBSD usage.getopt: illegal option -- aTerminating...Failed uploading: uploading error: exit status 1Having read around this a little it seems that MACOS is using a BSD version of getopt which doesn't support long options. I believe the problem is in the Arduino core for STM32 MCU based boards (I have version 2.12.0 installed). Do you know of a workaround for this? Do I need to install the GNU version of getopt and is this safe? I am not a MACOS expert. Where would I find that?
my UART settings are as follows:void USART_Configuration(EUartCom uartCom) { USART_Config(uartCom, COM_BAUDRATE[uartCom]); } void USART_Config(EUartCom uartCom, uint32_t baudrate) { USART_DeInit(COM_USART[uartCom]); GPIO_InitTypeDef GPIO_InitStructure; // DE: GPIO_InitStructure.GPIO_Pin = COM_DE_PIN[uartCom]; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(COM_DE_PORT[uartCom], &GPIO_InitStructure); GPIO_ResetBits(COM_DE_PORT[uartCom], COM_DE_PIN[uartCom]); // TX: GPIO_InitStructure.GPIO_Pin = COM_TX_PIN[uartCom]; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(COM_TX_PORT[uartCom], &GPIO_InitStructure); // RX: GPIO_InitStructure.GPIO_Pin = COM_RX_PIN[uart
STM32H563 on custom board. Using NVIC_SystemReset() to reset. It resets consistently.I expect LL_RCC_IsActiveFlag_PINRST() to return true after the MCU comes out of reset. It consistently returns false.NVIC_SystemReset() should result in pin reset, yes?LL_RCC_IsActiveFlag_PINRST() returns false after a restart with STM32CubeIDE debugger also.Could something on the board hold NRST high?
I have created a project in MotorControlWorkbench version 6.4.0 with both no RTOS and FreeRTOS (by clicking the radio button in MotorControlWorkbench) and gotten it to work successfully on my custom hardware based on the EVLServo1 eval kit. However, because I use he Keil toolchain I would prefer to use RTOS2 RTX5 for my RTOS instead. I have managed to create the project with MotorControlWorkbench (with no FreeRTOS) and then when I open it in Keil I go into the Manage RunTime Environment and enable the RTOS2 RTX5 RTOS. This adds a number of files to the project. I have worked through a number of compilation errors and am now getting one last error:Error: L6200E: Symbol SysTick_Handler multiply defined (by irq_armv7m.o and stm32_mc_common_it.o).I understand this to mean that RTOS2 RTX5 has a SysTick_Handler of it's own and so does the HAL libraries created by MotorControlWorkbench and I need to switch one of them over to use a hardware timer like TIM6 instead.&nbs
I am testing the Timer and PWM with different combinations to understand it better on NucleoF446RE board. I have configured as belowTimer1 as Master with trigger output as update event, PWM channel1 output on PA8 (interrupt). Timer2 as slave in trigger mode and output PWM Channel1 on PA5 same as LED based on interrupt.Problem is Timer2 Channel1 output does not toggle on PA5 but if i place break point in tiimer2 interrupt is triggered.void TIM2_IRQHandler(void) { /* USER CODE BEGIN TIM2_IRQn 0 */ /* USER CODE END TIM2_IRQn 0 */ HAL_TIM_IRQHandler(&htim2); /* USER CODE BEGIN TIM2_IRQn 1 */ /* USER CODE END TIM2_IRQn 1 */ }Please guide to solve the issue.
Hello, I am using below the libraries with my project.STM32Cube_FW_H7_V1.12.0 (STM32H7xx HAL 1.10.0)- LwIP V2.1.2, FreeRTOS V10.2.1, 2017 - ethernetif.cAnd I designed the HTTP Server with STM32H743ZIT6. It is very well operate.And I updated the libraries such as STM32H7xx HAL 1.11.5 recently.- LwIP V2.1.2, FreeRTOS V10.3.1, 2022 - ethernetif.cAll normal operations are functioning properly. (TCP, UDP)However, an errors is occurring in the HTTP Server.I implemented it by referenceing the LwIP_HTTP_Server_Socket_RTOS example from the STM32H7 HAL repository.When approximately two files are requested simultaneously in a Web Browser, LwIP becomes unresponsive.(Ethernet Event Handler is running when LAN cable Unplug and Plug) (capture packets in old version) (capture packets in new version)There are no changes to the application. (httpserver_socket.c)But, these error continue to appear. I would appreciate any helpful advice. Best regards, 
Hi, I'm using STM32H745ZI implemented ethernet with Lwip it's working fine STM32CubeIDE(ver-1.90.0) but not in IAR(ver-9.30.1) like any changes that I need to do in .icf file of IAR because it's working fine Cube IDE
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.