Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
I tested FMC speed on F403 and H743. F403 works fine but H743 code will stopped due to memory fault.I set FMC parameter like belowMy plan is to connect stm32 to fpga by using FMC so did this test to check the speed. F407 test succeeded.But H743, the same code will stop due to memory error? I did this test without connecting FMC to anything.(FPGA is much faster so I only need to verify stm32 fmc speed.)I have no idea why f743 has this issue...
In a project using the STM32L451RET6, SPI3 is configured as follows* Full Duplex Slave* Hardware NSS Disable* Frame Format Motoroloa* Data Size 8* CPOL High* CPHA 2 Edge* DMA: * SPI3_TX Ch2 Mem to Per, Priority Low * SPI3_RX Ch1 Per to Mem, Priority HighThis works fine for a fixed packet length. Sometimes, however, the master may send a shorter packet (i.e. less than BUFFERLEN). In this case, it is necessary to end the slave SPI receive session and process the master's command. Consider the following code snippet:#define NSS (HAL_GPIO_ReadPin( NSS_GPIO_Port, NSS_Pin )) #define BUFFERSIZE 16 uint8_t SpiTxBuffer[BUFFERSIZE], SpiRxBuffer[BUFFERSIZE]; typedef enum { Idle, Wait, Done, WaitForNSS, Error } State_t; State_t State = Idle; int main(void) { /** Usual MX boilerplate here. STM32L451REx SPI Slave on SPI3 with DMA, 8 bit data, soft NSS */ while(1) { switch (State) { case Idle: if(!NSS) { State = Wait; if( HAL_SPI_TransmitReceive_DMA( &hspi3, Spi
I noticed that the ROM constants for ADC calibration values in the LL headers (*_ll_adc.h) are not defined as addresses of const data.e.g. #define VREFINT_CAL_ADDR ((uint16_t*) (0x1FF07A2A)) #define TEMPSENSOR_CAL1_ADDR ((uint16_t*) (0x1FF07A2C)) #define TEMPSENSOR_CAL2_ADDR ((uint16_t*) (0x1FF07A2E)) And it should be: #define VREFINT_CAL_ADDR ((const uint16_t*) (0x1FF07A2A)) #define TEMPSENSOR_CAL1_ADDR ((const uint16_t*) (0x1FF07A2C)) #define TEMPSENSOR_CAL2_ADDR ((const uint16_t*) (0x1FF07A2E)) Trying to write to it probably results in hardfault errors, but it should raise compile errors too in my opinion.
I believe I discovered a bug in the SPI driver in relation to using HAL_SPI_TransmitReceive_IT() that causes buffer overflows, which also made it tricky to discover.In our project, I had switched our SPI handlers to from blocking to non-blocking using the interrupt APIs.The bug happens when calling HAL_SPI_TransmitReceive_IT() which hits:HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef *hspi, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size) { ... /* Fill in the TxFIFO */ while ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXP)) && (tmp_TxXferCount != 0UL)) { ... hspi->pTxBuffPtr += sizeof(~); hspi->TxXferCount--; // <--- This decrements until 0 ... Then when an interrupt hits for SPI_TxISR_32BIT, SPI_TxISR_16BIT, or SPI_TxISR_8BIT it hits:static void SPI_TxISR_8BIT(SPI_HandleTypeDef *hspi) { /* Transmit data in 8 Bit mode */ *(__IO uint8_t *)&hspi->Instance->TXDR = *((const uint8_t *)hspi->pTxBuffPtr); hspi-&
Hi,I discovered today with some of my students this potential bug in the stm32g431xx.h file: #define RNG_CR_CED_Pos (5U)#define RNG_CR_CED_Msk (0x1UL << RNG_CR_IE_Pos) /*!< 0x00000020 */#define RNG_CR_CED RNG_CR_IE_MskAs RNG_CR_IE_Pos is equal to 3... This mask is not correct.It is quite strange: the comment is true... according to the Reference manuel 0440.I suggest this correction: #define RNG_CR_CED_Pos (5U)#define RNG_CR_CED_Msk (0x1UL << RNG_CR_CED_Pos) /*!< 0x00000020 */#define RNG_CR_CED RNG_CR_CED_Msk (I checked the last version of this file using this official github : https://github.com/STMicroelectronics/cmsis-device-g4/blob/7c39c32593b03764aaa57531588b8bf7cdd443a5/Include/stm32g431xx.h ) In the HAL, the assert can't detect the fail... "checking itself" : assert_param(IS_RNG_CED(hrng->Init.ClockErrorDetection));And this line used this CED... faking:MODIFY_REG(hrng->Instance->CR, RNG_CR_CED, hrng->Ini
Hello everyone,I'm working with the STM32WL30 and I'm trying to change the baud rate of the USART peripheral. However, I'm encountering some issues when I change the baud rate.The function I wrote for changing the baud rate looks like this:void changeBaudRate(uint16_t baudRate) { // start USART reset RCC->APB1RSTR |= RCC_APB1RSTR_USARTRST; // disable interrupt NVIC_DisableIRQ(USART1_IRQn); // stop reset RCC->APB1RSTR &= ~RCC_APB1RSTR_USARTRST; // set BRR USART1->BRR = 16000000 / baudRate; // set CR1 USART1->CR1 = USART_CR1_RXNEIE_RXFNEIE | USART_CR1_TE | USART_CR1_RE | USART_CR1_UE; // set IR prio NVIC_SetPriority(USART1_IRQn, 1); // enable IR NVIC_EnableIRQ(USART1_IRQn); } When I configured the baud rate for the first time, everything works fine and I receive the messages. If I change the baudrate to another value, I won't receive messages on the new baud rate, but still with the previously configured baud rate. When I debug the baud rate cha
Hello I'm working on stm32h747 dualcore with iar & ijet with mipi-10 connector.I have a problem in CM4 jtag debug When I try to debug the CM7 project. It always works fine. Jtag and SWD all works.And if i try to debug the CM4 with SWD method, it works fine too.But, if I try to debug CM4 project, error comes out. Success settings are: - Cm7/Swd/auto - Cm7/jtag/explict tap id=0,core no=0 - Cm4/Swd autoFailed setting is : - Cm4/jtag/explicit tap id=0,core no=1 When i try to debug cm4 with failed setting, Debug log said that cm7 at port 0, cm4 is at port3, but try to attach port1. and debug stopped with error.I think, if i change cm4 dap port number port 0 to port 3, I could debug cm4. Any advise?
Hello, I have modified the SubGHz_Phy_PingPong example to create separate transmitter-only and receiver-only code for two STM32WLE5 modules.I'm using the Low Level (LL) driver with UART1 interrupts on the STM32WLE5 TX module to receive data via UART, which is then transmitted over the radio. On the receiving end, the STM32WLE5 module receives the data via radio and forwards it to the target device through UART.Setup:UART ---> STM32WLE5 TX------| ( Radio ) |----------- STM32WLE5 RX ------> UARTAll data received by the STM32WLE5 TX module is handled exclusively through UART interrupts. Therefore, if interrupts are disabled, the UART will not be able to read any incoming data.In the STM32WLE5 transmitter code, Radio.Send() disables interrupts while transmitting data over the radio. During this period, UART interrupts are also disabled, preventing UART from receiving incoming data, which leads to overrun errors.Is there any possible way to prevent UART overrun errors when interrupts
HelloI am using STM32H7R3L8 MCU and STM32CubeIde v1.19.0. I have an issue where if I was to use SPI4 in Motorola mode together with CPOL=0 and CPHA=1, it works fine. It also works fine when I was to do SPI TX via DMA. Although, as I have the need to have CS inactive between each half-word being sent, I tried using the NSSP option of the SPI, which, when zoomed out on the logic analyzer view, seems to have an issue. Problem is, that at random points during a sequence of 1 half-word size transmits, SCLK and CS sometimes change their states at the same time, causing errors visible on logic analyzer and it seems like the slave device also can not handle that. Configuration:SPI4 in Motorola master modeHAL driverDMA transmitHardware NSS controlCPOL = 0, CPHA = 1 (SPI_PHASE_2EDGE)NSS active lowNSS pulse mode (NSSP) enabledIs the combination of CPOL=0, CPHA=1 and NSSP not functional? Should I be controlling the CS in software mode instead? Or am I missing something else?I have also added
Split from this thread. I did and it is all the same. Here is an example when I measure on port PB1 the voltage from VREF divided by 3 (2.5V/3 = 0,833..V). Voltage checked with multimeter. /* 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. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" /* Private includes ------------------------------------------------
Hi,The SDADC has three possible input modes,• Differential mode• Single-ended offset mode• Single-ended zero-reference modeTotal 9 pair SDADC channels are available in controller(ex. SDADC_AINP and SDADC_AINM)in our product we have utilized 8 pair SDADC channels using Single-ended offset mode or Single-ended zero-reference mode for metering application and positive input is connected to SDADC_AINP and external GND is connected to SDADC_AINM also attached reference schematic. kindly review the schematic and suggest
Hello,I have an issue with the CAN bus on STM32F042G6 µC. For the moment I just want to receive Frames from an other controller (STM32G0B1) and it doesn't work at all.I am using PA11 as Rx Pin and PA12 as Tx Pin Pins.Here is the configuration part with a 12MHz external clock :static void MX_CAN_Init(void) { /* USER CODE BEGIN CAN_Init 0 */ /* USER CODE END CAN_Init 0 */ /* USER CODE BEGIN CAN_Init 1 */ /* USER CODE END CAN_Init 1 */ hcan.Instance = CAN; hcan.Init.Prescaler = 16; hcan.Init.Mode = CAN_MODE_NORMAL; hcan.Init.SyncJumpWidth = CAN_SJW_1TQ; hcan.Init.TimeSeg1 = CAN_BS1_1TQ; hcan.Init.TimeSeg2 = CAN_BS2_1TQ; hcan.Init.TimeTriggeredMode = DISABLE; hcan.Init.AutoBusOff = DISABLE; hcan.Init.AutoWakeUp = DISABLE; hcan.Init.AutoRetransmission = DISABLE; hcan.Init.ReceiveFifoLocked = DISABLE; hcan.Init.TransmitFifoPriority = DISABLE; if (HAL_CAN_Init(&hcan) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN CAN_Init 2 */ /* USER CODE END CAN_Init 2
Hey here is my FLASH.ID : I want to use more of the ram . I am using : STMicroelectronics Arm Cortex-M4 MCU, 320KB flash, 48KB RAM, 64 MHz, 1.71-3.6V, 30 GPIO, UFQFPN48 STM32WB15CCU6 .. So i should have more RAM. but I am nor sure how to adjust the memory so I can use it. Currently as you can see. I am using the p2p OTA example, in which initially the FLASH was configured to be very small, and i extended that, but now the RAM is twice as less than what i should be able to use . Can you help me with this? Thanks!MEMORY{FLASH (rx) : ORIGIN = 0x08007000, LENGTH = 135KRAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FF8RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K}
Environment:- STM32Cube VSCode Extension (with Build Analyzer)- CMake-based project generated by STM32CubeMX- Windows 11 / GCC toolchainIssue:- The Build Analyzer fails to detect the .map file and reports "NO_MAP_FILE".- Investigation shows that the analyzer seems to only look for a .map file named after the *project folder*(e.g. build/Debug/<project_folder>.map).- However, in CMake projects the actual build target name is derived from ${CMAKE_PROJECT_NAME}, which can differfrom the folder name.(In my case: project name = VaporChamberController_V2, folder name = VaporChamberController_V2_vscode).Steps to reproduce:1. Create a project where the folder name and project name are different.2. Build the project with CMake.3. A .map file is generated (using the target name), but the Build Analyzer shows "NO_MAP_FILE".Workaround:- Manually force the linker to generate a .map file with the folder name using `target_link_options()`.Suggestion:- Modify the Build Analyzer to also check for
Hi team. We have been using the STM32F373VCT6 microcontroller across three different projects for the past three years. However, during testing and debugging time we’ve encountered a recurring issue where the controller is getting short between the 3.3V supply and ground suddenly. This problem has occurred multiple times and is affecting our development process. We kindly request your support in identifying the root cause of this problem.
Hello,I would like to use the TFM application on STM32CubeIDE for the B-U585I-IOT02A board but I can't find the application anywhere. Any help?
Hi!My STM32F207 behave funny when i "blx r3" from 0x800'0344 (FLASH) to 0x870 (lower 112KiB SRAM mapped to 0x0):It seems to ignore the first 4 bytes of instructions... When i insert 4 nops at 0x870 (or "DSB();ISB();"), then everything works as expected:int main() { { dbgb[0]=0xAFFE0000; asm("nop\n nop\n nop\n nop"); } { dbgb[19]=__SP(); for (u32 i=0; i<16; i++) dbgb[i]=0xABBA0000|i; } { dbgb[8]=__get_MSP(); dbgb[10]=__get_PSP(); dbgb[12]=__SP(); } { dbgb[0]=0xAFFEABBA; bla(); dbgb[1]=0xAFFEBEEB; } { dbgb[9]=__get_MSP(); dbgb[11]=__get_PSP(); dbgb[13]=__SP(); reset(); return 0; } init(); if (!mainrptver(0)) reset(); SET_BIT(SCB->SCR,SCB_SCR_SLEEPONEXIT_Msk); __WFI(); } void Reset_Handler() { dbgb[16]=__get_MSP(); main(); }the code in the flash is this (P is a u32* to 0x2000'0000):SYSCFG->MEMRMP = (0b11 << SYSCFG_MEMRMP_MEM_MODE_Pos); __DSB(); __ISB(); // map first 112KiB of SRAM to 0x0 __set_MSP(P[0]); __DSB(); __ISB(); // set stack pointer from app's ((u32*
I guess I have found a Bug in the G473RC debug launch script:I have a STM32G473RC MCU with 128k RAM and 256k Flash.As long as the Flash File stays below the size of 128k all works fine. I can develop, test and debug with CubeIDE. As soon as the flash file becomes larger than 128k, I can no longer debug the Software, because the Launch of the debugger exits with an error message:error dialogThe complete output in the console is:STMicroelectronics ST-LINK GDB server. Version 7.4.0Copyright (c) 2023, 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 : EnabledWaiting for debugger connection...Debugger connectedWaiting for debugger connection...Debugger connectedWaiting for debugger connection... ------------------------------------------------------------------- STM32CubeProgrammer v2.14.0 ---------------
Hello, I have the same problem but with the new version STM32CubeIDE_1.19.0. All the symptoms are the same as in this post but in the STM32G473RB processor and when the firmware becomes more than 64KB. Cube programmer normally writes the .elf taken from the project10:46:40 : Data read successfully10:46:40 : Time elapsed during the read operation is: 00:00:00.00710:46:44 : External loader sector number is too big, displaying only the first 4000 sectors10:47:12 : Memory Programming ...10:47:12 : Opening and parsing file: bms_g474.elf10:47:12 : File : bms_g474.elf10:47:12 : Size : 64.05 KB10:47:12 : Address : 0x0800000010:47:12 : Erasing memory corresponding to segment 0:10:47:12 : Erasing internal memory sectors [0 65280]10:47:13 : Download in Progress:10:47:14 : File download complete10:47:14 : Time elapsed during download operation: 00:00:01.89110:47:14 : Verifying ...10:47:14 : Read progress:10:47:14 : Download verified successfully10:47:14 : RUNNING Program ...
Hello,We are currently working on a project that requires integrating FreeRTOS with the STM32_WPAN BLE Stack. Based on various forum discussions, it seems that configuring the BLE portion of the project using CubeMX is currently not feasible.However, as we are still in the early stages of development, we would like to retain the convenience and simplicity that CubeMX provides for setup and configuration. To address this, we have decided to split the project into two separate projects:FreeRTOS and other application-related hardware/software functionality.Bluetooth functionality using the STM32_WPAN BLE Stack.Once both projects have been sufficiently developed, our plan is to merge them into a single project and continue development without relying on the CubeMX configurator.Our question is:Does STM or the STM community have a better approach or recommendation for addressing this issue?Best regards,Nick
System Details:MCSDK Version: 6.4Tool: MC Workbench 6.4.0Control Board: B-G431B-ESC1Motor: GL40 KV210Encoder: AS5047P with quadrature outputHello,I'm new to BLDC and FOC motor control and am currently trying to implement speed control using a quadrature encoder with my B-G431B-ESC1 board and GL40 KV210 motor. I've reviewed the manual and various forum posts regarding similar issues, but haven't found a solution.My primary problem is that while the setup functions correctly in sensorless mode, open-loop voltage, and open-loop current modes, encoder-based speed control is not working. Interestingly, the speed and direction calculated by the encoder align with the estimates from the sensorless approach.I suspect the issue lies with the encoder alignment process. I've observed the `stopll_el_angle` and `enc_el_angle` plots before and after alignment (as shown in the attached picture). During the alignment process, I plotted `I_q_meas` and `I_d_meas`. It appears current is flowing through t
Hi all,I'm looking for an example (STM32CubeIDE) allowing to call a function located in RAM in order to copy flash bank2 to flash bank1 and then restart the CPU.Regards,
We are creating a driver for a W25Q128JV Winbond Nor Flash chip. We are working with a STM32 H743ZI2 board and communicating on the QSPI peripheral with the help of the HAL libraries. Currently the driver can successfully Write to the chip using standard Page Program (0x02h) and the Quad Page Program (0x32h). We are also successfully doing a Fast Read (0x0Bh) up to speeds of 72MHz and a Fast Read Dual Output (0x3Bh) up to speeds of 36MHz before they start to fail. Currently we are using a 3.3V power bus, so based on the AC Electrical Characteristics seen in the datasheet we expect these commands to work up to speeds of 133MHz.Below is the CubeMX setup we are using for the QSPI peripheral:*Scaled clock down to 12MHz for logic analyzer testingIf you prefer the generated code that is also provided below.QSPI_HandleTypeDef hqspi; /* QUADSPI init function */ void MX_QUADSPI_Init(void) { /* USER CODE BEGIN QUADSPI_Init 0 */ /* USER CODE END QUADSPI_Init 0 */ /*
I want to enable the UART communication in MCSDK software which is very time critical task, i enabled UART with DMA, the problem is it cannot transmit more than 2 bytes even if i give 3 or more for transmission HAL_UART_Transmit_DMA(&huart3, buffer, 3); I get the call back void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) { uartransmissioncomplete = true; } after every 2 bytes. I tested the same program only with UART it works fine transferring more bytes. So, can i just go ahead with transmitting 2 bytes for every call back function, or will i really be able to transfer more bytes in the complete project, since i don't want to disturb the main functionality, i want UART data for data logging.
I’m using an STM32 board to drive an SSD1322 128×64 OLED display with my own driver library. It used to work fine without issues. Without changing the code, the display suddenly became completely unresponsive. - Power supply shows 0A current draw (normally it used to pull around ~0.3A).- During debug, I noticed something strange: inside MX_GPIO_Init() the code enters, but it hangs atGPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; and never progresses beyond that line.I double-checked all hardware connections multiple times, nothing seems wrong.When I swapped to another STM32 board of the same model, everything worked again without any changes.This makes me suspect a hardware fault on the original board (possibly ESD damage). My questions:- What should I pay special attention to when debugging this kind of issue?- How can I pinpoint the exact root cause (e.g., RAM/stack corruption, HardFault analysis, hardware measurements)?- What’s the recommended way to solve this and prev
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.