Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hello everybody! I recently started experiencing weird, unstable behavior during debug on my Nucleo u575zi-q board. So, I don't use HAL, or any graphic programming, or any API, doing everything in pure C from scratch. The IDE I use is, of course, the STM32 CUBE. It is the Mac version, 1.19.0. When my project was simple, everything was okay; the ST-LINK debug worked great. At some point, though, the debug became unstable. Sometimes the debug freezes, but more often it somehow ends up doing more strange things. For example, I have an RTC module in my project, and in the code, I wait for the RSF flag:while(!(RTC->ICSR & RTC_ICSR_RSF)){};When I download the code to my NUCLEO board and run it, everything is fine. But when I debug the same code, press the "run" button, the debug gets frozen on waiting for this flag to be set, and it seems that the flag, for some reason, never sets! So the debug doesn't work. I turn off the debug session, and the code runs well again! Sometimes the boa
I am trying to load LwIP_TCP_Echo_Server (an example project created by STMicroelectronics) onto a Nucleo_H7S3L8 Evaluation Board (produced by STMicroelectronics) and it's crashing. I had some trouble getting the BootLoader to run through to the JumptoApp function (covered under a different post) and used a workaround fix it.I set a break point just before the jump and examined the App memory at 0x70000000 (memory mapped). It was all 0xFFFFFFFF. No wonder the code crashed. I used the STM Programmer, and the memory looked ok. Code at 0x70000000 looked like a vector table and definitely not 0xFFFFFFFF. I added the Template_XIP_Boot project to my build as described in the README.md.I really need to get this piece of ... code to work. Like now. This stuff is basic startup operation. This is an ST example project on ST Nucleo hardware. What's going on? I've seen no other forum posts on my recent issues. Why is everyone else having fabulous success? Am I alone? What's wrong with
Greetings,I have used CRC peripheral in STM32G0B1 and its working fine. I am using this peripheral to calculate 16-bit crc. How to accomplish same task in STM32F207ZG ? I am using HAL and after code generation crc init code is very incomplete as per me. I have compared CRC init code for STM32G0B1 and STM32F207. Please guide on using CRC peripheral and code generation for STM32F207 using HAL.
I am using LTDC for interfacing with a TFT LCD. The LCD is connected with 18 bit (RGB666) interface. I have selected the pixel format as RGB565, and I am using a frame buffer stored in the internal SRAM. The frame buffer has been populated with 16 bit RGB values. The problem is, I can only see the output when I enable the CLUT and populate the CLUT with RGB values. Otherwise, if CLUT is not enabled, I cannot see the output. As far as I know, CLUT is used in L8 pixel format, but for RGB565 CLUT is not used. I am confused about this situation. Any idea what may be happening here?
Hi folks, I'm using one timer to generate a pulse train (TIM4), and a second slave timer to count the pulses (TIM8). This is on an STM32U575.I have this working nicely using a timer with centre aligned mode 3 for the counter mode, with the channel using asymmetric PWM mode 2. I set CCR1 and CCR2 to high values near the ARR value and this generates a small pulse of whatever duration is needed. The slave timer prescaler divides the update events by two, so I count up on every two update events, and this occurs when the underflow update event occurs. This results in the update events being 180 degrees out of phase with the pulses, which is exactly what I need.However, I would like to dynamically adjust the frequency through DMA updates of ARR. Ideally, I would avoid any CCR1 or CCR2 updates and just update ARR only. To do this, I'd like to use asymmetric PWM mode 1 and use fixed low values for CCR1 and CCR2. This would allow ARR updates without an
Based on the information found in AN4286 rev 14, I am trying to command to bootloader to start executing the application.The setup is a H573 and a H563 connected over SPI @ 0.5 MHz. The 573 operates as SPI master, and the 563 as a slave. I know that the HW is fine as I have no problem with the communication (application to application) when booth are configured with BOOT0 = 0.Then I set BOOT0 = 1 on the 563, and tries the following code:void BootloaderTest(void) { clrEsbCsN; DelayUsBlocking(10); // Sync frame uart_printf("SEND SYNC 0x5A, RX: %.2X\r\n", SpiWriteEsb(0x5A)); DelayUsBlocking(10); // Get ACK. if (GetAck()) { // Send GO command. uart_printf("SEND SOF 0x5A, RX: %.2X\r\n", SpiWriteEsb(0x5A)); DelayUsBlocking(10); uart_printf("SEND CMD GO 0x21, RX: %.2X\r\n", SpiWriteEsb(0x21)); DelayUsBlocking(10); uart_printf("SEND CHKSUM, RX: %.2X\r\n", SpiWriteEsb(~0x21)); // single byte command, nothing to XOR. DelayUsBlocking(10); // Get ack of command. uart_printf(
Hi everyone, I'm new to the FPV hobby and I've run into a problem that I'm completely stuck on after a long day of troubleshooting. I would be incredibly grateful for some expert help. The Hardware: I have a generic clone flight controller sold as an "F4 V3S Plus". The main processor is an STM32F405. The Problem: The board was working perfectly fine out of the box and connected to Betaflight. I decided to update the firmware to the latest version. I followed the standard flashing procedure and enabled the "Full chip erase" option. Since erasing and flashing, I can no longer get the gyroscope to work. What I've Done So Far: I have successfully troubleshooted all the basic connection issues. I can successfully flash firmware in DFU mode. I can successfully connect to the Betaflight Configurator (VCP / COM port drivers are working correctly). When I connect, the 3D model of the drone in the Setup tab does not move when I tilt the board. The CLI status command confirms the NOGYRO a
I have a custom board with a STMU5F7VJT, programmed over SWD, with an on board MMC and a usb connector. I am trying to access the onboard MMC with FileX and ThreadX. Using USBX, I can access the MMC just fine, and even format it from my computer, so MMC, ThreadX and DMA should be working fine. When trying to format the MCU through FileX however it hard faults during the synchronization deep in the ThreadX stack when calling tx_semaphore get() in the auto generated macro FX_STM32_MMC_WRITE_CPLT_NOTIFY().Curiously, this hard fault only happens when the cpu is allowed to run. When manually stepping through, the hard fault never occurs. The hard fault is extremely cryptic. It fails within the function:VOID _tx_thread_system_suspend(TX_THREAD *thread_ptr) #ifndef TX_NOT_INTERRUPTABLE {At the line of the macro "#ifndef TX_NOT_INTERRUPTABLE before entering the function proper.I've increased the stack sizes/memory pool to a ludicrous amount, double checked memory alligned buffers and all
I am implementing a firmware-update mechanism on STM32H755 (Nucleo board, MCU rev U) in which the two flash banks are independent. New firmware is flashed by erasing the "other" bank (which is always mapped at 0x0810 0000 and accessed with the ____2 register set, e.g. FLASH_CR2), then writing the candidate firmware image into that bank, verifying a SHA hash after programming, and finally toggling the SWAP_BANK bit in option bytes, performing an option-byte update, and software reset to boot into the new image. This works, and I can perform one update after another, ping-ponging back and forth between the banks. Note that the running application is always mapped at 0x0800 0000, is [much] less than 1 MByte, and never touches the other bank at 0x0810 0000 except to erase and program it when an update is requested.The issue I am having is that when the code runs in Bank 2 and an update commences, the bank erase of Bank 1 is stalling the CPU for several seconds. The
i m using STM32303E Eval board. This board has SPI based GLCD (as per datasheet of Board) with is connected through SPI-2. i m using TOUCHGFX for display images and my application has only QR code in it. i have started from STCubeMX, enabled TOUCHGFX and CRC, included QRcode from TOUCHGFX and finally compiled code in IAR workbench. The setting i have used in STCubeMX are attached as an image. But screen is not showing any image (remains white in color). i ve tried to debug and found a function hal.backPorchExited(); is not executing. Void touchgfx_taskEntry() {/** Main event loop will check for VSYNC signal, and then process next frame. * Note This function returns immediately if there is no VSYNC signal.*/ if (OSWrappers::isVSyncAvailable()) { hal.backPorchExited(); } } Now my question is 1. why the statement if (OSWrappers::isVSyncAvailable()) is always false and how to torubleshoot it. 2. IS it right to use TOUCHGFX for this board or i have to work with STemw
Hello everyone,I’m currently facing an issue with my project folder structure when using TouchGFX Designer (v4.21.4) together with STM32CubeIDE.Since the project was originally created with TouchGFX Designer, the generated structure (See below) is a bit problematic: The main project files exist inside the STM32CubeIDE folder (the actual IDE project).However, the Core folder and the TouchGFX folder live outside the root STM32CubeIDE project folder.This makes the structure inconsistent compared to projects created directly from CubeMX with TouchGFX , where everything (including Core and TouchGFX) is properly contained within the STM32CubeIDE root folder.What I want to achieve:Reorganize the project so that Core and TouchGFX are placed inside the STM32CubeIDE folder, making the structure(see below) look the same as if it had been created through CubeMX with TouchGFX enabled. What is the correct way to restructure the project without breaking the build process?Is there
As an exercise, I have written a 2-phase induction motor control program using high-level program elements (HAL). I used a Nucleo-G071, though I'm sure nearly any STM32 family device will work. Since 2-phase algorithms are not common cookbook items, I started from scratch. The desired end state is the use of center-aligned PWM using burst-mode DMA and a 3-wire interface. I encountered problems with asymmetry in the pulse positions of the 3 outputs. After much coding and experimentation with logic analyzers and oscilloscopes, I came up with a method that yields a clean uniform output. I used VS Code and GitHub Copilot during the development. After finishing, I asked GitHub Copilot to summarize the problems and solutions. Perhaps this may be useful to those who are undertaking similar work. I am attaching that summary here: # Solving Center-Aligned PWM Asymmetry in STM32 DMA Burst Mode Applications**A Novel Split-and-Phase-S
Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code HI I am having an issue with starting measurements using the on-board microphone. Everything has been configured based on the BSP code, but set up from scratch using CubeMX. The problem is that when I start the DMA Receive if (HAL_SAI_Receive_DMA(&hsai_BlockA4, (uint8_t*)PDM_Buffer, PDM_BUF_SIZE) != HAL_OK) { printf("SAI RX start error!\r\n"); } else { printf("SAI RX started OK"); } //callbacks: void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai) { printf("HAL_SAI_RxHalfCpltCallback\n"); } void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hsai) { printf("HAL_SAI_RxCpltCallback\n"); } void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai) { printf("SAI error: 0x%08lx\n", hsai->ErrorCode); } I immediately get an interrupt rep
I have a problem and currently no clue how to further debug. Maybe one coudl help me. I use STM32f4 to capture with ADC1 3 signals with 1Mhz (so 333kHz per channel) triggered by a timer and transfered via DMA. I have a DMA buffer of 3*2*100 (so 100 samples per channel per half DMA). When DMA is Half/Full filed, I store the data in a second buffer with 10 times 100 samples. Using a test sin signal ~23kHz, I get discontinuities at each 100 sample border. I check the code several times but could not find an error and it seams like ADC sampling is kind of pausing at each DMA Half/Full callback call (which seams not plausible)BR, BastelBaus The faulty output with discontinuities each 100 samples: Timer configuration (96Mhz clock)ADC configuration Init the ADC and callbacksvoid ADC_init(void) { HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1); // ADC trigger HAL_ADC_Start_DMA(&hadc1,(uint32_t*)&adc_samples,ADC_N ); } // void ADC_init(void) {// Called when firs
I have overall found this feature to be very unreliable, for reasons unknown. The data comes out OK from PB3 and goes all the way to the STLINK V3, at the expected speed, 1MHz, but Cube IDE displays nothing. I have this across a number of development units. Sometimes it works and then stops...Anyway, digging into this, it looks like the entire trace macrocell is configured via the debugger when (or before) reset is released from the target. That is why none of the STM example code sets up any of this stuff. I also managed, years ago, to get SWV working not with Cube IDE but with the STM32 STLINK Utility, which presumably does the same via-debugger config tricks.Also just because you see 1MHz stuff on the scope doesn't mean that it is in the right format for Cube IDE to decode it.So I went looking for how to get this stuff configured in software in the target. Obviously any such config will override the Cube/debugger config so you will have to make sure Cube IDE's config matches ex
Hi all,So, after almost half a year of arduous blood, sweat and tears I have managed to scrape together "something that works". It consists of a custom schematic and PCB powered by an STM32F042C6T6 and an Si4705 radio tuner (from Skylabs).The STM32 uses the internal clock circuitry that is configured as depicted here. The CRS sync source is not shown here, but it is set to USB, so that the chip runs completely without any external crystals. The USB 2.0 is full-speed since the STM32 is only full-speed:The Si4705 currently uses a precise, external 32,768 kHz crystal oscillator (SG-3030CM from Seiko) that only requires a by-pass capacitor. This crystal oscillator is not connected to the STM32 in any way.The tuner chip has a prescaler and precise REFCLK adjustment so it can, if required, support a frequency range from 31130 Hz up to 140,89 MHz. Currently these settings are in their default values due to the crystal oscillator.The STM32 commands the Si4705 via I2C, without DMA, and thi
After updating TouchGFX from 4.24.1 to 4.26.0, the Stride setting in "X-CUBE-TOUCHGFX"->"TouchGFX Generator" is readonly (grayed out). I need to set it to the value 832. The generated code uses the value 800, even if I modify the value in the project.ioc file manually.When I change the Stride value in TouchGFXHAL.cpp and in TouchGFXGeneratedHAL.cpp (at call of setFrameBufferSize()) manually, the display works perfectly.I am using:STM32F769BIT uCMxCube 6.15.0STM32Cube FW_F7 V1.17.4 Any advise is very welcome. Thank you!
Resuming studies, regarding:I'm resuming my STM32 studies, having not used them for a few months.After this time, and updates to CubeID and CubeMX, I'm trying to get back to it using the Nx_webserver example. Although the code appears to be correct, it doesn't work; it doesn't even get a valid IP address in DHCP.I've tried changing the MAC address, but even then, nothing in DHCP works.Is there anything I should do to make it work?I have the following console output: ------------------------------------------------------------------- STM32CubeProgrammer v2.20.0 ------------------------------------------------------------------- Log output file: /tmp/STM32CubeProgrammer_q4oXBH.log ST-LINK SN : 066EFF353445503043075718 ST-LINK FW : V2J46M31 Board : NUCLEO-F429ZI Voltage : 3,23V SWD freq : 4000 KHz Connect mode: Under Reset Reset mode : Hardware reset Device ID : 0x419 Revision ID : Rev 5/B Device name : STM32F42xxx/F43xxx Flash size : 2 MBytes Device type : MCU Device CPU : Cortex-M
Hiya. This is my first time working with custom STM PCBs.I was planning on flashing/programming my custom STM32H7 board (specifically STM32H7A3RGT6) over STLINK and then just do general purpose programming over the USB-C COM Port. However, the TAG connector pitch was the wrong size so I'll need to find an adaptor to connect that to the STLINK module I have.I was wondering if there is anything I can do in the meantime to program the board? The SWO/SWDIO/SWDCLK pins are broken out and I have a Nucleo L432KC. Are there any guides or tutorials for me to follow for this kind of thing?Any help is much appreciated :).
Hey,I have a confusing error, i have a Riverdi 7" TFT Panel (https://download.riverdi.com/RVT70HSTNWC00-B/DS_RVT70HSTNWC00-B_Rev.1.2.pdf)Actually my LTDC Init is this:static void MX_LTDC_Init(void) { /* USER CODE BEGIN LTDC_Init 0 */ /* USER CODE END LTDC_Init 0 */ LTDC_LayerCfgTypeDef pLayerCfg = {0}; /* USER CODE BEGIN LTDC_Init 1 */ /* USER CODE END LTDC_Init 1 */ hltdc.Instance = LTDC; hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL; hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL; hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL; hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC; hltdc.Init.HorizontalSync = 0; hltdc.Init.VerticalSync = 0; hltdc.Init.AccumulatedHBP = 160; hltdc.Init.AccumulatedVBP = 23; hltdc.Init.AccumulatedActiveW = 1184; hltdc.Init.AccumulatedActiveH = 623; hltdc.Init.TotalWidth = 1344; hltdc.Init.TotalHeigh = 635; hltdc.Init.Backcolor.Blue = 0; hltdc.Init.Backcolor.Green = 0; hltdc.Init.Backcolor.Red = 0; if (HAL_LTDC_Init(&hltdc) != HAL_OK) { Error_
Hi friends, I'm having a problem with my MKS Odrive Mini V1.0 board.I replaced the MCU because the old one had shorted out.The problem is this: the board is no longer recognized by USB.I'm trying to use an STLink, but I also don't have access to load the .hex file it comes with. I would need your help to try to flash the new MCU somehow.I was using both STM32CubeProgrammer and STM32Utility, but neither of them worked.
Hello,I'm working with STM32F429ZI nucleo board, and I would like to flash my program using UART (USART1 or UART3 via a usb to ttl converter) instead of ST-Link.I understand that STM32 has a built-in bootloader that can be used for flashing via UART, but I'm not sure about the exact steps or tools required.when I connect the uart with STM32CubeProgrammer an error message come :-13:58:51:175 : Error occured while sending Init command.13:58:51:175 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again......settings I did:1.the boot0 pin connected with 3v3 and boot1(pb2) connected to ground2.uart3 pins PB10,and pb11 used for tx and rx respectivelyHere’s what I’ve tried / what I need help with:1. How to connect the UART pins correctly for flashing?2. What BOOT0 and BOOT1 pin settings are needed?3. What software can I use on the PC side (e.g., STM32CubeProgrammer or any alte
I'm developing a bootloader for a project using the STM32H563VGT6 with 1MB of internal flash memory. I've developed a bootloader in the past for STM32H743 which works correcty.In this H5 bootloader I seem to have problems writing to the internal flash memory. Below is the code I have to write a block of data to flash memory.uint32_t Flash_Write_Data (uint32_t StartSectorAddress, uint32_t *data, uint16_t numberofwords) { static FLASH_EraseInitTypeDef EraseInitStruct; uint32_t SECTORError; int sofar=0; /* Unlock the Flash to enable the flash control register access *************/ HAL_FLASH_Unlock(); /* Erase the user Flash area */ /* Get the number of sector to erase from 1st sector */ uint32_t StartSector = GetSector(StartSectorAddress); uint32_t EndSectorAddress = StartSectorAddress + numberofwords*4; uint32_t EndSector = GetSector(EndSectorAddress); /* Fill EraseInit structure*/ EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS; EraseInitStruct.Sector = Sta
Hello, We have a STM32H755 with an FRam (similar to SRAM) module attached to the FMC. We have been seeing CPU exceptions when the M4 core tries to access (read only) the same memory location the M7 core is writing to. So, it seems that the FMC does not arbitrate between the two cores... Is that correct? or do we potentially have the FMC configured incorrectly. We have the FRam memory address region configured in the MPU as shareable (M7 - read/write) and read-only (M4 - reads only) and tried with cache disabled as well with same cpu exception... Thanks, -mike
ADC1 clocked @ 65 MHz, prescalar 0 for divide by 1, continuous conversion, DMA circular mode, 640.5 cycle sampling time, 256x oversampling, 12-bit resolution, 3 channels per sequence. The channels in the sequence are: IN3, temp sensor channel, Vrefint channel. I would expect a sequence to be converted in (3 * 256 * (640.5 + 12.5)) / 65000000 => ~7.7 ms.HAL_ADC_ConvCpltCallback() increments a counter for TC and HT. In 120 seconds (used debugger to stop) I get 60102. TC count = 60102/ 2 = 30051 for 120 seconds or 3.9 ms average/sequence. HAL_ADC_ErrorCallback() never called.Why the discrepancy: 7.7 ms expected vs 3.9 ms observed?MX_ADC1_Init() looks like…static void MX_ADC1_Init(void) { /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** Common config */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; hadc1.Init.Resolution =
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.