Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
With a STM32u5 controller I'm trying to reach stop1 while still receiving incoming uart data and putting the data memory with DMA. I use LPUART1 and GPDMA1 with the receiving side configured to receive a interrupt on bus idle (RTO) and the DMA is used in standard request mode. These should work in stop1 when the clocks are enabled. Without going to stop mode the code works. When I go to stop1 mode and receive data I will wake up on a overrun error meaning that (I think) that DMA is not working since it is not getting the bytes from the uart peripheral causing the overflow error to hit. My initiation code looks like this: HAL_Init(); init_clock_and_power(); MX_ICACHE_Init(); MX_GPDMA1_Init(); MX_GPIO_Init(); MX_LPUART1_UART_Init(); __HAL_RCC_LPUART1_CLKAM_ENABLE(); __HAL_RCC_LPUART1_CLK_SLEEP_ENABLE(); __HAL_RCC_GPDMA1_CLK_SLEEP_ENABLE(); __HAL_RCC_AHB1_CLK_ENABLE(); UART_WakeUpTypeDef wakeup_config; wakeup_config.WakeUpEvent = UART_WAKEUP_ON_READDATA_NONEMPTY; HAL_St
Dear colleagues, hello! Question about LWIP. I have two network interfaces, one on the QCA 7000 chip via SPI, the second on LAN 8742, installed on the debug board. I use the Socket API. The problem is as follows: The server is running on one interface, the client on the other. When they are not running at the same time, everything works fine. But if you enable them at the same time, sometimes the outgoing packet on the QCA 7000 interface gets stuck in the LWIP library for about 210ms. And this time interval is always the same. Please tell me which way to look to solve this problem
Hello,I'm having trouble establishing a working SPI connection between an STM32U585 and a sensor (LIS3DHH). The transaction looks great on an oscilloscope: Clock, CS, MISO, and MOSI are behaving as expected.This leads me to suspect that the MCU isn't receiving the data correctly. I'm using the low-level driver, but I've reproduced the same behavior with the HAL driver. It's important to note that I want to use DMA mode for performance reasons.I suspect a bug in my DMA or SPI configuration. After a transaction, the second byte of my rx buffer contains the value 0x00. When reading the WHO-AM-I register, however, it should contain 0x11 (this value is also output via the MISO line). I would greatly appreciate any suggestions.Here is the GPIO and SPI configuration (DMA below):LL_GPIO_InitTypeDef gpio_init_sck_miso_mosi = {0}; gpio_init_sck_miso_mosi.Pin = LL_GPIO_PIN_14 | LL_GPIO_PIN_13 | LL_GPIO_PIN_15; gpio_init_sck_miso_mosi.Mode =LL_GPIO_MODE_ALTERNATE; gpio_init_sck_miso_mosi.Speed = L
Hi, I'm working on the project using STM32H723 with an external flash (winbond 16MB), I already using Azure RTOS Threadx for my project, My PCB has SPI Connection with the flash, all the Levelx examples are with Quad SPI, any Levelx examples with SPI Full Duplex Master and Filex. Please help on this, thanks.
Hi,I am currently working on a build container for my project and I’m using the ARM toolchain (arm-none-eabi-gcc) from ARM Developer sources: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads .Do you have an authless link that provides the toolchain (arm-none-eabi-gcc) used in CubeIDE?The path I’m referring to is:$ stm32cubeide_1.15.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.100.202403111256/tools/bin/I also noticed a compilation option -fcyclomatic-complexity, which I removed to use the toolchain from ARM Developer sources. Could you clarify the purpose of this option? Specifically, why and how does CubeIDE use it ?Best Regards,Loïc
I tried to use FLASH_TYPEPROGRAM_FAST in a G0B1 but is not working after a page erase. I suppose it will work with mass erase but not tried. Only works FLASH_TYPEPROGRAM_DOUBLEWORD. I've also tried to make my own function to write only 32bits modifing FLASH_Program_DoubleWord(), but again it doesn't like it and goes to HardFault_Handler() Edit: Post moved from the old thread STM32G0 and FLASH_TYPEPROGRAM_FAST fail. Starting a new thread is better to have more chance to check the question by Community members. Don't hesitate to provide more details that can help to understand the problem and what you did as tests.
I AM TRYING TO CONTROL WITH CLRC SPI. MY PROJECT IS WRITTEN WITH LL. I CANNOT ADAPTE THIS FUNCTION. CAN YOU PLEASE HELP ME? https://github.com/CodElecCz/STM32F1-CLRC663
Hi Team,I'm trying to run Fatfs Multi Access example in the stm32h7s78-dk. Im having hard time understanding the Readme instructions. I have the switch set to boot0.Im using stmcube progrmamer. I have added external loader: MX66UW1G45G_STM32H7S78-DK.stldr too then loaded the code. but it doesn't work. Am I missing something? What should I do with Template_XIP_Boot.hex file? A clear step by step intructions would be greatThank youRohit
Hello! I am working on Implementing a Uncompressed YUV2 Stream through the Windows Camera Application with an STM32H5 Series Board. I am looking for an example of these values, the HAL_PCDEx_PMAConfig Values, as these are what establish the USB payload buffer to send my images through a stream2.h file found in this project (https://github.com/STMicroelectronics/x-cube-azrtos-h7/tree/main/Projects/NUCLEO-H723ZG/Applications/USBX/Ux_Device_Video/Stream) . The H5 doesn't support USB-OTG, so I have been trying to find an example of a project that is a USBX Video that uses USB FS functionality. (The linked project uses USB-OTG so instead it uses HAL_PCDEx_SetRxFiFo/SetTxFifo to establish a payload) These values worked with the stream1.h file from that same project linked above. However I am unable to change these values for a YUV2 stream to successfully stream. HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x00, PCD_SNG_BUF, 0x10);HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_F
Hello.I'm using Riverdi board.This board uses STM32H757XIH6 .I used FATFS R0.12c with uSD and USB-MassStorage in Unicode mode When mount uSD and then USB I noticed that FatFs[0] is overwritten.
Originally posted in TouchGFX Forum - moved & merged with duplicate.Hi,I am working on the STM32F439 development board. I am creating a test.csv file and logging data using FATFS on an SDIO SD card. I can view the data through USB MSC on a Windows PC. However, when I open the file in .csv format or edit some data from the PC, and then reconnect the board to the PC, the data gets corrupted or changes.Does anyone know about this problem? If so, please help me.Thank you!Best regards,Pankaj
Hi everyone,I am working on an STM32F412RB-based project where I need to secure data stored on an SD card while maintaining fast accessibility. However, I have very limited flash memory available (only 40 KB free), so I need a lightweight encryption method that does not consume too many resources.Current Setup:MCU: STM32F412RBSD Card Interface: SDIOFile System: FATFSEncryption: None implemented yetRemaining Flash Memory: 40 KBQuestions:What are some efficient lightweight encryption methods for securing SD card data on STM32 with minimal resource usage?Does the STM32F412RB have any hardware-accelerated encryption support that I can utilize?Would a simple XOR-based encryption be sufficient for basic security, or is there a better lightweight alternative?Are there any recommended STM32 libraries for secure but fast data storage on SD cards?Is there any available code or a GitHub link that I can refer to?I would appreciate any insights or experiences regarding this. Thank you!
Hello, I have an STM32G474VEH6 and we have the main function running a code at 20kHz that takes almost all the period to be executed. We also use ADC and PWM synchronised to convert at the period start. Now we also have to read a 64bit SPI slave in master "read only" mode. As far as I know, I need to generate a dummy TX to start the transmission. The SPI slave has a transmission has a minimum timeout after every transmission of 13.5us and the maximum clock frequency is 5MHz. Since we want to increase the 20kHz frequency as much as possible, we would like to avoid overloading the CPU using the DMA for this. We would like to do something like use a timer to trigger the transmission and the DMA can save the RX data in a circular buffer. Our main function is going to take the last updated value, but it does not need to be synchronised. So, we only need a buffer of one single value of 64bit. I have been trying many ways to do it, but I do not get to trigger the SPI. This is the last code I
Hello,I built a simple HTTP webservice with an F4,Following the code provided by this tutorial made by ControllersTechSTM32 ETHERNET #6. HTTP SERVER PART 1 || Simple Webpage - YouTubeIt works well.Now I want to secure it without adding FreeRTOSWould be possible to implement MbedTLS without FreeRTOS?Is there different ways to secure my webserver? Not using FreeRTOS is a requirement for my project. Thanks for your helpBest regard
I’m looking for comprehensive materials and guides on setting up BLE P2P router profile for STM32WB55 microcontroller.I need more detailed instructions than those provided in the official documentation (https://wiki.st.com/stm32mcu/wiki/Connectivity:STM32WB0_Peer_To_Peer_Router). I require a step-by-step guide or course on configuring data transfer between three devices via an intermediate node.System configuration:Sensor board - a board with a resistive sensor that sends dataController board - a board with a mini vibration motor, responsible for data conversion from the first board and further transmission to the PCPC - receives data from the first two devices using a standard BLE dongle. A simple GUI has been developed here to monitor system operation.The peculiarity of my system is that the controller board operates simultaneously in two roles - as a master and as a slave, which is less common compared to standard examples.Could you please advise:Where can I find examples of impleme
Hello, I am trying to use SPI with the STM32H7A3RGT6 microcontroller to send and receive data. However, I am not sure if I have created my functions correctly, or if I have properly configured the registers to achieve full-duplex SPI functionality. Here are my codes:Header files. /** spi.h** Created on: Apr 23, 2025* Author: HP*/ #ifndef INC_SPI_H_#define INC_SPI_H_ #include "stm32h7a3rgxx.h"#include <stdint.h>void SPI3_gpio_init(void);void SPI3_init(void);void cs_enable(void);void cs_disable(void);void SPI3_transmit(uint8_t *data, uint32_t len);void SPI3_receive(uint8_t *data, uint32_t len);#endif /* INC_SPI_H_ */ /** Clock enable Macros for GPIOx peripherals*/ #define GPIOA_PCLK_EN() (RCC->AHB4ENR |= (1<<0))#define GPIOB_PCLK_EN() (RCC->AHB4ENR |= (1<<1))#define GPIOC_PCLK_EN() (RCC->AHB4ENR |= (1<<2))#define GPIOD_PCLK_EN() (RCC->AHB4
Hi,I am starting to implement USB PD Sink application and i run into issue.I followed the AN5418.Seems the BSP_PWR_VBUSGetVoltage is Obsolete and i did not find any info how to implement it in alternative way. Found some posts that hint this might be an issue that it does not return the value.Any advise what to check would be helpful. __weak uint32_t BSP_PWR_VBUSGetVoltage(uint32_t PortId){PWR_DEBUG_TRACE(PortId, "ADVICE: Obsolete BSP_PWR_VBUSGetVoltage");/* USER CODE BEGIN BSP_PWR_VBUSGetVoltage */uint32_t voltage = 0;(void)BSP_USBPD_PWR_VBUSGetVoltage(PortId, &voltage);return voltage;/* USER CODE END BSP_PWR_VBUSGetVoltage */} In trace i get:18 CAD 5 1 USBPD_CAD_STATE_DETACHED19 DEBUG 49 1 ADVICE: Update BSP_USBPD_PWR_VBUSInit20 CAD 49 1 USBPD_CAD_STATE_ATTACHED_WAIT21 CAD 168 1 USBPD_CAD_STATE_ATTACHED22 NOTIF 168 1 USBSTACK_START23 DEBUG 168 1 ADVICE: USBPD_DPM_Notification:10424 EVENT 168 1 EVENT_ATTACHED25 DEBUG 168 1 ADVICE: update USBPD_DPM_UserCableDetection26 DE
Hi!I'm working with STM32CubeIDE and I want to send data via UART using the code below. char *msg = "Hello\n"; HAL_UART_Transmit(&huart6, (uint8_t *) msg, strlen(msg), 100); But I get an error like this:What can I do about this issue?
Hi all, I use UART8 of the STM32F732VE with 921600bps. And I want to use UART rx dma with RTO interrupt in the following sequence. 1. __HAL_UART_ENABLE_IT(&huart8, UART_IT_RTO)//interrupt enable 2. huart8.Instance->RTOR = 0xff00 //set timeout 3. HAL_UART_Receive_DMA(&huart8, rx_buffer, RX_BUFFER_SIZE) //start rx dma 4. void USART2_IRQHandler(void) { //create interrupt handler if (__HAL_UART_GET_FLAG(&huart8, UART_FLAG_RTOF)) { __HAL_UART_CLEAR_FLAG(&huart8, UART_CLEAR_RTOF); HAL_UART_RxCpltCallback(&huart8); } } but, no event is fired. If use IDLE interrupt instead of RTO interrupt, it will work fine. *The reference manual says that UART8 has RTO interrupt support. What else can i do? Many thanks for every piece of advice! Han
Hi All,I am having difficulties getting both HEXSPI PSRAM (XSPI1) and OCTOSPI (XSPI2) running at the same time in a memory mapped mode on STM32H7S78-DK board.There are two examples for this board:XSPI_PSRAM_MemoryMapped that configures XSPI1 in memory mapped mode (access to external RAM)XSPI_NOR_ReadWhileWrite_DTR that configures XSPI2 in memory mapped mode (access to external FLASH)Each example runs OK separately. However, when I've ported XSPI1 code from "XSPI_PSRAM_MemoryMapped" project to "XSPI_NOR_ReadWhileWrite_DTR" project PSRAM works in memory mapped mode but external flash doesn't any more.I am finding that change in HAL_XSPI_MspInit() that configures XSPI1 breaks operation of XSPI1 in memory mapped mode.Is there any example source code that work for STM32H7S78-DK board with PSRAM and OCTO FLASH out of the box ?
Hi Team, Currently I am working with STM32U575ZiTx SOC and I am using Tim3 for counting external clock pulses, Can you guide me with the code please. Below is my requirement : 1. What is the maximum frequency of the incoming signal? (To ensure the timer can handle it without missing counts)Answer : The frequency is measuring the spin rate of a physical system; a wind-turbine RPM or something similar.I think we can very safely say the maximum edge rate will be less than 100 kHz (heh) and probably closer to a max of 3600. 2. Should the rolling counter value be transmitted as-is, or should it be reset after each transmission?Answer : We confirmed with the end customer that the counter will roll over and is expected to reset on reboot. Code Reference : static void MX_TIM3_Init(void) { /* USER CODE BEGIN TIM3_Init 0 */ /* USER CODE END TIM3_Init 0 */ TIM_ClockConfigTypeDef sClockSourceConfig = {0}; TIM_MasterConfigTypeDef sMasterConfig = {0}; TIM_IC_
"I am currently developing a custom bootloader for the STM32F072RBT6 microcontroller. The bootloader is functioning correctly in terms of receiving via UART and writing application code of varying sizes into flash memory . I have verified the correctness of the flash writes using the ST-LINK Utility, and the data is written as expected.However, I am encountering an issue with executing the application code after the bootloader completes its task. The behavior varies depending on the size and complexity of the application:In the first case, the application size is approximately 5160 bytes and contains a simple LED toggle in a while loop. This application executes correctly when launched via the bootloader.In the second case, the application size increases to 13604 bytes and includes LED toggling, ADC configuration, PWM generation, and UART for Modbus communication. In this scenario, while the ADC, PWM, and UART appear to function correctly, the LED toggling does not behave as expected.I
Hello,We have made a devboard with stm32h7s3, running at VDD = 1.8V.We are finding that a number of pins shared with the USBHS/FS peripheral (which we are using as simple GPIO) do not work properly, ie. cannot be used for digital output.This is for select pins on Port M - you can ctrl+F the datasheet for "FT_u" to find them. They seem to be pulled low though a resistor a little weaker than 10k. There is a note on page 581 of the reference manual that says"GPIOs that are shared with the USB are limited in terms of frequency, to hundreds of kHz for UCPD-based GPIOs, and up to 1 MHz for USBHS and USBFS-based GPIOs. Refer to the datsheet for the exact values. In order to be used the IO supply must be above 2.7 V for the USBHS/FS."Our initial read was that this applied to using the USB peripheral, but our findings now suggest that a >2.7V supply is required just to use the pins as GPIO? We have DVDD, VDD50USB, and VDD33USB to 0V since we thought this was only for the
Currently, I've used the MPU_Config function to set up memory protection for multiple regions.I want to read back the configuration registers to verify the settings. However, after examining the HAL_MPU_ConfigRegion function in the stm32h7xx_hal_cortex.c driver file, I found that each region configuration's is written to the same register.Upon reading the MPU->RBAR and MPU->RASR registers post - configuration, only the settings of the last region are retained.I'm wondering if there's a way to read the configurations of all regions. If not, Could someone explain the reason for this operation?Thanks!
Hi All,I have previously experiemented with USB HID mouse coding on STM32F0 series and got code working very quickly.However, I am now trying to get the same going using USBX on STM32C0. My application has been built in MX but wouldn't enumerate. I asked ST if they could take a look at my code, which they did, and said that I needed to add some code to app_usbx_device.c to configure the endpoints and a periodic call in main(). It now enumerates fine and although they didn't say as much I presume its absence in the MX build is a bug as MX knows exactly which endpoints I need enabled.The applications engineer finished his email by saying 'and now you should be able to send reports' without elaborating. There's no USBD_HID_Mouse_SendReport function in the code that MX built as I would normally expect and am having extreme difficulty figuring out how to do it myself due to inexperience on my part.My question is whether I have perhaps started too soon with C0 when the MX provision isn't com
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.