Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
NUCLEO F767ZI, CubeIDE 2.1.1, CubeMX 6.17.0I'm trying to set up UART with printf()#include <stdio.h> UART_HandleTypeDef huart3; static void MX_USART3_UART_Init(void); int __io_putchar(int ch) { HAL_UART_Transmit(&huart3, (uint8_t *)ch, 1, 10); return ch; } .... // in main // in while prinf("UART test\r\n"); // MX generated USART3 init static void MX_USART3_UART_Init(void) { /* USER CODE BEGIN USART3_Init 0 */ /* USER CODE END USART3_Init 0 */ /* USER CODE BEGIN USART3_Init 1 */ /* USER CODE END USART3_Init 1 */ huart3.Instance = USART3; huart3.Init.BaudRate = 115200; huart3.Init.WordLength = UART_WORDLENGTH_8B; huart3.Init.StopBits = UART_STOPBITS_1; huart3.Init.Parity = UART_PARITY_NONE; huart3.Init.Mode = UART_MODE_TX_RX; huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart3.Init.OverSampling = UART_OVERSAMPLING_16; huart3.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; if (HAL_UART
Hello,I am using the HRTIM on an STM32F334 to drive a buck/boost converter.I monitor MOSFET temperature using NTCs via ADC2, and I also need to measure the internal CPU temperature and VREFINT using ADC1.ADC configuration:ADC1Regular: VREFINT, TEMPSENSORInjected: VinADC2Regular: MosFetTemp1, MosFetTemp2, AnalogStartInfoInjected: VoutIssue:As soon as the HRTIM is initialized (even without starting it), the ADC regular conversion values become unstable.Observations:100 samples of VREFINT only → stable when HRTIM is not initialized100 samples of TEMPSENSOR only → stable when HRTIM is not initialized100 samples of (VREFINT + TEMPSENSOR) → stable when HRTIM is not initialized100 samples of (VREFINT + TEMPSENSOR + ANALOGSTARTINFO) → stable when HRTIM is not initializedAs soon as HRTIM is initialized, all these measurements become noisy/unstable.The issue is also present:even if HRTIM is not startedeven if GPIOs are not initialized (so MOSFETs are not switching)even if line HAL_HRT
Hi all,I am currently working on the design of a custom LoRa/LoRaWAN-based IoT node using the STM32WLE5JCI6TR (bare MCU, not a module), and I am looking for a complete and reliable hardware reference design to follow.So far, I have identified the following:NUCLEO-WL55JC reference design files (schematics and PCB) from ST, which appear to be the closest official reference (even though it is based on WL55 dual-core variant)Wio-E5 Dev Board from Seeed Studio, which is based on a module and does not expose the RF design detailsWhile these are helpful, I am specifically looking for:A reference design based directly on STM32WLE5JC (or very close variant)Complete design files including:Full schematicsPCB layout filesRF matching network implementationAntenna routingPCB stack-up / layer informationSince RF design (matching, impedance control, grounding, etc.) is quite sensitive, having a proven reference is critical.Additionally, I would like to know::backhand_index_pointing_right: Are there an
Hi all. Let me tell you the problem I'm facing and I googled for finding some help but without luck. The problem I have in hands is as next. I was using Nucleo WB55 to use the STM32F103CBT6 to program a microcontroller I have in a custom PCB for an end product I'm designing. Until yesterday everything was working OK. Since yesterday the STM32CubeIDE is telling me that is not possible to connect with the programmer. I checked what's the message shown by this last program and it says:Target no device found Error in initializing ST-LINK device.Reason: No device found on target. After seeing this, I downloaded the ST-Link Utility to connect to the board and the program says:Now, having this message I proceeded to use the STM32CubeProgrammer to see what it can tell me and it shows:14:45:15 : UR connection mode is defined with the HWrst reset mode14:45:15 : ST-LINK SN : 066EFF31333541504314132814:45:15 : ST-LINK FW : V2J43M2814:45:15 : Board : P-NUCLEO-WB5514:45:15 : Volt
Dear all,I'm working on a project based on STM32F479 and FreeRTOS. In this project the microcontroller is connected via I2C and SPI bus to other devices, such as switch ethernet and spi-uart converter. I run the initialization of these devices before the start of the FreeRTOS scheduler. Startup procedure requires switching some GPIOs and waiting a few milliseconds as described in the devices datasheet. I've manged the waiting part of the initialization using the HAL_Delay function. This project has been generated in 2019 with STM32F4 fw package 1.24.0 and an old version of STM32CubeMX.Recently I've created a new project for the same hardware using fw package 1.28.0 and STM32CubeMX 6.11.1. I noticed that the initialization of TIM6 in stm32f4xx_hal_timebase_tim.c has been updated and HAL_InitTick function is changed (which you can find in the attachment). Now I'm experiencing a strange behaviour. During devices initialization the program remains stuck in the HAL_Delay function. Apparentl
I am currently designing a custom sensor PCB for an underwater ROV project using an STM32 (STM32G431CB). This is my first complete PCB design, so I would like to get feedback before moving on to the PCB layout stage.The board is intended to act as a sensor interface and control unit, and includes:IMU (BNO08X)Depth/pressure sensor (analog)Multiple analog leak detection sensorsESC control via PWM outputsUART communication with a Jetson Orin Nano3.3V regulation using an LDO (LP2985-3.3)The system is designed to operate in an underwater ROV environment, so reliability and noise robustness are important.Before starting PCB layout, I would really appreciate a review of my schematic.Could you please help me with:Identifying any design mistakes or missing componentsChecking power distribution and decoupling strategyVerifying STM32 minimum requirements (BOOT, NRST, SWD, etc.)Any suggestions for improving robustness in a noisy environmentI have attached the KiCad schematic for reference.Thanks i
Hello, I have custom STM32N657 board with two USB ports. There is USBX device video class running on USB Port 1 and streaming video - all good here, working well.I would like to get exactly the same functionality on USB port 2 - second USB video device. The STMCubeMX supports only one USB port in device mode - that is also limitation of USBX"Only one USB device controller can be defined at any time to operate in device mode."azure-rtos_rtos-docs/rtos-docs/usbx/usbx-device-stack-2.md at main · azemb-todd/azure-rtos_rtos-docs · GitHub What is the best approach to get second USB port running in USB video class in device mode?
I have Playback set up and running. I also have recording set up as well. It enumerates. It shows up as STM32 Microphone. But it does not capture anything. I notice that playback is not playing sounds either. So I traced it to this: as soon as I have BSP_AUDIO_IN_Init() called, playback doesn't play sounds. I wonder if there's an issue with having both instances be 0? // Initialize Audio Play and Record structures AudioPlayInit.Device = AUDIO_OUT_DEVICE_HEADPHONE; AudioPlayInit.ChannelsNbr = 2; AudioPlayInit.SampleRate = AUDIO_FREQUENCY_48K; AudioPlayInit.BitsPerSample = AUDIO_RESOLUTION_16B; AudioPlayInit.Volume = VOLUME_SPEAKER_DEFAULT; AudioRecordInit.Device = AUDIO_IN_DEVICE_ANALOG_MIC; // Use instance 0 SAI/codec AudioRecordInit.ChannelsNbr = 2; AudioRecordInit.SampleRate = AUDIO_FREQUENCY_48K; AudioRecordInit.BitsPerSample = AUDIO_RESOLUTION_16B; AudioRecordInit.Volume = VOLUME_MICROPHONE_DEFAULT; // Initialize Audio Output Device if(BSP_AUDIO_O
HiI have STM32H563 Nucleo board which is in closed state with DA_Config.obk not programmed, And the trust zone disabled. This was done by mistake, Is there a way to do regression on it.Operations Done on the device.1.Done the regression2.Set the product state to provisioning3.Programmed OEMiRoT_Config.obk4.Set the device to closed state.Logs from ST32Cube programmer on DA Discovery10:40:20 : STM32CubeProgrammer API v2.19.0 | Windows-64Bits10:44:38 : Start Debug Authentication Sequence10:44:38 : SDMOpen : 624 : open : SDM API v1.010:44:38 : SDMOpen : 625 : open : SDM Library version v1.2.010:44:38 : open_comms : 513 : open : Asserting target reset10:44:38 : open_comms : 517 : open : Writing magic number10:44:38 : open_comms : 537 : open : De-asserting target reset10:44:38 : open_comms : 584 : open : Communication with the target established successfully10:44:38 : discovery: target ID.......................:0x48410:44:38 : discovery: SoC ID..........................:0x0000
Hi everyone, I'm new to STM32 and I'm building an audio player. I'm using an SD card (via SPI) to feed audio data to a dac via I2S.The audio stutters and often plays the same 1-2 second snippets twice before moving on.I've tried implementing double buffering and i've checked the i2s configuration in circular mode.Code:https://github.com/darty555/stm32-i2s-dma.git
I am experiencing difficulty getting the NUCLEO-WL55JC1 to properly enter Shutdown mode. In some cases, the device appears to enter Shutdown mode but exits immediately. In other cases, it remains in Shutdown mode, but the current consumption is approximately 1 mA. The procedure I am using to enter Shutdown mode is straightforward, yet the behavior does not seem correct. Could you please advise on possible causes or recommended debugging steps for this issue?
As asked in the subject: Is there a hole in the memory map of the STM32C552VC (Bank1 from 0x08000000 to 0x08020000 / Bank2 from 0x08040000 to 0x08060000) or are the two banks continuous from 0x08000000 to 0x08040000)
I'm looking to implement USB host functionality on an STM32C071 to connect with a single device that sends/receives serial data over USB so the only class I'm interested in is CDC, but I'm having trouble using USBX (I'm not using RTOS). For now I haven't used and read/write functions, my goal was to start by checking the functionality of the callbacks inside "app_usbx_host.c" which are: device inserted/removed/connected/disconnected, enumeration fail and no USB device found. Each one sets a different flag to be handled inside the main loop. I put a breakpoint inside the USB IRQ and when I connect the USB device it stops execution and confirms the breakpoint has been reached, however none of my flags are ever set,. I suspect the reason might be because I haven't done anything to link the USB peripheral to the USBX stack, if the function responsible for that is ux_host_stack_hcd_register, I have no idea how to use it. The function prototype is:UINT _ux_host_stack_hcd_
Hi guys,I'm working on custom board with STM32F411 + spiflash for a project with Touchgfx (partial buffer).At the moment I got spiflash and STM32F411 working via SP1 + DMA and that's fine.I'm using IAR 9.70 for this project and I'm facing an issue with external flash loader when I do a debugging session.When I start a debugging session, flash is programmed and the external loader programs the spiflash too.But on the end of the programming the procedure fails with: Sun Mar 29, 2026 21:45:19: Initial reset was performedSun Mar 29, 2026 21:45:19: Loaded debugee: C:\Program Files\IAR Systems\Embedded Workbench 9.2_3\arm/config/flashloader/ST/FlashSTM32F4xxxRAM128K.outSun Mar 29, 2026 21:45:19: Target resetSun Mar 29, 2026 21:45:26: Unloaded macro file: C:\Program Files\IAR Systems\Embedded Workbench 9.2_3\arm/config/flashloader/ST/FlashSTM32F4xxx.macSun Mar 29, 2026 21:45:26: Loaded macro file: D:\ARM\STM32F411\AlphaTui\CubeMx\AlphaTui\EWARM/icf/ExtSPIFLd.macSun Mar 29, 2026 21:
Hello everyone!I’ve been struggling to create a working application on the P-NUCLEO-WB55. My goal is to implement a Zigbee On/Off Client Sleepy End Device (SED) with NVM support, using buttons for control.I was able to successfully reproduce the On/Off Client SED with NVM and low power consumption (around 3 µA), measured using the ST-Link Power Monitor. However, in that example project, a timer is used to trigger the On/Off commands.I created a new application that uses buttons instead of the timer, but now the device never enters sleep mode and behaves quite strangely. Based on the current consumption spikes, I can see that the device is transmitting data. In Wireshark, I can see that packets are being sent, but Home Assistant does not react to the commands at all.I have attached my app_zigbee.c file. Could someone please help me understand what I am doing wrong?Perhaps someone could share a working example of a Zigbee On/Off Client SED with NVM support and button control. Such an exa
I have established BLE advertisement and connection is established successfully between ST BLE toolbox and the stm32wb55 based board. I am unable to read the chateristic value from the st ble tool box. My code is in custom_app.c file I2C_HandleTypeDef hi2c1; int sizecharwrite; uint8_t my_value =5; float adc_voltage_ble = ADS1115_readSingleEnded_AIN0(&hi2c1); uint8_t pPayload; sizecharwrite=snprintf( ble_voltage,sizeof(ble_voltage),"%0.2f", adc_voltage_ble ); if (sizecharwrite < 0 || sizecharwrite >= sizeof(ble_voltage)) { // Error or truncation return; } memcpy(pPayload,&ble_voltage, sizeof(ble_voltage)); In the cutom_stm.c file aci_gatt_update_char_value(CustomChemdetectHdle, CustomCharwriteHdle, 0, /* charValOffset */ SizeCharwrite, /* charValueLen */ (uint8_t ) pPayload); Edited to apply source code formatting - please see How to insert source code for future reference.
Hi Team,We are observing persistent and repeatable debug connectivity issues on multiple custom boards based on the STM32H745BIT6 MCU. These boards were initially functioning as expected; however, after repeated debug sessions, they started exhibiting failures. We request your support in identifying the potential root causes and guidance on recovery. We have performed Full Chip erase also whenever it was possible. Below are our consolidated observations captured across multiple boards.Observed IssuesDebug Interface Failures After Multiple SessionsAfter several debug sessions, the following errors are observed intermittently:TARGET_HELD_UNDER_RESETTARGET_NOT_HALTEDTARGET_NO_DEVICEError: Unable to get core IDInconsistent Connectivity Between ToolsThe device intermittently connects using STM32CubeProgrammer.The same device frequently fails to connect in Debug mode using STM32CubeIDE.Loss of Debug Connection During RuntimeDuring debugging, the controller runs for a few seconds.T
I have a program where I have TIM2 CH1 set up in output compare mode. Approximately 0.5 ms after the timer is reset, CH1's compare value is reached. This triggers the CH1 DMA, which is a dummy DMA on DMA1 channel 1. The SPI TX DMA is synced to the TIM2_CH1 DMA (with a request count of 16, to allow 16 bytes through the SPI), and therefore if it is armed should automatically start at that moment. The purpose of this is to eventually provide an interrupt-free delay for an external SPI slave that requires a 350ns delay between CSn active and SCLK active.I have this all mostly working, but my problem is that about 5% of the time, the SPI DMA does not complete. I can't figure out what in my code is allowing this to happen. The basic structure is:Arm SPI DMAs.Reset TIM2 counter.Wait until the DMA completes. (This should be triggered by TIM2 reaching the compare value.However, for reasons I cannot understand, about 5-10% of my transfers never appear to start -- I wait for a long period of time
I have an stm32h7s78-dk and I created a GUI with TouchGFX. I am trying to transmit some data via UART when a button is pressed. I have the virtual function triggering in my MainDisplay and I was trying to use FreeRTOS and Queues to communicate from the virtual function from the button press to the uart task that I created via STMCubeMX. For some reason though, the screen stays black when I try to use an if(xQueueReceive(queueHandle, &message, 0) == pdPASS) { printf("Message received"); }in my uart task. If I comment out this code then everything works fine and the GUI is visible. I'm not sure what I'm doing wrong. Here is my main.c/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2023 STMicroelectronics. * All rights rese
(HAL_SPI_Transmit_DMA works partially, HAL_DMA_Start_IT not working)I’m working with an STM32U5 MCU using SPI3 with GPDMA to drive an ILI9341 display. I’m trying to transmit a larger buffer (~23040 bytes), but display only receives about 1024 bytes, and goes into HAL_SPI_STATE_BUSY_TX forever.Function used: HAL_SPI_Transmit_DMA()Configs: Thanks in advance !
My FMC clock, set to continuously generated, only cycles during a bus transaction.On my STM32N657I0H3Q, I have the following setup:FMC enabled in applicationChip Select NE1Muxed PSRAMData/Address: 16 bitsClock: Burst Read WriteAddressValid: YesWait: SynchronousThen, in the configuration, I have "CLK generated continuously" set. I have confirmed all of these settings in the resulting fmc.c code. I've also verified at runtime that hsram1.Instance->BTCR[FMC_NORSRAM_BANK1] = 0x183997(Where 1<<20 -- 0x1000000 is continuous clock generation).Meanwhile, my oscilloscope shows the FMC_CLK waveform:Clearly not continuous!
seriously i just want to design my product around an mp2. literally any. i cant pick one because none of them are in stock.im clicking every single mp2 variant that exists. then im picking the sub variant, and then the package. like 3 trees deep. not a single one ive found so far is in stock. these have been out for like years now. how am i supposed to use this chip in my product if it's availability is near non existent?really bad look for st here.
When a USART is configured without a clock, the code generator treats it as a UART and assigns HAL_UART_IRQHandler as the interrupt handler. However, within this handler, there is a blocking operation during the idle process:(void)HAL_DMA_Abort(huart->hdmarx);When certain error conditions occur, the code can become stuck in HAL_GetTick(). This happens because the SysTick priority is lower than that of the UART interrupt. I have observed this behavior multiple times, particularly when noise is present on the UART signal line.Has Anyone seen this situation before?
Hello,I have two Winbond W956D8MBYA (64Mb, x8) HyperRAM chips connectedto XSPI1 on STM32H7S3 in dual memory mode (DMM=1):- Chip #0 → IO[7:0] + DQS0- Chip #1 → IO[15:8] + DQS1- Shared: CLK, NCLK, NCSI need to run at 200 MHz, so I need to configure CR0 on both chips:- Initial latency = 7 cycles (default is 6, valid only up to 166 MHz)- Fixed latency (required for dual mode per RM0477)Problem:According to RM0477, in HyperBus 16-bit dual mode:1. Variable latency is not supported (LM bit in XSPI_HLCR must be set)2. Register space access uses only IO[7:0]. Quote from RM0477:"IO8 to IO15 being not used but driven by the controller"So I can only access registers of chip #0.I also tried MSEL bit in XSPI_CR to switch to IO[15:8] in single memHyperBus mode - no effect.Questions:1. How to write CR0 to chip #1 connected to IO[15:8]?2. Is there any way to initialize each chip separately beforeswitching to dual mode?3. Does the controller duplicate data on IO[15:8] during registerwrite in dual mode?M
Hello ST Community!I've been trying to recreate the DCMIPP_ContinuousMode example with STM32CubeIDE, but have been running into some issues with the IMX335_Probe function, the ID read by the I2C bus never matches the expected define IMX335_CHIP_ID. The original example runs completely fine in the STM32N6570-DK.- AXISRAM3 (0x34200000) is being used as the address for the DCMIPP CSI Pipe.- ISP Middleware does not return any errors in initialization.- All files regarding IMX335 registers and functions match with the original examples. Same for all the BSP drivers.- RIF has been configured for all peripherals involved.- AXISRAM3 has been enabled in the CubeMX configurations, and it's clock has also been enabled.static void IMX335_Probe(uint32_t Resolution, uint32_t PixelFormat) { IMX335_IO_t IOCtx; uint32_t id; /* Configure the camera driver */ IOCtx.Address = CAMERA_IMX335_ADDRESS; IOCtx.Init = BSP_I2C1_Init; IOCtx.DeInit = BSP_I2C1_DeInit; IOCtx.ReadReg = BSP_I2C1_ReadReg16; IOC
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.