Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Im using a STM32WLE5CCU6 board, I am able to log easily using the APP_LOG() helper function that is provided. The problem is that im not able to receive anything as the USART interrupt never fires hence, HAL_UART_RxCpltCallback() is never called. After searching in the web I saw https://github.com/STMicroelectronics/STM32CubeWL/issues/34 facing the same issue, however the fix they have said doesn't work for me. I also tried the changes proposed in bug stm32 hal driver lock mechanism is not interrupt safeand https://github.com/STMicroelectronics/STM32CubeWL/issues/32 Yet none of these solutions make the interrupt work. If I comment HAL_UART_Transmit_DMA(&huart1, p_data, size); in UTIL_ADV_TRACE_Status_t vcom_Trace_DMA(uint8_t *p_data, uint16_t size) { /* USER CODE BEGIN vcom_Trace_DMA_1 */ /* USER CODE END vcom_Trace_DMA_1 */ HAL_UART_Transmit_DMA(&huart1, p_data, size); return UTIL_ADV_TRACE_OK; /* USER CODE BEGIN vcom_Trace
STM32WB55arm_rfft_fast_instance_f32 fft_instance; arm_rfft_fast_init_f32(&fft_instance, NUM_SAMP);I'm trying to use the rfft_fast function from the arm_math.h libraryBut when I compile I get... ../STM32_WPAN/App/custom_app.c:122:24: error: expected declaration specifiers or '...' before '&' token122 | arm_rfft_fast_init_f32(&fft_instance, NUM_SAMP);| ^../STM32_WPAN/App/custom_app.c:69:25: error: expected declaration specifiers or '...' before numeric constant69 | #define NUM_SAMP 256 I looked at the docs & many examples of the init function, the usage is always as above. Compiles fine if I comment out the init function but obviously that is of no use to me.
Hello all, currently if I want to turn my cpus to 480 MHz and 240 MHz, I have to switch to ldo, and voltage scale 0, rev v. Using the default SMPS will give only 400MHz, I tried 480MHz with the wrong scale, SMPS, and successfully debugged the M7 but the M4 got stucked on "waiting for debugger connection" forever (it didn't say no target found). In UM2408 table 10 section 7.4.8, switching to internal LDO only will require removing some soldier bridge and changing capacitor value. Does it mean I will have to physically do it according to the datasheet everytime not only for LDO but other peripherals too ? Thank you.
Hi everyone,I'm working on a project using the STM32F103C8T6 microcontroller and the ICM-20948 IMU sensor, connected via I2C. I'm using STM32CubeIDE with FreeRTOS integration.In a bare-metal (non-RTOS) project, the IMU communicates correctly. The device address is detected properly, and I get valid accel/gyro data.When I move to a FreeRTOS-based project using the same I2C configuration, the IMU fails to respond.The device address is not found, and I get errors from HAL_I2C_Mem_Read().I've confirmed that I2C are initialized before osKernelStart(). want to reliably read IMU data (ICM20948) using I2C + FreeRTOS on STM32F103C8T6.Can anyone who has done this successfully share suggestions or example code?
Hello, According to the STM32L496 reference manual, the DAC should be disabled before entering STOP2 mode, which implies that it doesn’t operate in STOP2.However, in STM32CubeMX there is a configuration option for DAC output — external pin, on-chip peripheral, or both.Earlier, when I selected external pin, the DAC output was not working in STOP2 mode (as expected). But now, after selecting on-chip peripheral, it is working even in STOP2 mode.I am using DAC_OUT1 and DAC_OUT2 as threshold references for an internal comparator (not external output pins).My questions:Is it safe and valid to use the DAC with the on-chip peripheral option in STOP2 mode?Or should I restrict my design to STOP1 mode for reliable operation?Appreciate your help and clarification. Thank you,Mounika
What's wrong with my code? Every time I start a DMA transfer only 2 Bytes get transferred although I specified 16 bytes.Also, I get an FIFO Error after transmit, whereas Transmit Complete is ok./* FUNCTION ************************************/ void SPI1_Init (void) /************************************************/ { LL_SPI_Enable (SPI1); LL_DMA_EnableIT_HT (DMA2, LL_DMA_STREAM_3); LL_DMA_EnableIT_TE (DMA2, LL_DMA_STREAM_3); LL_DMA_EnableIT_TC (DMA2, LL_DMA_STREAM_3); LL_DMA_EnableIT_DME (DMA2, LL_DMA_STREAM_3); LL_DMA_EnableIT_FE (DMA2, LL_DMA_STREAM_3); } /* --- SPI1_Init --- */ /* FUNCTION ************************************/ void SPI1_Write_DMA (uint8_t *buff, uint16_t count) /* * Write a complete buffer to SPI with DMA ***********************************************/ { uint32_t reg_addr; reg_addr = LL_SPI_DMA_GetRegAddr(SPI1); LL_DMA_ConfigAddresses (DMA2, LL_DMA_STREAM_3, (uint32_t)buff, reg_addr, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); LL_DMA_SetDataLength (DMA2, LL_DMA_STREAM
Hi!I’m currently building an application where I need to periodically wake up my NUCLEO-U575ZI-Q from Standby mode using RTC alarms. I’m aware of the Wake-Up Timers, but I’ve been specifically asked to use alarms. This will be integrated into a FreeRTOS system, but for now I’m trying to get it working in a plain project. I’m using IAR 9.50.1 as the IDE.I’ve tried everything, but nothing works. I’ve cleared all the required flags, set the others, but I still can’t get it to wake up from an alarm. I’ve been able to wake the MCU using the user button and another wake-up pin, but not via alarms.This is the code I’m currently working with: main.cAnd this is an auxiliary rtc.c file used to initialize the RTC: rtc.cAll the important flags seem to be set correctly. For example, in RTC_SR: ALRAF/ALRBF/WUTF/TSF/TSOVF/ITSF/SSRUF = 0. In RTC_CR: ALRAIE = 1 and ALRAE = 1. In RCC_BDCR: RTCEN = 1.In PWR, all WUFx flags are clear.I’m also attaching the current values of the RTC, RCC, and PWR registers
Hello Sir/Madam, My project is using Nucleo-F767Zi + X-NUCLEO-IKS4A1. The calibration data need to store in STM32F767ZI flash memory. I have coded writing and loading function for this purpose. However, the data read out from the flash memory are different from the data written into with forementioned functions. I do appreciate your help for debugging my codes and sorted out the issues. My codes are: /** ****************************************************************************** * @file motion_ac_flash.c * @author ChatGPT * @brief 实现 MotionAC 加速度计校准参数的 Flash 存取功能 * - 使用 STM32F767ZI 的内部 Flash(Sector 11) * - 支持写入后逐字校验 * - 保证读取与写入数据完全一致 * - 自动刷新 D-Cache,避免缓存导致读出旧数据 ****************************************************************************** */ #include "motion_ac_manager.h" #include "motion_ac.h" #include "stm32f7xx_hal.h" #include <string.h> #include <stdio.h> /* -------------------------------------------------------------------------- * Flash 存储地址设置(根据 STM32F767
Hai All, Got a STM32F446 & IHM08M1. Planning to do the six step commutation using High/Low Method (without PWM), Hall Effect Sensor & Timer. What are the precautions to be considered? Any links..
Hi,I am working STSPIN32F0 and I have STVAL-SPIN3201 evaluation bord and install Motor Control WorkBench 6.4.1.When I try to generate project, it is given "STM32CubeMX not found - ver. "6.0.0" or higher is required" error but CubeIde 1.19.0 was install in my computer nevertheless I install cubemx 6.15.0 but problem to continue.How can solve this problem?
dear all!i'm trying to set up model run external with matlab via TCP/IP. when i build it have some issue, i don't how to config. i build model on Matlab 2024b and STM32CubeMX 6.4. can you share me how to set up step by step.
Hi, am new to STM32 and i am trying to configurate my Nucleo but i don't understand my problem i am trying to setup a basic blink code with the basic structure (serial port communication with putty , debugger stlinkv3 and communication between cores but i can manage to ger it right thank you for any help or advises)my problem is i cant manage to setup a basic ioc files configuration for my stm32h755zi-q in the stmcubeide 1.18 i have a basic blink code using both core that work but when i try to setup whit other clock parameters configuration i cant manage to start the program (stlink v3 on the bord look like i cant connect)
Hi,I attempt to free the 1st sectors of the MCU flash by relocating the firmware and its interrupt vector table to further sector (e.g sector 5 at 0x08040000 address). For that purpose, I updatedthe linker (IAR) configurationthe vector table location by setting SCB->VTOR (set to 0x08040000)the boot address option byte BOOT_ADD0 (set to 0x2001 to get the 0x0804000 boot address)This configuration is only working from my debugger. The system does not start, neither in standalone, neither from the Go command of the system bootloader.However, the Reset Handler address is well available at the 0x08040004 address.Ifthe interrupt vector table is located at the 0x08000000,the code remains at the 0x08040000 address,SCB->VTOR is updated to 0x08000000,BOOT_ADD0 set to 0x80 (i.e. 0x20000 boot address) or set to 0x2000 (i.e. 0x08000000 boot address),the system is able to start, either in standalone, either from the Go command of the system bootloader.What did I miss to get the system starting
Hi, I have been facing with an issue that like stm32wl LoRa feature is not compability with other transceivers.However, had 4 transceivers: 1. Esp32-sx126x2. stm32f429-sx126x3. stm32wl (x2) First two can easily communicate with each others, they can exchange data even in pingpong structure but they can't send or receive data from stm32wl. In first glance, i don't know why but stm32wl couldn't be set correct syncword. After explicitly writing to its register problem solved and i could just see some thing on scanners (first two were in receiving mode) but always CRC error occurs. When third one was in tx mode and others in rx mode, others rised CRC errors and visa versa...In other hand (without changing any configuration), stm32wls can communicate with each others. And yes i examine and double-double check all parameters of LoRa (like sf,cr,bw,frequency). After all question rised is there stm32wl incompatibility with other LoRa tranceivers (Specif
Hello!I'm using STM32F401 (Blackpill board).I made an experiment like this. I set my PC serial setup as 8n1 and UART6 serial setup as 8n2.And started communication between my PC and UART6.It was okay. Nothing went wrong. For both sides, tx and rx.Before this experiment, I expected two things.1. TX setup 8n2 and RX setup 8n1 will be okay. Because receiving side will detect start bit whatever the stopbit is .2. How does MCU receive from UART? If it is set as 8n2, can it receive the things transmitted as 8n1?I was not sure about 2nd problem. Can anyone teach me how STM32F401 receives UART things? I need to know whether the 2nd case is really vaild or not.Thank you.
Dear all,For a project I'm generating a sin wave with DAC and sampling concurrently with two ADC's. Both DAC and DMA are updated by the DMA. The DAC is triggered by a timer and the two ADC's by another timer.Details of my setup:- STM32G491- DAC3 routed via internal opamp as voltage follower, running at 25MHz in DMA double data mode, trigger source: TIM3 update event.- ADC1 channel1, ADC2 channel2, both fed by PLLP at 60Mhz, independent mode, continues conversion mode disabled, trigger source: TIM7 update event, 12-bit resolution, 2.5 cycles sampling time, DMA in normal mode.- TIM3 triggers DAC running at 25MHz.- TIM7 triggers ADC1 and ADC2, running ideally at ~4MHz.- APB and AHB busses all running at 150MHz The problem I'm facing is that the ADC's seem to skip some samples at fixed interval as can be seen in the figure below. I can't figure out what's the problem.I already have tried the following, all without any changes in the skipping of the samples:- Lower the triggering frequ
Hey,I want to Integrate with Lora module sx162 with stm32 Board. Can any one Help me ??
Hi there,I am working on a project that requires sending just two commands to an FT232 chip and waiting for the response data.I can already successfully communicate the STM32 USB HOST CDC and the STM32 USB DEVICE CDC (refer to repo's first commit ).However, while I was trying to modify the USB HOST CDC example to work with FT232(refer to the above repo's second commit), it didn't work.Can anyone give me some advice or demo code?Thank you.
Hi, @Peter BENSCH . I am working on a project. In which i need to control Stepper motor using X-Nucleo-IHM01A1 Sheild. Currently i'm using STM32G431RB Nucleo-64 board for this and in future will use STM32F103. I've download X Cube SPN1 for basic working. But i think it does not support boards like (STM32G4 and STM32F103). How can i change X Cube SPN1 Library to make workable or any Solution for making L6474 to work with STM32F103 ?Moreover, I successfully run Stepper motor with STM32G431RB in Arduino IDE same version of this library. Link of library is attached. https://github.com/stm32duino/X-NUCLEO-IHM01A1. Thanks
Hi all,I’m currently working on a wireless mesh network project using the S2868A2 expansion board with the NUCLEO-U083RC, operating in the 868 MHz ISM band.This system is designed to be low-power, which is why I’ve selected the Sniff Mode (LDCR) feature of the S2-LP. My goal is to achieve a reliable connection with >200 m LoS range, but currently, I’m seeing packet drops even at short distances (50–60 cm).I’ve been debugging this issue for the past few months without much success. I’d really appreciate it if someone could help review my firmware setup and configurations, or share best practices for using sniff mode effectively.This post is organized as follows:A brief system overviewS2-LP parameter configurationsIssues observedDebugging steps and tests performed1. Brief System Overview I have used the X-CUBE-SUBG2 to communicate with S2-LP hardware.Each node acts as a transceiver, toggling between TX and RX.This setup is based on SDK_Sniff_A/B examples from ST.I’m using st
Hello everyone,I am doing a project of sampling a PWM signal and reproduce it dynamically using the HRTIM. The following code:uint16_t oldPer = 0, oldDur = 0, update = 0;uint16_t newPeriod = 0;uint16_t newDuration = 0; void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim){ if (htim->Instance == htim2.Instance && htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1) { newPeriod = HAL_TIM_ReadCapturedValue(htim, TIM_CHANNEL_1); newDuration = HAL_TIM_ReadCapturedValue(htim, TIM_CHANNEL_2); if (oldPer > (newPeriod + 100) || oldPer < (newPeriod - 100)) { HRTIM1->sTimerxRegs[HRTIM_TIMERINDEX_TIMER_A].PERxR = newPeriod; update++; oldPer = newPeriod; } if (oldDur > (newDuration
the sample code I2C_TwoBoards_ComDMA for the STM32H563 EVB.On the host side, if the command length is unknown and may vary from one to three bytes, how can I modify the following function to handle a variable-length transfer based on I2C received size of bytes instead of a fixed size?HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size)Thanks
Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code Everything works fine when using the GNU compiler. However, when using the ARM V6 compiler,The touchGFX program cannot automatically run. The reason is that the printf statement was used in the touchgfx library. In ARM V6 C++ Standard Library, The printf IO is redefined to breakpoint instruction. So the program cannot run automatically when using touchgfx library in KEIL. Solutions: Retargeting printf() /* Defining __FILE_INCOMPLETE as 1 allows compilation of __FILE with * a strict ANSI C standard without conflict with stdio.h. */ #define __FILE_INCOMPLETE 1 #include <stdio.h> struct __FILE { int handle; /* Whatever you require here. If the only file you are using is */ /* standard output using printf() for debugging, no file handling */ /* is requi
Hello,I have been working on a project recently that has me using the SPI1 and 2 peripherals to perform conversion between a non-standard serial format and TCP/IP. I have SPI 1 set up as a transmit-only master which takes data received via TCP/IP and sends it to another device using HAL_SPI_Transmit_DMA. This works fine by itself.I also have SPI2 set up as an rx-only slave. This receives incoming variable length serial data from another device that has a head and tail sequence to identify each packet. These come in very slowly at 64khz, and are only sent once every 200ms. A tim2 interrupt triggers a scan of the circular buffer they are received into, and if a header/tail is found then the SPI is halted, pointed at the other of two buffers, and restarted, and the rxed packed is DMAed out into memory. This also works fine by itself.My problem is that calling HAL_SPI1_Transmit_DMA causes the data received by SPI2 to be bitshifted right anywhere from 1-8 bits, so the head/tail sequence can
good morning. since this morning, on my nucleoH755ZIQ I am trying to make work my UART connection. I followed the stm video on YouTube and did as said: connected USART 2 (doesn't USART 1 work?) and then implemented the simple code in the while loop of my main. unfortunately, when I run the console, nothing appears. I even tried it on putty and again nothing came out. so I decided to change board and take the NUCLEO C031C6 but this time could not even access the USART 2. does somebody knows what could be the problem or have a simple code I could try to understand if the problem is the hardware or the software? best regards
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.