Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
The serial port 1 code generated by the latest STM32CubeMX 6.13.0 will print garbled characters, and using the serial port routine UART_Printf in STM32Cube_FW_H7_V1.12.0 will also print garbled characters. It doesn't work when using the serial port routine UART_Printf in STM32Cube_FW_H7_V1.11.2. After comparison, there is a difference here. I can’t understand the function here. I will be careful whether changing it will affect other functions. *This post has been translated from Chinese to comply with the ST Community guidelines.
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code. Hello! I connect one I2C target and one I3C target device both to PB6/PB7, which is configured to be "mixed I3C and I2C bus" through STM32CubeIDE. I3C parameter configuration is as below: /* USER CODE END I3C1_Init 1 */ hi3c1.Instance = I3C1; hi3c1.Mode = HAL_I3C_MODE_CONTROLLER; hi3c1.Init.CtrlBusCharacteristic.SDAHoldTime = HAL_I3C_SDA_HOLD_TIME_1_5; hi3c1.Init.CtrlBusCharacteristic.WaitTime = HAL_I3C_OWN_ACTIVITY_STATE_0; hi3c1.Init.CtrlBusCharacteristic.SCLPPLowDuration = 0x18; // 5MHz hi3c1.Init.CtrlBusCharacteristic.SCLI3CHighDuration = 0x18; hi3c1.Init.CtrlBusCharacteristic.SCLODLowDuration = 0x7b; //1MHz hi3c1.Init.CtrlBusCharacteristic.SCLI2CHighDuration = 0x7b; hi3c1.Init.CtrlBusCharacteristic.BusFreeDuration = 0x69; hi3c1.Init.CtrlBusCharacteristic.BusIdleDuratio
Hi,Im new to STM and trying to use 1 adc with DMA with 2 input and reading value.Board :STM32H753XI EVALADC 1 :INP0 rank 1INP1 rank 2Functions : void adc_dma_multi(void)void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) Results :I tried to swap rank between INP0 and INP1 to check if my second entry was read correctly and there were no hardware problems, and the result is the same: rank1 is read correctly but rank2 = 0. I have attached main.c and IOC.
I am new to STM32 programming.I am doing an stm32 project with STM32F407VET6 MCU, I want to implement a music player that can read a list of wav files from sd card and stream the music data to a external DAC chip (PCM5012a) using double buffering apporach. I have configured SDIO and FATFS with DMA enabled for perfrming the sd card interfacing and read files, which should be working normally. But the main problem is comming from I2S3 with DMA, as it doesnt continue stream subsequent audio chunks after the 1st one. Here is my i2s3 ioc configurations:I tested the playback in my main.c file, this is an abridged version:/* Includes ------------------------------------------------------------------*/ #include "main.h" #include "fatfs.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "lcd.h" #include "touch.h" #include <stdio.h> #include "sd_interface.h" /* USER CODE END Includes */ /* Private define -----------
Hello, I have a problem with a STM32L431CC generating a circular PWM burst with the DMA. I am using the Timer1 to generate 4 PWM signals on the Pins PA8, PA9, PA10, PA11. The systemclock of the Timer 1 is 80 MHz. The frequency of the PWM signal should be 20kHz. I have attached the code snipped were i configured the GPIO, Timer and DMA in the software. I get no PWM signal from the GPIO pins. When I manipulate the CCRx registers of the Timer1 with the ST Link debugger, I am able to generate PWM signals with the correct frequency and duty cycle. I suspect that the Timer1 do not make a DMA request and I am not able to find the failure. The DMA do not set any interrupt flags. Also when I manipulate the DMAR register of Timer1, I can see a valid PWM signal. Would be great when someone can support me Thanks Patrick #define TIM1_PSC_INIT 0u #define TIM1_ARR_INIT 3999u /* ~20 kHz at 80MHz systemclock frequency */ #define TIM1_RCR_INIT 0u uint16_t volatile tim1_dma_buffer[] = {
rm0456 describes CKDIV belonging to the FDCAN register structure, However the actual header in the cmsis_device_u5 repo make it a member of the FDCAN_Config_TypeDef. This is missleading! Probably FDCAN_Config_TypeDef. is some structure found in the MCAN IP. There is no description of FDCAN_Config in the reference manual. A description is welcome,
Hello,I use a STM32F777 with FreeRTOS and LwIP. I also run a display control with TouchGFX and partial framebuffer via SPI. I have configured the Ethernet and LwIP as shown in the following link: https://community.st.com/t5/stm32-mcus/implementing-a-lwip-and-freertos-v1-udp-echo-server-on-the/ta-p/780261 .The Ethernet works so far after booting. However, there are always artifacts on the display, as LwIP seems to write to the areas of the frame buffer.However, I have created the Linkerscript configuration as in the tutorial from the link and also added a LwIP heap section. Unfortunately it still does not work stable.What do I have to adjust so that it works without errors?Here is my configuration:
When connecting via USB to a STM32 board in DFU mode, it is possible to read a serial number from the instance path.However, in runtime, the serial number exposed via USB must be programed by the user... It would be nice then if ST provided the algorithm they used to create this string.We do have some hints though. When generating a STCube project, by default a `Get_SerialNum` function is generated in usbd_desc.c.However, it does not produce the same string as the bootloader does. Can anyone please tell us what is the algorithm stored in ROM of each type STM32 to generate the USB serial number string based on the 96-bit UID?On STM32F76/STM32F77, I have found that this function outputs a string that matches the one produced in ROM:`static void Get_SerialNum(void){ uint32_t deviceserial0, deviceserial1, deviceserial2; deviceserial0 = *(uint32_t *)DEVICE_ID1; deviceserial1 = *(uint32_t *)DEVICE_ID2; deviceserial2 = *(uint32_t *)DEVI
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code. HI ALL: In my project, I use AWD1 to monitor ADC3_CHN1, then set the high and low threshold, it works very well. However, when I switch to AWD2 and AWD3, there is no interrupt triggered, the setting codes are below: The configuration for AWD1: AnalogWDGConfig.WatchdogNumber = ADC_ANALOGWATCHDOG_1; AnalogWDGConfig.WatchdogMode = ADC_ANALOGWATCHDOG_SINGLE_REG; AnalogWDGConfig.Channel = ADC_CHANNEL_1; // output1 current AnalogWDGConfig.HighThreshold = 800; AnalogWDGConfig.LowThreshold = 500; / AnalogWDGConfig.ITMode = DISABLE; HAL_ADC_Stop(&hadc3); if (HAL_ADC_AnalogWDGConfig(&hadc3, &AnalogWDGConfig) != HAL_OK) { Error_Handler(); } HAL_ADC_Start(&hadc3); LL_ADC_ClearFlag_AWD1(hadc3.Instance); LL_ADC_EnableIT_AWD1(hadc3.
Hello,I'm using STM32H75x and NOR flash e.g. IS29GL064. I get the NOR demo running but I'd like to do modifications in order to get rid of all the polling stuff.According to the demo, the FMC is configured like this hnor1.Init.NSBank = FMC_NORSRAM_BANK3; hnor1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE; hnor1.Init.MemoryType = FMC_MEMORY_TYPE_NOR; hnor1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_16; hnor1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE; hnor1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW; hnor1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS; hnor1.Init.WriteOperation = FMC_WRITE_OPERATION_ENABLE; hnor1.Init.WaitSignal = FMC_WAIT_SIGNAL_ENABLE; hnor1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE; hnor1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_ENABLE; hnor1.Init.WriteBurst = FMC_WRITE_BURST_DISABLE; hnor1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ASYNC; hnor1.Init.WriteFifo = FMC_WRITE_FIFO_ENABLE; hnor1.Init.
Hello everyone,I'm currently working on a custom board with an STM32H735AGI6, and I'm trying to create the external loader for the MX25LM51245g NOR flash on it. I use the OCTOSPI1 for the communication. I first created a basic project using STM32CubeIDE in version 1.18.1 to validate the OCTOSPI communication and hardware of my board. And I'm able read/write the register of the external flash, as well as erasing block or full chip, and writing data into it.Then I tried to create the external loader fallowing this tutorial : https://controllerstech.com/w25q-flash-series-part-10-qspi-ext-loader-in-h750/ adapting it to my needs.My problem is that when I test my external loader, through the STM32CubeIDE or the STM32CubeProgrammer, by erasing the first block and writing into it, the erase goes well, but I next get the error log 'failed to download sector[0].I debug my external loader project directly from the RAM (0x24000004) address using STM32CubeIDE, and I'm able to erase a
Hi,I am working with an STM32 microcontroller (STM32 C0 & STM32H5 series) and want to implement Modbus communication without using FreeRTOS . Most examples I found are based on FreeRTOS, but I need to handle Modbus protocol in a non-RTOS environment.Are there any recommended Modbus libraries that can work without an RTOS?
Hello, I'm having problems with a simple task: receive blocks of data from UART. The blocks are sequences of 1-300 bytes, that are receiveid with a 1 second interval. The value is stored in one buffer of 350 bytes.When I send a big block of 270 bytes after other blocks(of 60 bytes by example) in that 1s interval, the Stm32 RESETS! But if the interval is longer, like 5 seconds, it doesn't reset and receive the data correctly. I tried with pooling and interruption, the result is the same. I'm using 115200 baud. Lowering the baud rate also reduces the interval that doesn't cause a reset, but I can't use this solution.WatchDog is already disabled. By this moment, the code doesn't do anything more.
Hello, I have managed to generate a IP through the LWIP in the STM32 IDE and establish a connection via Ethernet, although now when I upload the files from hasseb/stm32h7_atsame70_ptpd: IEEE 1588 PTP daemon for STM32H7 and ATSAME70 (github.com) I seem to have a large portion of the code in the main.c file greyed out. As well, I'm not sure if it is concerning that there is a warning saying "_gettimeofday is not implemented and will always fail". I found some documentation stating this is not too much of a concern, as it's only a warning and not an Error. Furthermore, I have tried getting an output using this function just as a test and no luck: https://stackoverflow.com/questions/42747128/does-hal-gettick-return-ticks-or-milliseconds-and-how-to-measure-in-microsec/42749284#42749284 __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) { /*configuring the SysTick to have an interrupt in 1ms time basis*/ HAL_SYSTICK_Config(SystemCoreClock /1000); /*Configure
Hi ST Team,I’m working with an STM32F303VET6 and need help with EEPROM emulation. I’m looking for guidance on the correct Flash setup, example code for read/write, and best practices for reliability.Any ready examples or tips for integrating this into STM32CubeIDE/EWARM would be really helpful.Thanks in advance for your support!
Hi,Im new to STM and trying to use ADC with DMA in circular mode but the value of my ADC remains at 0. I also tested it with Polling, which works.ICache and DCache : Enable void menu_adc(void) uint32_t adc_buffer[1]; uint16_t adc0; uint8_t flag_adc; void menu_adc(void) { char buf[30]; HAL_ADC_Start_DMA(&hadc1, adc_buffer, 1); while(1){ if (flag_adc == 1) { flag_adc =0; int len = snprintf(buf, sizeof(buf), "ADC0: %u\r\n", adc0); HAL_UART_Transmit(&huart1, (uint8_t*)buf, len, HAL_MAX_DELAY); HAL_Delay(200); } if (HAL_ADC_PollForConversion(&hadc1, 100) == HAL_OK) { uint32_t adc_value = HAL_ADC_GetValue(&hadc1); int len = snprintf(buf, sizeof(buf), "ADC0: %lu\r\n", adc_value); HAL_UART_Transmit(&huart1, (uint8_t*)buf, len, HAL_MAX_DELAY); } } } void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) { if(hadc->Instance == ADC1) { adc0 = adc_b
Hello everyone,I'm a beginner in embedded systems and I'm trying to flash my LVGL UI resources to the external QSPI flash (a W25Q64) on an STM32H743IIT6 using OpenOCD. I'm running into some issues with OpenOCD detecting the flash.Here is what I have done so far:Linker Script (.ld): I have defined the external flash memory region in my linker script and created a section named .lvgl_assets that points to this external flash address.Data Placement: I'm using __attribute__((section(".lvgl_assets"))) in my code to place the UI resource data into this specific section.Binary File: I have successfully generated a separate .bin file that contains only the data from the .lvgl_assets section.My goal is to flash this .bin file to the W25Q64.My OpenOCD Problem:I am using the stm32h7x.cfg target file provided by OpenOCD. I saw that it contains a QSPI driver, so I added the following line to my config:set QUADSPI 1I then run OpenOCD with:openocd -f interface/cmsis-dap -f target/stm32h7x.cfgAfter it
Edited by a ST moderator: Please kindly don't use capital letter as it gives the impression of "shouting" Hi Team, I am using stm32h743 to interface lan9353 (3 port ic). for the first step if i connect one end of the ethernet cable to board and another end is connected to pc. the led is not blinking on both sides. if i check the command prompt the ethernet is not connected only. why is there any process for this please send me.
HiI currently use a timer in interrupt mode that triggers every 50 µs and executes my function inside HAL_TIM_PeriodElapsedCallback. I also have another timer running every 1 second. To reduce CPU load, I want to replace the 50 µs interrupt-based timer with a DMA-based implementation. My goal is for the DMA-driven timer to invoke HAL_DMA_XferCpltCallback every 50 µs. Is this approach possible, and if so, how can I implement it? If there is any other approach to implement the timer to trigger every 50us using DMA please let me know.NOTE: I am implementing using STM32CubeIDE on STM32F439ZIT6 Nucleo Board.Thanks and Regards@avbST
Hi friends ,I need to make a TCP Server client in my STM32F769NIH6 board using LWIP. I referred many documents but so far it have led me to nowhere. Does any of you knowhow to do it, in that case tell me the steps.
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code. Hello, i have a Project, where i have an FPGA connected to a STM32H723 via PSSI. The FPGA sends out 16 Bit of Dummy Data over 8 Data Lines Every 1 ms. In the STM i can receive the Data without using DMA like this: "HAL_PSSI_Receive(&hpssi,&received_pssi, 1, 5000)" Now i enabled DMA in CubeMX (DMA1 Stream 0). Inside the main.c Cube created " MX_DMA_Init();" for me. I added: HAL_PSSI_ENABLE(&hpssi); if (HAL_PSSI_Receive_DMA(&hpssi, (uint32_t*)rxBuffer, BUFFER_SIZE) != HAL_OK) { Error_Handler(); } HAL_NVIC_EnableIRQ(DMA1_Stream0_IRQn); And this does not end up in the Error Handler. As Soon as the main while loop is executed, i end up in the "HAL_PSSI_ErrorCallback" with the Error ID "0" (which corresponds to "HAL_PSSI_ERROR_NONE", so an Err
I am looking for a way to obtain the PHY timestamp of when Ethernet packets are received. I am using the board NUCLEO-F767ZI, which should support hardware timestamping. I can barely find documentation about this online, but some investigation led me to the function HAL_ETH_ReadData, which contains the following lines: /* Get timestamp high */ heth->RxDescList.TimeStamp.TimeStampHigh = dmarxdesc->DESC7; /* Get timestamp low */ heth->RxDescList.TimeStamp.TimeStampLow = dmarxdesc->DESC6; I can see that this code is executed. When I print the values of dmarxdesc->DESC7 and dmarxdesc->DESC6, I always get the value 0. I am wondering if this is some sort of configuration issue, or if I am missing something. I'm not sure how important this is, but I'm using LwIP to handle my networking stack, which seems to work correctly on a higher-level (i.e. I can receive and send packets as expected). Any hint as to what might be happening would be appreciat
Hi all,I am having issues with Clock setup for Stm32h755. Especially regarding the M4 core. Currently, I only run the M4 core. The M7 core has no valid firmware. Is that even a supported mode?I try to setup a rather basic clock setup but the setup keeps failing at the call: HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4), which will return an not ok return value.I also tried using HSI and other different setups. But it seems the keep failing in the same way. Interestingly... When I simply ignore the error. Then most stuff seems to work just fine. I got ADC, SPI, Timers working. However, I am not sure where the issue is with the clock configuration.The entire clock setup: static void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; __HAL_RCC_SYSCFG_CLK_ENABLE(); RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_Os
BackgroundWe have a battery-powered device using:MCU: STM32 (STM32L4series)Modem: Quectel BG95 (cellular)Communication: UART with Idle Line Interrupt (HAL_UARTEx_ReceiveToIdle_IT)Power mode: Device goes to sleep periodically, wakes up to communicate with modemArchitecture PatternOur communication pattern:Device wakes from low-power modeCall low-level AT command function that:Enables UART RX Interrupt with Idle Line detection (HAL_UARTEx_ReceiveToIdle_IT)Sends AT commandWaits for response with timeoutDisables interrupt (HAL_UART_Abort_IT)Process responseGo back to sleepThis means we re-enable/disable UART Idle Line interrupt on every transaction (potentially hundreds of times per day).UART + Ring Buffer Setup:#define RING_BUFFER_SIZE 2048 #define ISR_BUFFER_SIZE 1024 typedef struct { lwrb_t rb; // lwrb ring buffer volatile bool rx_data_ready_flag; // Flag set by ISR uint8_t rb_buffer[RING_BUFFER_SIZE]; // Ring buffer storage uint8_t isr_buffer[ISR_BUFFER_SIZE]; // Intermediate buff
Hi ST community,I am facing an issue of 10us delay between CS line going low and SPI SCK start, when I am doing SPI communication with a slave device, which supports upto 15MHz SPI communication.Below is the main.c file snippet for your reference. Please help in fixing the issue. I have also attached complete code file as well as the CRO capture of SPI comm for your ref. Thanks in advance!/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2025 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 AS-IS. * ***************************************************************************
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.