Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
/* * Stl_Scheduler.c * * Created on: Jun 25, 2026 * Author: User */#include <stl_user_api.h>#include "stl_scheduler.h"#include "main.h"#include "app_threadx.h"#include "APP_Log.h"extern TIM_HandleTypeDef htim15;/* RAM & FLASH Tests definitions */#define FLASH_SECTION_SIZE 1024U#define RAM_SECTION_SIZE 128U#ifdef STL_DISABLE_RAM_BCKUP_BUF#define RAM_BACKUP_BUFFER_SIZE 0#else#define RAM_BACKUP_BUFFER_SIZE 32#endif// STM32H523#define TEST_RAM_START_ADDR (0x20000000U + RAM_BACKUP_BUFFER_SIZE)#define TEST_ROM_START_ADDR 0x08000000U//#define TEST_ROM_END_ADDR 0x0801A3FF//#define TEST_ROM_END_ADDR 0x0801A00FU#define TEST_ROM_END_ADDR 0x0801A3FFU//#define TEST_ROM_END_ADDR 0x0807F7FFU/*#if (defined (__GNUC__) && !defined (__CC_ARM) && !defined (__ARMCC_VERSION))extern void *_edata_load;#define TEST_ROM_END_ADDR ( (uint32_t)&_edata_load + 3)#endif*/// Runtime RAM test: 8 sections x 128 bytes = 1024 bytes#define TEST_RAM_SECTION_NB_RUN 8 /* only 8 RAM
Security:Introduction to STM32H5 security - stm32mcu “Approved version. Approved on: 10:25, 18 May 2026”The following links are broken:In the intro section, the text “For general STM32 security see this article and AN5156.”: The link “this article” is https://wiki.st.com/stm32mcu/wiki/Security:Security_overview which shows a “Page not found” error page. In section 2, in the bullet point about PCROP, the text “Obviously this feature is redundant with the availability of TrustZone® and HDP.”: The link “TrustZone” goes to Security:How to disable TrustZone in STM32L5xx devices during development phase - stm32mcu which is for a different MCU and not very relevant for STM32H5. In section 3, the text “For introduction on these features, refer to this guide.”: The link “this guide” is https://wiki.st.com/stm32mcu/index.php?title=Security:Guide_to_use_specific_security_feature&action=edit&redlink=1 - which does not exist. section 3.2, the text “For broader context follow here.”: The lin
Is there any doco or app note on how to save/restore a STM32H7 CRC calculation (e.g. breaking up long CRC calculation into separate segments that requires re-initialization of CRC HW between segments)?
Dear Forum,I'm using a STM32F401 and implemented the I2C as Target transmitter (Slave) answering a I2C question. I'm programming the I2C CR2 (FREQ Bits) Register as follows with correct speed (42 MHz)I2C1->CR2 = ((DRV_RCC_GetPCLK1Freq() / 1000000u) & I2C_CR2_FREQ_Msk); I've noticed some spikes when the STM32 I2C controller generates the answer, see below (yellow markings)Blue: Clock generated by the controller (the clock speed is about 200kHz)Red: Adrdess Byte generated by the controller, Data Bytes generate by STM32 I2C transmitter (answer) with spikesWhen the FREQ Bits of I2C_CR2 Register are zero, this spikes doesn't occur, see belowThe Reference Manual RM0368 Rev 6 for the I2C CR2 writes:It is noticed that this FREQ bits must be configured to generate I2C compliant Signals. Anyhow from EMC perspective this spikes are bad because the radiate a wide spectrum. I've found nowhere information of correct I2C specifiation/behaviour of the Data Signal the be compliant
Thank you for taking the time to review my question.I migrated the Ux_Device_Audio_2.0_Standalone of STM32WBA6 to STM32H503 and successfully enumerated using USB FS. However, out of 1000 entries into the USBD_AUDIO_PlaybackStreamFrameDone function per second, half are 4 bytes long and half are 384 bytes (audio stream). I monitored the data using USBlyzer and did not see any upload data (EP IN) from STM32H503. I don't know where these 4 bytes come from, and this issue has been bothering me for several days.VOID USBD_AUDIO_PlaybackStreamFrameDone(UX_DEVICE_CLASS_AUDIO_STREAM *audio_play_stream, ULONG length){ /* USER CODE BEGIN USBD_AUDIO_PlaybackStreamFrameDone */ UCHAR *frame_buffer; ULONG frame_length; int32_t ret; UNUSED(ret); /* Get access to first audio input frame. */ ux_device_class_audio_read_frame_get(audio_play_stream, &frame_buffer, &frame_length); if (length) { HAL_GPIO_TogglePin(GPIOA, GPIO_PI
Hello, I have connected a sensor to my nucleo board to send data when sensor detects movement.I have introduced an ISR for that.void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){ if (GPIO_Pin == GPIO_PIN_0) { pirDetected = true; }} unfortunatelly with that approach everytime the sensor was triggered ( I was able to measure 3.3v on the OUT pin using voltmeter) my stm32 is kind a freezing. I have introduced some testcode,extern "C" 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(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); while (1) { if(HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0)) { HAL_GPIO_Write
Hello,we have to use the STM32H573 in the 80 Pin WLCSP with temperature Range 3 (to 125°C). So STM32H573MIY3Q was chosen. Due to a mistake we didn't recognized that the internal LDO can't be used. Now we have no space for placing additional components as the inductor to use the SMPS. The STM is on a tiny board which is connected on a baseboard on this is more space for components.So now we have two options: Use an external LDO on the tiny board, we have 1,8V spare to burn down. How much current shall we consider (250 MHz). The maximum IDD ist stated with 125,2 mA, does any additional current has to be added?Use an external DCDC on the baseboard. In both cases the Questions are:How has the pins of SMPS to be configured (by hardware) to shut down the SMPS appropriately?Do we have to use the VCAP as an input?If STM staff is reading this please get in touch with us immediately. Thanks.So longMarwinEdits: Some minor spellings
I am working on an STM32 based IoT project where I want to fetch original quality media files from public Instagram post URLs and display them on a connected TFT screen. The concept is similar to how browser based tools like snapinsta.ink work where a public post URL is parsed to extract the direct media file URL which is then fetched as raw image data. My current implementation uses the STM32 HAL HTTP client library to send a GET request to the public post URL and parse the JSON response to extract the highest resolution media node before downloading the file to external flash storage. The main challenge I am running into is that the response payload size exceeds the STM32 heap allocation when trying to buffer the full response in memory before parsing. Has anyone implemented a similar HTTP response streaming and parsing workflow on STM32 and found a reliable way to handle large JSON payloads without loading the entire response into SRAM.
I'm implementing getQuat() for the BNO055 on both STM32 and Arduino and getting very different times. On STM32H7 (HAL, 400kHz I2C) my equivalent code measures ~394µs typical with frequent spikes up to ~2573µs (mean ~912µs), but on Arduino with the Adafruit library getQuat() I get ~2ms. Is my STM32 HAL code below a fair equivalent of the Adafruit getQuat(), so that the times are actually comparable?adfruit bno055 offical library /* USER CODE BEGIN Header *//** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2026 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. * ****************
I am using TIM8 to generate a PWM waveform (a /wr signal to an LCD ST7789 controller) and the timer triggers DMA2 to load the next byte onto the PD8-PD15 bus. The 1st byte has to be loaded “manually”.It works, and the ARR CCR3 CCR4 values can be adjusted to get the desired overall period, and data setup and hold times.At 84MHz APB2, I am using ARR=11 to get a 71ns cycle time. So this thing is running pretty fast. The timer resolution is 1/168MHz. The ST7789 can go down to 66ns.The problem is that roughly once in a million writes, bad data is loaded. It shows up as wrong colour pixels. With extensive debugging, AFAICT, the bad data is not present in the source buffer. What I do see on a scope is very rare faint edges on the data, around the /wr +ve edge, on which the data setup/hold time is out of spec. Sometimes the data changes at the same time as the /wr +ve edge!Using ARR=15 or higher, the problem goes away. But then I get too-slow transfers.It looks like there is a very rare huge l
ETH is obviously a dual-clock peripheral, and some of the registers are most probably behind a synchronizer, in the MII clock domain. It’s not unlikely that reading some of those registers imposes waitstates. Writing may not, but then those are subject to the Successive write operations to the same register might not be fully taken into account erratum (which hints at the fact that there’s a 4-MII-clock synchronization mechanism, at least for writing).Can ST confirm or deny, whether reading and/or writing ETH registers imposes waitstates, and in case of yes, can ST please list related registers and also quantify number of waitstates. Here’s why.In particular, we need this to be quantified for the ‘F4xx, but for other families it would be a bonus to have this, too.Thanks,JW
Is this version do not copy touchgfx_core.a to project folder? ex) Middlewares\ST\touchgfx\lib\core\cortex_m4f\IAR8.xbecause I did generate code in touchGFX so automatelly remove the files in lib/core.and i can't build on IAR because .ipcf file generated from touchGFX desinger need touchgfx_core.a of path above.
When using this microcontroller, after entering low-power mode via the HAL_PWREx_EnterSHUTDOWNMode() function, I found that there is a 0.9V voltage on VCAP. But the program indeed did not continue performing the reset operation.Do I need to turn off anything before entering this mode? I have used peripherals such as DMA (linked list in circular mode), SPI, USART, ADC, and GPIO.The following is my function for entering low power mode. static void DevLowerKeyInit(uint8_t *index) { (void)index; osDelay(200); vTaskSuspendAll(); SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk; for (uint32_t i = 0; i < 16; i++) { NVIC->ICER[i] = 0xFFFFFFFF; NVIC->ICPR[i] = 0xFFFFFFFF; } HAL_DBGMCU_DisableDBGStandbyMode(); HAL_DBGMCU_DisableDBGStopMode(); extern void MX_GPIO_ALL_ANALOG_Init(void); MX_GPIO_ALL_ANALOG_Init(); __HAL_PWR_CLEAR_FLAG(PWR_WAKEUP_FLAG2); __HAL_PWR_CLEAR_FLAG(PWR_FLAG_STOPF); __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SBF); __DSB();
I have been developing an application based on the STEVAL-PTOOL1V1_6S_HL. I have managed to successfully get the motor up and running to the expected RPM using the speed potentiometer functionality. I am now developing my own custom hardware using the STSPIN32F0B and I will not be using the speed potentiometer to control the speed of the motor. Instead my intention is to use the commands such as:MC_ProgramSpeedRampMotor1(2000, 1000);MC_StartMotor1();To set the motor speed and start the motor.I am unsure of how to go about removing the speed potentiometer functionality from the generated code In MC Workbench (V6.4.2) after loading in the STEVAL-PTOOL1V1_6S_HL.ioc the Potentiometer option visible can’t be changed
I am working on the STM32N6570-DK and would like to implement FOTA (Firmware Update) through Ethernet.We are planning to perform the firmware update over a wired Ethernet connection, not through wireless or OTA.Could you please suggest which protocol is better for firmware image update:UDP TCP HTTPKindly let me know the recommended approach for reliable firmware updates over Ethernet.Also, if there are any example projects or reference code available for implementing firmware update over Ethernet on STM32N6570-DK, please share them. It will be very helpful for our development.
I have written a code to control two Hall sensor based geared BLDC Motors. I am using DRV-8353rs motor driver for this. We have designed a custom pcb as our motor control board. I have attached a pdf showing the circuit connection which we are following. I am also attaching the relevant code files needed to analyse this as well as a couple of tests I have run till now. I am generating pwm for motor 1 via Tim 1 and motor 2 via Tim 8 ( using complimentary pwm generation from 3 channels i,e CH1 CH1n CH2 CH2N CH3 CH3N). There are mainly two concerns which I am unable to resolve right now. 1. The motor running on tim 8 is always faster than the motor on tim1. The difference is smaller at lower duty cycles and increases along with it. 2. When running in reverse, the current consumption is approximately 1.5 that of what it draws when running in the clockwise. I am an amateur in this domain, and most of my work has been heavily dependent on chatGPT and Claude. For this issue, this is the reply
Hiya. I’m working on a project that writes to a microSD card over SPI using an RTOS (ThreadX in this case). I’ve had a bit of trouble implementing it over the weekend since I’ve seen little/no support for SPI on FileX and I’ve had issues porting over FatFs SPI code over to this project. Looking for some help and guidance with this! I’m not experienced with FileX or FatFs, so the solution could be pretty simple.With FileX, I can initialise but cannot mount the drive (memory pool allocations has been large enough). I used this custom library for the SPI implementation: With FatFs, I was also able to initialise but could not mount the drive. Again, I am pretty new to this stuff, so a series of steps to implement and identify the problems would be greatly appreciated. I can figure out the rest of the code (like writing and reading), I’m just struggling with initialising and mounting.
I’m a beginner with the STM32 series and STM32N6570-DK.I’m using ‘TouchGFX 4.26.1 Designer’ and ‘STM32CubeIDE 2.1.1’ and ‘STM32CubeMX’.First, I created a simple project for my STM32N6570-DK using TouchGFX. And, it displayed an image on the LCD normally.Next, to use the SD card, I configured the fileX and SDMMC2 settings using CubeMX.After that, when I regenerated the code using CubeMX, the LCD screen is not displaying properly. Is there a guide on how to use an SD card in a project created with TouchGFX?
Summary On a NUCLEO-N657X0-Q I have a custom (non-CubeMX-template) FSBL that copies an "LRUN" application image from external XSPI flash into AXISRAM and jumps to it. The byte-identical signed FSBL runs completely when I stage it with the debugger in Development boot (monitor reset → load → jump Reset_Handler) — the app runs end to end. But in true ROM flash-boot (BOOT pins set for boot-from-flash, power-cycle, no debugger), the FSBL reaches main() (user LEDs light) and then locks up before its first clock-configuration step. The lock-up is invisible to SWD, UART, and even fault handlers, which points at a processor LOCKUP tied to the state the boot ROM leaves at the FSBL entry in flash-boot (security / RIF / clock), which differs from the debugger path. I would like to understand what minimal init my FSBL must do at entry in flash-boot. Hardware / tools - Board: NUCLEO-N657X0-Q (MB1940), STM32N657X0H, Cortex-M55 + Neural-ART. Device ID 0x486, Rev Z. Lifecycle state: OPEN (SWD attac
I am trying to adapt the QSPI Flash (QSPI_MemoryMapped) example found in the STM32WB5MM-DK to run with FreeRTOS. My hardware uses different ports for the QSPI connection but all has been set up through the ST32CubeMX program.What I did then was to copy the code from the example into my project as a FreeRTOS task. However, the code pulls in some header files that don’t make sense to me. For example: stm32wbxx_hal_tim_ex.h results in the error “unknown type name 'HAL_StatusTypeDef”I’m not sure why this is happening, or even why this header file is being pulled int, I so would appreciate any pointers. My guess is that is has to do the the HAL timer versus the FreeRTOS timer, but even then don’t know were to look!Since I am using the flash without a fie system, maybe the QSPI_ReadWrite_DMA or QSPI_ReadWrite_IT would be better. If so, please suggest...Thanks
Hi team,we have custom project based on STM32U558 controller with TrustZone, and I am only involved in small part of the project.but i would like to learn about this trust zone is enabled and how both secure and non secure zone are talking.how i will identify which peripheral and which pins are intialised as secure and non secure part.also will appreciate if provided with reading section for trustzone.(prefer small blogs, not big one just because i am a new to trust zone).
Hello, I am new to high speed layout and am just learning a new layout tool so the pressure is on. What I need is some layout examples I can study to boost my chances of getting it right. Can anyone help please?
Hello,I’m working with a project with STM32h563 micro which includes the use of the OEMiROT bootloader. I tried different solution to set up the project, and, in order to use CubeMX, I think this is the “normal” way. However, there are some things that look awkward to me.If you want to use the OEMiROT bootloader included in the firmware package mentioned in the tutorial, it seems to be mandatory to strictly respect the folder tree given used inside the package. This means that your application project has to reside in STM32Cube_FW_H5_V1.6.0/Projects/NUCLEO-H563ZI/Applications/ROT/ even if you are not using a NUCLEO board. When, in CubeMX, you set the Boot Path and Debug Authentication options, you can modify the OEM_iROT reference location but not the Config Files Location, which is mandatory to be inside the ROT_Provisioning folder automatically created inside the newly created application (e.g. STM32Cube_FW_H5_V1.6.0/Projects/NUCLEO-H563ZI/Applications/ROT/ROT_Provisioning). However,
Hello,I was trying to run AC1 and ADC2 in Dual mode and ADC3 configured as independent one.Using HAL_ADC_Start for ADC3 doesn’t start the converter as it checks multi-mode in common ADC_CCR register wrongly not allowing to use ADC3 for ADC_DUALMODE_REGSIMULT (value 6). I prepared a patch for stm32f4xx_hal_adc.c, but not for injected channels from stm32f4xx_hal_adc_ex.c file as they have a similar issue.Could it be checked by library owner or someone responsible for the code? Firmware Package Name and Version : STM32Cube FW_F4 V1.28.3STM32CubeMX 6.14.0MCU STM32F446ZEJx Best RegardsJarosław Hill
Hello,I created a STM32F446 host project using STM32 CubeMX to receive data from a wireless mouse.This project works, but only with Lenovo mice. Other wireless mice are perceived as multifunctional devices.I get debug information when I start:USB Device ConnectedUSB Device Reset CompletedPID: 18hVID: 32c2hAddress (#1) assigned.Manufacturer : HS6209Product : 2.4G Wireless ReceiverSerial Number : No.161-0047-5Enumeration done.This device has only 1 configuration.Default configuration set.Device remote wakeup enabledSwitching to Interface (#1)Class : 3hSubClass : 0hProtocol : 0hDevice not supporting HID class.Is it possible to receive data from these wireless mice?
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.