Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
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 and a linker script content. Please read this post: How to insert source code. Hello,I'm trying to use an LCD with ILI9341 chip. I've connected all pins to the LCD and I've set in CubeMX the FMC like this: But when I tried to run the program, all calls from main.c is calling MX_FMC_Init(); then is going in this function: HAL_StatusTypeDef FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device, const FMC_NORSRAM_InitTypeDef *Init) { .. __FMC_NORSRAM_DISABLE(Device, Init->NSBank); .. And soon this macro is executed function MemManage_Handler() is called: /** * @brief This function handles Memory management fault. */ void MemManage_Handler(void) { /* USER CODE BEGIN MemoryManagement_IRQn 0 */ SerialPrint("MemManager_Handler fault.."); /* USER CODE END MemoryManagement_IRQn 0 */ while (1) { /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ /* U
MCU: STM32H723VET6ADC: ADC1 / ADC2 / ADC3 (12-bit, single-ended)VREF: 3.3 VApplication: Digital Multi meter (DC / AC voltage measurement) Problem DescriptionIn my DMM hardware design, the Analog frontend applies a mid-scale level shift (VREF/2 = 1.65 V) before the ADC input.This is done intentionally to support bipolar AC measurements using a single-ended ADC: Input signal → amplifier/divider → +1.65V offset → ADC (0–3.3V)As expected:0 V input → ADC reads ~1.65 VPositive/negative AC swings are in around mid-scaleHowever, for DC voltage measurement, I want the behaviour to be:No input connected → display 0.000 VApplied DC voltage → display the same voltageMid-scale offset should NOT appear in the final DC readingObserved IssueIf the mid-scale offset is not removed after ADC conversion, the firmware reports:~3 V on 6 V range~30 V on 60 V range~300 V on 600 V rangeeven when no voltage is applied.This is because the ADC correctly reads ~1.65 V, but that bias is still presen
Hello,I apologise in advance if my post lacks any important information, I am very new to working with these sorts of boards and have limited experience with motor control in general. I am using a B-G431-ESC1 to drive a 24V hoverboard motor. I have profiled the motor and uploaded the firmware to it and it runs just fine on the motor pilot with FOC speed control. I had also used the potentiometer on the ESC to change the speed without issue.I wanted to switch to using PWM signals to control the speed of the motor, and reuploaded the firmware to the board with the potentiometer option disabled and the Electronic Speed Control option enabled for the stage configuration. Using an ESP32 I generate a 490Hz PWM signal and first send 1060us pulses to the ESC (verified with an oscilloscope). I then send a new PWM to the ESC where the signal is high for 1850us. My expectation was that the initial 1060us PWM would arm the driver, and then the 1850us PWM would command the ESC to dri
I have a custom board with an STM32G051. The STM32 is a SPI receive only device. PA1 is SCLK, PA2 is MOSI, PB0 is nSS (which is hardware controlled). The beginnings of the project where created with CubeMX so the clocks should all be set correctly.The SPI transactions are simple 12-bit data with an active low chip select. Note that the MISO signal is not connected on the board. The master device does not read any data from the STM32G051.The SPI peripheral is setup as below: hspi1.Instance = SPI1; hspi1.Init.Mode = SPI_MODE_SLAVE; hspi1.Init.Direction = SPI_DIRECTION_2LINES_RXONLY; hspi1.Init.DataSize = SPI_DATASIZE_12BIT; hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; hspi1.Init.CLKPhase = SPI_PHASE_2EDGE; hspi1.Init.NSS = SPI_NSS_HARD_INPUT; hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi1.Init.TIMode = SPI_TIMODE_DISABLE; hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; hspi1.Init.CRCPolynomial = 7; hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASI
i have written a driver code to run 4 wire resistive touch panel. I use only 1 adc and change its adc channel during runtime. Like i set X+ and Y+ as output high by default and X- and Y- set as low by default and set X- and y- pull down to make ADC read 0 when not pressed. Basically, I have few functions that change the configuration such as X+ and X- to output, set Y+ to analog and Y- to input to set Y+ and Y- as an output, set X+ to analog and X- to input. read x voltage in previous case and read y voltage in later case. ADC is only one to switch the configuration during runtime and its resolution is 16 bit with 810.5 cycles sampling time. ISSUES: 1- gpio output 3.3v and ground but its adc measuring voltage is from (0.7 to 1.15 for x axis) and (0.55 to 2.8 for y axis) 2- if i move the wires then its voltage ranges change. Is this issue related with the firmware developed for running the 4-wire touch panel or hardware issue? I have connected decoupling capacit
..
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 and a linker script content. Please read this post: How to insert source code. I have a STM32L433RCT3 and I'm exploring using the USART wakeup feature from STOP1 on RXNE. To improve the wakeup time and not miss any data, I clock the USART directly from the HSI and I configured the wakeup clock to be the HSI. I'm wondering if someone could confirm this is a safe thing to do at 115200 baudrate? I'd rather not use the USART's UCESM: USART Clock Enable in Stop mode bit to keep the clock running in STOP1 mode (significantly more sleep current).From what I understand, the HSI takes a maximum of 6.2us to start up & stabilize? (Section 6.3.8 of Datasheet). Do you add the startup time (1.2us) and the stabilize time (5us) or do I just take the stabilize time? At 115200 baudrate, there is a bit coming every 8.68us. Theoretically, do I ha
I’m working on a project using STM32H7 (Cortex-M7 core) with eMMC and Azure RTOS FileX to manage file systems.The buffer is allocated as:ALIGN_32BYTES (uint32_t fx_mmc_media_memory[FX_STM32_MMC_DEFAULT_SECTOR_SIZE / sizeof(uint32_t)]);During initialization, I call:fx_system_initialize();fx_media_open(&gst_mmc_disk, "eMMC", fx_stm32_mmc_driver, ...);However, the system crashes with a HardFault inside: SCB_InvalidateDCache_by_Addr()which is called from: fx_media_open() ->fx_stm32_mmc_driver() ->mmc_read_data() ->invalidate_cache_by_addr() CopyEdit
Hi,I'm having an issue with the WBA6_LinkLayer_BLE_Basic_lib.a library on zephyr.The library is found in zephyrproject/modules/hal/stm32/zephyr/blobs/stm32wba/lib directory in zephyr 4.2 (tag v4.2.0 in https://github.com/zephyrproject-rtos/zephyr/tags).The issue is with function llhwc_conn_evnt_done in object llhwc.o inside the library:On occasions, this function generates a Usage Fault (unaligned memory access) when run on nucleo_wba65ri board.The offending instruction is 'ldrh r3, [r2, #0]' at address 0x0000359c (function assembly code below).The registers at the time of the fault are:R0: 0x00008F10R1: 0x00008208R2: 0x4802FFFFR3: 0x0000FFFFR4: 0x2000CBB0R5: 0x4802000CR6: 0x0000FFFFR7: 0x48020000R8: 0x2000DD34R9: 0x0000923CR10: 0x20005A48R11: 0x48028238R12: 0x00000000R13: 0x20018318R14: 0x0803C65CR15: 0x0803D070PSP: 0x200184A8R2 holds the address 0x4802FFFF, which causes the hard fault.My nucleo_wba65ri is running a central BLE application, sending data to another
Hello ST Community,I'm working on an STM32H753VIT6 project and need to upgrade FreeRTOS from v10.3.1 to v11.2.0 due to cybersecurity requirements. I've encountered several integration challenges that I'd like to share and seek guidance on.BackgroundCurrent Setup:Working on an STM32H753VIT6 microcontrollerFreeRTOS v10.3.1 with CMSIS-RTOS v2 wrapper automatically generated using CubeMX which works seamlessly out of the boxTarget:Using the newest FreeRTOS v11.2.0 from official repository (preferably without the CMSIS wrapper so future upgrading will be easier): https://github.com/FreeRTOS/FreeRTOS-Kernel/releases/tag/V11.2.0The process:So I followed some guides from the FreeRTOS forums and the ST community forums.Like this one: https://community.st.com/t5/stm32cubemx-mcus/is-there-a-way-to-disable-the-automatic-default-task-creation-when-c-2560/td-p/256903where I've been told there is no other way of upgrading (at least for my STM32H753VIT6) than deactivating the FreeRTOS from within the
Hi All,I am quite new to bootloaders and I wanted to understand best approach to upgrade the firmware. I will get the firmware from a 4g module and store it in external flash. We are based on STM32U5A5 mcu and it will always use the application present in the internal flash. External flash will have two copies/slots. Current one for rollback and new downloaded one.I am thinking about the following approach. I was wondering if there is anything build-in to do this? I suppose almost everybody must be using the same approach.Is there any stm32 bootloader that can do the same? If custom bootloader is needed is there any template I can follow?Thanks,Sandeep
I have a new STM32H757I-EVAL board. The examples that can programmed on it ran perfectly. I want to compile and debug the TouchGFX example myself but I only managed to kill the app that is running on it. I've created the TouchGFX example from within STMCube32IDE by selecting the evaluation board, and then the example. It builds without errors. In Debug Configuration, on Debug tab under External Loaders, I've added MT25TL01G_STM32H747I-DISCO.stldr with Enabled set to true and Initialised set to false. When I select debug, it starts to program but fails after a while. Below is the output from Console. What is wrong, and how can I fix it? STMicroelectronics ST-LINK GDB server. Version 7.10.0 Copyright (c) 2025, STMicroelectronics. All rights reserved. Starting server with the following options: Persistent Mode : Disabled Logging Level : 1 Listen Port Number : 61234 Status Refresh Delay : 15s Verbose Mode : Disabled SWD Debug : Enabled InitWhile : Enabled Info :
It seems there's a bug in the HAL library causing data bytes to be mixed with memory address bytes when sending data using HAL_I2C_Mem_Write_IT function. The issue was observed on STM32L162VET6 while using I2C as master at 300kHz speed. It is caused by the condition in HAL_I2C_EV_IRQHandler (stm32l1xx_hal_i2c.c) on line 4808.The issue happens after TXE interrupt occurs (DR is waiting for another byte of data) and your interrupt routine is not fast enough to provide DR with another byte of data, before all bits from SHIFT register are sent out. In that case, a BTF interrupt occurs, causing the code of the HAL_I2C_EV_IRQHandler to go for I2C_MasterTransmit_BTF instead of I2C_MasterTransmit_TXE function. The problem is, that I2C_MasterTransmit_BTF doesn't handle memory address. It only copies another byte of data from data buffer. The issue is invisible when the situation happens while sending out the data buffer. But if it happens during sending out the memory address it causes
Hello,First, I would like to express my deepest gratitude for your assistance.I intend to update the firmware using STM32CubeProgrammer with the following hardware configuration Additionally, I have set the Boot0 pin to High using a jumper.However, my PC is not detecting DFU mode.Additionally, the programmer is not recognizing the USB connection. Did I miss anything? PS. The board has undergone a full chip erase.
Hi,I got a NUCLEO-WB55RG board and was trying to program it as a HID device. I have configured the STM32CubeIDE and have uploaded the code to the board. Yet, when I tried connecting the User USB, it unfortunately didn't work. My computer did not recognize it as an HID device. I have switched to USB MCU on JP1. Please help!!! Great Thanks!
Hi everyone,I am working on a custom board based on STM32F407VGTX to control a BLDC motor, and I am looking for some guidance. My goal is to implement sensorless control (FOC or 6‑step) using this MCU, and I would really appreciate any example projects, application notes, or configuration tips (timers, ADC sampling, current sensing, etc.) that you can share.If someone has already done a similar BLDC project with STM32F4, pointers to code repositories or project structures would be very helpful. Thank you in advance for your support!Ashish
Hi everyone,I’m working with an STM32H7S3 microcontroller and an external Octo-SPI NOR flash IS25WX064 from ISSI (datasheet: https://www.issi.com/WW/pdf/25LX-WX032-064.pdf)My goal is to get this memory working with ExtMemLoader (including XIP support). I’ve gone through all the available tutorials and many of the forum threads related to ISSI 25LX/WX devices, but after many hours I still haven’t been able to generate even a single .stldr that doesn’t crash in the STM32CubeProgrammer.A few important points:This does not seem to be a hardware issue. I can successfully communicate with the flash and read the manufacturer configuration/registers via the XSPI peripheral.I have been following the ST tutorials for this MCU family (the ones that use the Macronix flash on the official demo board).In my case, when I try to adapt the code for the IS25WX064, the driver fails in the last check of step 9 of the EXTMEM_NOR_SFDP driver (the final verification step):After a lot of iterations,
Hello! I need help. STM32L073RZT6 MCU.How can I write, for example, 2 times 8 Bytes into any second half-page of flash memory?Every first page is recorded successfully and read successfully. For example, I write 8 Bytes of data to the beginning of the _writeBuf buffer (half page size) (fill the rest with zeros), erase the entire page of interest (*(__IO uint32_t *)_write_address = 0;), write _writeBuf to the first half page, the recording is successful. Write a next 8 bytes of data to _writeBuf after current 8 Bytes of data and I write it down in the first half page in the same way, it also goes well. With a similar operation, the first 8 Bytes are written to any second half page successfully, but when the next 8 Bytes are written to any second half page, the NOTZEROERR error occurs.
Both in the manual and in CubeMX, it is shown that my microcontroller, has the ability to configure the FMC, for an asynchronous muxed PSRAM interface.However, in the manual I can only find the timing description for the asynchronous NOR Flash and for synchronous NOR/PSRAM.Am I missing something here, or is it missing in the manual itself?
Hi.I am trying to test out a fault handler for our STM32G (right now, the fault handler just tries to determine the location of the code that caused the fault).If I force a fault (divide by zero) in "normal" non-interrupt handler code, I can easily read the stack frame, find the PC and determine the location of the fault (stack frame is located in the process stack).If I force a fault in an interrupt handler (USART1, using HAL code), the stack frame on the main stack does not make sense to me (what I think the PC is, does not point to a location in flash memory). If I add 0x50 to the address in the MSP, then I can see a stack frame with the correct PC.Is there a section in PM0214 that can explain what I'm seeing?I attached a few screenshots from the debugger in STM32CubeIDE that show the call stack and memory.In my example, the MSP in the fault handler points to 0x2001fde8, and the LR is 0xfffffff1. The stack frame I'm expecting to see is at 0x2001fe38.Thank you!
Hello ST Community team,on the MB2046 schematic, there is a button called B3 or Boot mode pin:But the UM3353 (chapter 7.9) mention only B1 and B2:Could you please correct this on the coming doc revisions.Best Regards.II
I am developing a TouchGFX user interface on a STM32U5G9 with a 24bit RGB LCD screen. I have developed the user interface on the STM32U5G9J-DK2 development board, where it works fine. I imported the TouchGFX project on my custom board the framework stops after the first full screen is displayed.As a test I have added a start-up screen with two colored boxes and a image in internal flash. I have configured interactions to jump to the main screen after 3 seconds. When I set a breakpoint inside model.tick(), it triggers before 25 ~30 times before it stops triggering. The other threads of the application run as intended (ThreadX). If I look at the thread list in CubeIDE, the TouchGFX thread has state ready, and it's run count stops increasing after the first frame is displayed on the screen. I compared both projects of the devboard and my projects in cubeMX, and I can't find any differences. I compared both IDE projects with winmerge, but also nothing found which could cause
I am experiencing an issue when trying to use STOP3 mode on an STM32U575VIT6Q device mounted on a custom PCB. In fact, the MCU never seems to actually enter STOP3, even though I explicitly call:HAL_SuspendTick(); HAL_PWREx_EnterSTOP3Mode(PWR_STOPENTRY_WFI); HAL_ResumeTick();The observed behavior is as follows:With Low-Power debugging enabled, STM32CubeIDE halts execution on the internal low-level _WFI() instruction.Without the debugger attached (free-running mode after BOR and JTAG detached), the MCU does not appear to enter STOP3 at all and continues normal execution after the call.From code inspection and debugging, it looks like the core is effectively ignoring the WFI instruction or is prevented from transitioning into STOP3 by some system or external condition.At the moment, it is unclear what might be blocking STOP3 entry. Possible areas I am investigating include:Pending or enabled interrupts/events that could immediately wake the core after WFIDebug-related side effects,
I have implemented a sensorless, six-step trapezoidal control with feed-back as zero crossing detection using back emf with the help of ADC on the nucleo-G431 board.The BLDC motor is A2212/13T, 1000 kV.Without a propellor, the motor is spinning, and speed is also changing.But with the propellor, the motor is stuck at starting, and it is not rotating.Give some suggestions on what could be the reason and what modifications need to be done on the firmware and software sides.
I am looking for example software for Display Port Alt mode for the STM32G0B1 eval board. I can't find it in the repository after searching most folders. The daughtercard schematic (MB1352) shows the DP alt mode connections, so I think this software exists and I am just not looking in the right place. Any suggestions on where to find the software example or even low level drivers for this would be appreciated.Thanks, Sonya
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.