Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I configured FREERTOS on my STM32FT67ZI card with a USART3 device. I started the microROS agent on my PC but the connection is not created and it gives me this message: run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM2 -b 115200 [1762814038.235435] info | TermiosAgentLinux.cpp | init | running... | fd: 14 [1762814038.236035] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 4 What could it be?If I search for the topic, it doesn't bring up any results.How can I tell if the problem is on the card or the PC? I'm connected to the ST-Link USB cable.
Hello,Need information about, does LPUART can wakeup? if the clock source is LSI (32Khz)?Because I have tried multiple examples to wakeup but it only works in debug mode but not in release mode.I have also work on optimization level, currently optimization is None for both debug and release.Thanks,Nitin
Hello all, I am doing some tests with a NUCLEO-U575ZI-Q Board and FreeRTOS. I have created a simple program based on a STM32 examples, the unit will go into EnterSTOP2Mode and wakes up when the button is pressed.This is the code I have on the main.c file: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(); /* Configure the System Power */ SystemPower_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ /* Init scheduler */ osKernelInitialize(); /* Call init function for freertos objects (in freertos.c) */ MX_FREERTOS_Init(); /* Start scheduler */ osKernelStart(); /*
Hi Everyone,I am working on the Project where STM32F407VET6 with External PHY. Configured the ETH and LWIP and I am able to get the IP address. Now I need implement the MQTT in the project. With MQTT command received some task will be performed by the STM MCU. Set up No RTOS used. Any Example of Ethernet MQTT will be Helpful. I think to use MQTT. Which library will be helpful.Thanks and regards,Mallikarjun
Hello everyone, for a few days I have been struggling with skipping and running the bootloader on stm32g474ret6 via usart.I have an STM, 12MHz crystal, and an FTDI chip on my own PCB, with RTS/CTS disconnected for now. After sending a command via USART, the control LED lights up, but the bootloader doesn't start. What am I doing wrong?#include <stdint.h> #include "stm32g4xx.h" #include "stm32g4xx_hal.h" #define SYS_MEM_BASE 0x1FFF0000 void JumpToBootloader(void) { __disable_irq(); SysTick->CTRL = 0; for (int i = 0; i < 8; i++) { NVIC->ICER[i] = 0xFFFFFFFF; NVIC->ICPR[i] = 0xFFFFFFFF; } __DSB(); __ISB(); HAL_DeInit(); HAL_RCC_DeInit(); __HAL_RCC_HSI_ENABLE(); while (__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET); __HAL_RCC_SYSCLK_CONFIG(RCC_SYSCLKSOURCE_HSI); __DSB(); __ISB(); uint32_t msp = *(__IO uint32_t *)(SYS_MEM_BASE + 0x0); uint32_t reset = *(__IO uint32_t *)(SYS_MEM_BASE + 0x4); SCB->VTOR = SYS_MEM_BASE; __DSB(); __ISB(); __
Hello, I am working with an STM32G431 MCU and referring to the STM32G4 Series Safety Manual (UM2454). In section 3.6.4 (Embedded Flash Memory) — Table 21: FLASH_SM_0, it describes a periodic software test for Flash memory using signature-based methods (e.g., CRC). According to the document, this diagnostic can be implemented via X-CUBE-STL, but I would like to implement it manually, without using the STL library. My goal is to verify Flash memory integrity periodically or at startup by computing a CRC over a defined Flash region and comparing it with a stored “golden” reference signature in Flash. I would like to understand the following: What is the correct approach to implement FLASH_SM_0 manually according to the safety manual’s requirements? How should I select the Flash regions for testing (code, data, unused memory)? What is the recommended way to store and update the reference (golden) CRC signature in Flash? Are there any STM32 hardware CRC peripheral examples or best p
Hello,I have modbus master and slave device, where I have design modbus master for testing in that way that it will continuously send modbus request after each successfull response, and if any response fail then it stop.Now on I'm getting continuous response from slave device and working fine. The issue is with slave device having undesired behavior if we restart the slave device.Slave device has custom bootloader and slave device. So once we start the device it will start bootloader and bootloader will take care to check integrity of slave application and if all well, then jump to slave application.So, if I dump the code in release mode (via bootloader) first time then slave device continuously give response on each request and it continue until I stop or reset and even after master reset and ON again, the slave device still continue to work well.Note: It works in all the way if we dump a debug code, only issue with release code. I have remove bootloader and allow to run s
Description:My RTOS application on NUCLEO-H563ZI board runs a thread CollectSamplesThread. I generate an interrupt every 8Khz using a timer and the ISR triggers a non blocking SPI transfer:The application code: void InitAdeSpi() { // SPI1 Initialisation if (hSPI.hdmarx != NULL) { HAL_DMA_RegisterCallback(hSPI.hdmarx, HAL_DMA_XFER_CPLT_CB_ID, AdcSpiRxCallback); } } void AdcSpiRxCallback() { BaseType_t xHigherPriorityTaskWoken = pdFALSE; // Release the sempahore thats blocked to validate the frames in CollectSamplesThread xSemaphoreGiveFromISR(xSpiRxSemph, &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } void TIM3_IRQHandler(void) { EvbDataRdyTimerHandler(); } void EvbDataRdyTimerHandler(void) // Ensure this matches the existing declaration { __HAL_TIM_CLEAR_FLAG(&hTimDready, TIM_FLAG_UPDATE); // Release the sempahore that is blocked in the CollectSamplesThread for Dready callback xSemaphoreGiveFromISR(xSamplesAvailS
Hello, I have modbus master application (Free RTOS using CMSIS lib), in which modbus constructure init the timer_ with osTimer. osTimerId_t ModbusMaster::createTimer_(const char* name) { osTimerAttr_t attr{}; attr.name = name; auto t = osTimerNew(responseReady_, osTimerOnce, this, &attr); return t; } So Modbus master send request to slave and start timer to wait for response, at start stagingLength_ = 0 __HAL_UART_ENABLE_IT(uart_, UART_IT_RXNE); HAL_UART_Receive_IT(uart_, &mbMsg_.payload.rawResponse.rawData[stagingLength_], 1); osStatus_t stat = osTimerStart(timer_,1500); Now as soon as I got first character received, I will change the period of timer to 3.5 character silence time and once that silence time is expire, the time will invoke its callback as responseReady(). Here below the value 1000 is not match with silence time but keep as big as possible. void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { if(huart->Instance == USART2) { BaseType_t xHighe
Hello,I'm doing Modbus communication using RS485. And using MAX485 IC to convert to RS485. and running on Free RTOS CMSIS.I have tried and the behavior is random for all below, not consistent. Here I have tried with RS232 and it works like charm. The only issue with RS485. Where Modbus slave we have testing separately and it works fine too. - Transmit and receive blocking call but seen packet drop during receive- Transmit and receive interrupt with each byte and complete block of bytes, and saw complete frame is missing in reception.- Transmit blocking and Receive using DMA, saw complete frame missing during reception.- Transmit DMA and Receive DMA, saw receive frame is missing. So lets continue discussion on DMA transmit and receive.Here is the configuration for DMA and the USART2 is running at 16mhz- Enable DMA for rx and tx and also enable rs485 hardware flow control, so that it can internally handle the DE pin.static void MX_USART2_UART_Init(void) { huart2.Instance = USA
Hello,It is the first time I am using STM32 and migrating my code from texas instruments controller using USART3. I want to receive data and then transmit data of different sizes. I get a problem that I see appears often but in my case I cannot see why it appears. I want to use USART on port C, PC4 = Tx and PC5 = Rx. I have a partner sending data via uart and I can see the data is on the Rx line but somehow it does not come to the buffer. I get to the interrupt handler and then Error callback. I am using the receive to Idle with interrupts when data is received. The first expected data is 10 bytes, my rx buffer is 1024 big and my rx buffer is defined , not NULL. I call the function for receive directly after my partner device is on and I have got the reply this device is on. The partner device is making 10 attempts to send the same data and without answer is shutting down. It starts sending shortly after it is on. My uart onfiguration is as follows: handleUart3.Instance
Hello everyone, I am working with an STM32H5 series board and have successfully initialized Ethernet using the lwIP stack.The DHCP process works correctly — I am able to obtain an IP address. However, I am facing a “Request Timeout” issue when I try to communicate with other devices or servers over the network. Below is my sys_check_timeouts() function (default lwIP implementation): void sys_check_timeouts(void) { u32_t now; LWIP_ASSERT_CORE_LOCKED(); now = sys_now(); do { struct sys_timeo *tmptimeout; sys_timeout_handler handler; void *arg; PBUF_CHECK_FREE_OOSEQ(); tmptimeout = next_timeout; if (tmptimeout == NULL) { return; } if (TIME_LESS_THAN(now, tmptimeout->time)) { return; } next_timeout = tmptimeout->next; handler = tmptimeout->h; arg = tmptimeout->arg; current_timeout_due_time = tmptimeout->time; memp_free(MEMP_SYS_TIMEOUT, tmptimeout); if (handler != NULL) { handler(arg); } LWIP_TCPIP_THREAD_ALIVE(); } while (1); } My setup: Control
Hi everyone, I'm working on a STM32F429I-Discovery board and trying to output a 24 MHz PWM signal on PA8 (TIM1_CH1) to drive an MT9M001 camera module as the XCLK signal. In my own CubeMX-generated project, PA8 stays LOW — no waveform appears.However, if I take the official exampleProjects/STM324x9I_EVAL/Examples/DCMI/DCMI_CaptureMode,and add the same PWM settings, the signal comes out fine. Here’s what I confirmed: TIM1 initialized successfully with HAL_TIM_PWM_Init() and HAL_TIM_PWM_ConfigChannel(). GPIO A8 = AF1_TIM1, Push-Pull, No Pull, Very High Speed. HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1); is executed. PWM period = 7 (≈ 22.5 MHz), pulse = 4 (≈ 50 % duty). System clock = 180 MHz (PLL on HSE 8 MHz). No error occurs, but no output. Thanks for any advice! Edited by ST moderator: removed system_stm32f4xx.c content not needed for the conversation.
We need to use quadrature phase counting with STM. can u please confirm if phase failure is supported in this mode or not .
I ran the example project and successfully displayed “Hello World” on Tera Term.Then I tried to port this project into my own one.However, the result was garbled characters in the terminal.The baud rate (115200) and PLL/clock configuration are the same as in the working example.Do you have any idea what might cause the characters to be corrupted? /** ****************************************************************************** * @file DCMI/DCMI_CaptureMode/Src/main.c * @author MCD Application Team * @brief This example describes how to configure the camera in continuous mode. ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided
Hi everyone,I’m currently working with the VENC_RTSP_SERVER example. I was able to successfully run it and capture video using ffplay, but the stream is currently encoded at 960×720 @ 20fps.I’m trying to reduce the resolution to 480×480@20fps. To achieve this, I modified the MX_DCMIPP() function and changed the encoderI also tried adjusting related parameters such as ewl_pool, VENC_OUTPUT_BLOCK_SIZE, and VENC_OUTPUT_BLOCK_NBR.However, after these changes, the video feed is distorted and looks like this:Has anyone encountered this issue or know what additional configurations need to be updated to properly support a 480×480 resolution?Thanks in advance for any guidance!
Hi,Tried to convert STM32CubeN6\Projects\STM32N6570-DK\Applications\USBX\Ux_Device_Audio_2.0 example of the USB speaker to the USB microphone on STM32N6570-DK.The USB device is enumerated as an audio recording device, ux_device_class_audio_stream_frame_done() is called, and then I fill the buffer with the functionsux_device_class_audio_write_frame_get(audio_play_stream, &frame_buffer, &frame_length); ux_utility_memory_copy(frame_buffer, &stereo24[idx], 12 * 2); SCB_CleanDCache_by_Addr(frame_buffer, 12 * 2); ux_device_class_audio_write_frame_commit(audio_play_stream, 12 * 2);The buffer is filled with a tone of 32767 magnitude, but recorded data is 70dB lower, or just strange noise.I can share this small project via DM if it's convenient.Regards.
Hello,I am using the Nucleo U575ZI-Q board. I need to use GPDMA synchronized with a timer to set multiple GPIO pins synchronously, perform SPI transmission, and configure PWM periods.I have found a working combination: software request + trigger TRGO. However, TRGO is only available for TIM15 and TIM2, which limits its versatility. Ideally, I would like to use hardware requests (such as REQUEST_TIM15_UP).Set TIM15 to output TRGO. Configure GPDMA1_CHANNEL7 with LinkedList for DMA_REQUEST_SW and set the trigger to GPDMA1_TRIGGER_TIM15_TRGO. The direction should be set to Memory-to-Memory. Specify the source as memory and the destination as GPIOA->BSRR or SPI2->TXDR. This will allow you to generate the waveform shown in the attached oscilloscope.uint32_t gpio_node_data[4] = { 0x00000100U, // PA8 = High -> bit8 set (1 << 8) 0x01000000U, // PA8 = Low -> bit24 set (1 << (8 + 16)) 0xFFFFFFFF, 0xFFFFFFFF }; uint32_t spi2_node_data[4] = { 0xAAAAAAAA, 0x55555555, 0x11111
Hi,first foray into STM32 with a Nucleo-F7222ZE.Using CubeMX I have set up Timer1 to generate PWM. I can get outputs OC1, OC2, OC3 etc, but I cannot get the complementary outputs OC1N, OC2N, OC3N to operate. I feel like I'm missing something, like dead band between OC1 and OC1N for example..I've tried just about every combination I can think of in CubeMX, with no result so far. Craig
I am trying to configure a single microphone with a pulse-density modulation (PDM) output on my microcontroller (STM32U575ZIT). It's a CMM-4030DT-261280-TR MEMS microphone.But I can't seem to figure out the basics. The SAI settings mention "Frame Length", "Data Size" and "Slot Size". What even are slots and frames in this context? I think I understand PDM and it makes sense to define a data size: how many bits should be counted together to form a single data point. The other notions however confuse me.Attached is my SAI config from CubeMX. I logged the clock and data using a logic analyzer some testing code on the MCU hoping to figure this out. The code: HAL_SAI_Init(&hsai_BlockA1); std::array<uint8_t, 8> data; data.fill(0); auto ok = HAL_SAI_Receive(&hsai_BlockA1, data.data(), data.size(), 100); HAL_SAI_DeInit(&hsai_BlockA1);The analyzer output and the content of data after this block: For one I am surprised to see 37 rising edges, instead of 8
Hi All ,Am imported a example project in stm32cube and i tried to build am getting error as Description Resource Path Location Typenon constant or forward reference address expression for section .ARM.extab LTDC_Paint line 90, external location: c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe:D:\stm32_projects\exp1\LTDC_Paint\STM32CubeIDE\STM32H750XBHX_FLASH.ld C/C++ Problem can u please provide the solution.thankyou,regards shiva chary
Hello ST, I am having some trouble generating two PWM signals for a push pull converter. Ideally I would like the PWM outputs to look like this, I would like the PWM frequency to be 100kHz and a duty cycle range of 0% to 50%. I have connected the push pull converter to PA0 and PA1. First I configure the GPIO Pins, void MX_PWM_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; /* Enable clocks */ __HAL_RCC_TIM2_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); /* Configure PA0 for TIM2_CH1 */ GPIO_InitStruct.Pin = GPIO_PIN_0; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Alternate = GPIO_AF2_TIM5; //CH1 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); /* Enable clocks */ __HAL_RCC_TIM5_CLK_ENABLE(); /* Configure PA1 for TIM5_CH2 * NOTE: Using CH2 on PA1 to avoid conflict with TIM2_CH1 on PA0 * You can use different pins if needed */ GPIO_InitStruct.Pin = GPIO_PIN_1; G
Hello,In the STM32CubeC0 v1.4.0, when I enable the BYPSHAD bit in the CR register and later try to deinit the device, I get an ERROR. It does not happen if I disable it before deinitialising. Should I disable it by hand, or is it a mistake and should be cleared as in other families? HAL version is clearing the whole register to the reset value when deinitialising.Best regards,Tomáš
Hopefully this is not a dumb question...I am referencing the example code here:https://github.com/STMicroelectronics/STM32CubeG4/tree/master/Projects/STM32G474E-EVAL/Applications/OpenBootloaderI see the entry point for the the open bootloader app (app_openbootloader.c), but I don't see where the actual core files for the the bootloader are ( ie openbl_core.c)Where would those files be in that project? Do I just download those files from here seperately? https://github.com/STMicroelectronics/stm32-mw-openbl/tree/main/Core
Hi,We are building an IoT device, using STM32L476RET6 as main core. It communicates with an LPWAN modem with AT-commands via UART. We have redirected UART2 into external pins for "serial output" into Nucleo RX pins.During testing, we noticed initially that some devices where seemingly "stuck" in some state - no printing in Nucleo RX, not responding to external interrupts - while communicating with LPWAN modem ( it stayed in idle ON state). No hard fault or similar (we have put checks inside repsective callbacks). IWDG can reset the device, but it is a "last resort" method.After putting device in debug mode, catching the situation and pausing the code, it stopped here : void HAL_UART_IRQHandler(UART_HandleTypeDef *huart) { uint32_t isrflags = READ_REG(huart->Instance->ISR); uint32_t cr1its = READ_REG(huart->Instance->CR1); <<<-------Looking at USART1 ISR register, we found ORE error flag.Resuming the code in debug mode makes the MCU continue, but in run
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.