Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
HiI am trying to read the SGP40 VOC sensor with the code below, but i can't read the raw data. I can transmit the command but when i try to receive data, it can not receive. I am using STM32F103 mcu. Any advise .uint8_t SGP40_ReadVOC(void) { uint8_t cmd[2] = {0x26, 0x0F}; uint8_t rx_buf[6]; uint16_t voc_raw = 0; HAL_Delay(250); if (HAL_I2C_Master_Transmit(&hi2c1, 0xB2, cmd, 2, HAL_MAX_DELAY) != HAL_OK) { return 0xFF; } HAL_Delay(30); if (HAL_I2C_Master_Receive(&hi2c1, 0xB3, rx_buf, 6, HAL_MAX_DELAY) != HAL_OK) { return 0xFF; } voc_raw = (rx_buf[0] << 8) | rx_buf[1]; return voc_raw >> 8; }
Hello dear community,I’m a beginner with STM32 and I’m trying to interface an APS6404L PSRAM to my STM32H7S3L8H6H using the XSPI1 peripheral. Despite configuring XSPI in CubeMX and generating the initialization code, I see no activity on any of the XSPI1 pins (CS, CLK, D0, D1, etc.) when I attempt a simple “Read ID” command. However, if I reconfigure those same pins as GPIO outputs and toggle them manually, they toggle just fine, so I know the pins themselves are physically working.I suspect that something is missing or mis‐configured in the MX_XSPI1_Init() code, but I’m not sure what to look for next. Below is my XSPI1 initialization and the test routine I’m using:XSPI1 Initialization (generated by CubeMX)static void MX_XSPI1_Init(void){XSPIM_CfgTypeDef sXspiManagerCfg = {0};hxspi1.Instance = XSPI1;hxspi1.Init.FifoThresholdByte = 1;hxspi1.Init.MemoryMode = HAL_XSPI_SINGLE_MEM;hxspi1.Init.MemoryType = HAL_XSPI_MEMTYPE_APMEM;hxspi1.Init.MemorySize = HAL_XSPI_SIZE_64MB;hxspi1.Init.ChipSe
Hello,I got a stlm32 disco board. I cannot Flash.So,I used STM32 ST-LINK UTILITY. Any connection fail even under reset. This one show Target Voltage Detection Fail. The board is powered by the USB CN2 Connector. The measurment on the CN4 Connector shows 3,3 v between 1 and 3 pins.( which seems normal)Could this be a software issue ? Best regards,
I am using CAN on an STM32F042F6P6. I want to detect if an attached CAN transceiver is working or not. While there is no guarantee that there are other CAN nodes present on the bus, a 120 ohm termination resistor is always present. My original plan was to try transmitting something on the bus and checking for errors. If I only get an acknowledgement error, then the transceiver is probably OK. If I get a bit error, bit stuffing error or a bus off error, something is wrong with the transceiver. However, when I tried to put this in practice, I found that the STM was never throwing any errors. If I removed my transceiver and reattached it to simulate a failure, I found that although CAN transmission stopped, no errors were triggered and the hcan was stuck in HAL_CAN_STATE_LISTENING state. What could be going wrong here? All parameters except Automatic Retransmission have been disabled in the ioc file. Global interrupt for CAN has been enabled. Attached code for reference. #incl
I have a flex button. I have an image for released and an image for pressed.The released image contains a drop shadow. The released image does not, but has a transparent boundary so the dimensions match.I want the clickable area to be the button image excluding the shadow and transparent edge. I want to set this clickable area as a rectangle.How do I do this?
Hi,Could you please provide any document how motor drive parameters such as CORD_GAIN1, CORD_GAIN2 and other PI parameters are computed by workbench 6.4.0 ThanksRahul D
Hi, I would like to work with the security features of STM32H533RE microcontroller. For that,1.Do I need to enable anything or install any libraries files in order to work with it.2. If there is any example projects available?3. The path for Installation and documents .Please help me out.
In my project STM32WB55 uC is used and FW is generated by STM32CubeMX.Library (STM32Cube_FW_WB_V1.22.0) and BLE binary (stm32wb5x_BLE_Stack_full_fw.bin) are both version 1.20.My goal is to reboot only BLE stack on CPU2 without reset of CPU1.On community it is written in several places that aci_hal_stack_reset(or hci_reset?) can perform reset of the stack, but that it is necessary to do again full initialization of BLE stack: SHCI_C2_BLE_Init (or SHCI_C2_BLE_Reinit?), aci_gatt_init...I tried several ways to do that, but I was not successful. For example in debug some combinations of this functions works, but as soon I utilize Low Power mode, BLE will not start!Also I did not found any example code and/or exact procedure how to do that!Does someone know how exactly BLE reset is done and later reinitialized (documentation or source code)?
Hi,Our company need to make a I3C demo, so i'm studing I3C protocol with NUCLEO-H503RB and a generic IIC device.We know, I3C bus is compatible with IIC device. I meet a problem.when I2C master read 4 byte data from IIC device’ reg 0x10, IIC master produce ACK normally.when I3C master read 4 byte data from IIC device’ reg 0x10, I3C master don't produce ACK. Why? How to fix the problem.
I'm looking into a multi channel motor controller design centered around the STSPIN32 series MCUs.To reduce part count and layout space, I'd like to power multiple STSPIN32G0 MCUs off a single instance of the integrated 3.3V buck converter. Are there any suggestions beyond not connecting the unused SW outputs? Thanks
Hello,I am working on the STM32F103xx. I need to read out the 96 bit UDID (unique device ID) of the devices during production. Is there any way of reading this out from the serial bootloader on UART1 or through the SWD interface? I searched the AN3155 and AN2606 but could not find any details.I do not want to flash a temporary firmware just to read it out and then overwrite it again. Nontheless it no other solution is possible I guess its an ugly workaround. It needs to be automated. So using CubIDE is not possible. Thanks
I am experimenting with the function of reading a file by receiving a user command in the Nx_WebServer example of STM32H735G-DK. When connecting Stlink, input the t key in the Com port (115200 bps) that appears and press Enter to read the dashboard.html file. After performing this function, a fault occurs in tx_event_flags_get(&finish_flag, 0x01, TX_AND_CLEAR, &actual_flags, TX_WAIT_FOREVER); of console.c that is executed. This event flag is for communication between the UART receive interrupt and console_thread, and it works normally if filex io is not performed. Please help me figure out why this problem occurs after calling the filex API.
Hi,I made a custom PCB with a STM32WBA54CGU6 to act as a Bluetooth LE Audio transmitter. This was going to be first "real" PCB since before I have only made much simpler designs (I know I was very ambitious). For the HSE, I used this document to decide on the NX1612SA crystal oscillator. The problem I am facing is that I can't seem to get passed the SystemClock_Config() function call, more specifically, the HAL_RCC_OscConfig() function returns HAL_TIMEOUT in this part indicating that the HSE is not getting ready. /* Wait till HSE is ready */ while (READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U) { if ((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE) { return HAL_TIMEOUT; } } } I know I have to trim the clock using the registers on the STM32 but I was unable to find how the value in the register maps to a specific capacitance. This led me trying every single possible value (0-63) but that made no difference. I have already resoldered a new crysta
Hello,During a debugging session whenever I step through code it always takes be back and forward between my break point and the TIM6_DAC_IRQHandler which is the TIM I'm using as the time base. Now I can't disable the call back because then I don't have a time base, I tried that the MCU would not make it past the TIM INIT. It's not a critical problem, but an inconvenience since it prevents me from doing effective debugging. To my knowledge I have not changed any setting related to NVIC, TIMs, DACs or Systick (apart form the test which has been reverted) since GFX generated the MX file.Happy to provide any additional info required.Cheers,Michael
I'm trying to use the LPBAM feature on the STM32U5 to perform I2C communication during STOP2 mode.I followed the official STM32 LPBAM example and implemented my code accordingly.Here is what I'm attempting:Use LPTIM to generate a PWM signal during STOP2 mode.On each rising edge of the PWM signal, trigger an I2C transmit operation via LPBAM.The I2C communication is transmit-only (no receiving).I confirmed that the PWM signal is working correctly using an LED.However, the LCD connected via I2C does not display any data, as if the I2C transmission never occurs.What could be the possible reason why the I2C data is not transmitted even though the PWM trigger is working?/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All rights reserved. *
I'm trying to configure the LCD display using STM32CubeMX for the STM32H750B-DK.Under the Middleware and Software Packs, in X-CUBE-TOUCHGFX, under the TouchGFX Generator tab, I get a Dependency Error in red: Width/height values must equal LTDC Window width/height.I think I've selected the values properly to do that: 480 x 272 (right?), and adjusted for the other places these values go. The result of this error is the code generation emits the expected warning, and BlitOp.h/.cpp isn't produced, causing the build to fail.I've attached my ioc file as a zip file.I am stuck on this and don't see what to adjust. I am essentially trying to get a "Hello World" application to run, although I haven't actually modified anything except the Makefile so far (also attached).If I deselect TouchGFX, there are no warnings from the code generation step and the build completes.Thanks!Chris
Hi. I'm trying to get HPDMA to write to flash memory on the stm32n6570-dk board. I did the DMA configuration exactly like the XSPI_NOR_ReadWhileWrite_DTR example for the STM32H7. The problem is that all zeros are written and I've run out of ideas what's wrong. The memory is erased before writing. When I replace HAL_XSPI_Transmit_DMA() with HAL_XSPI_Transmit() the data is written. Maybe someone has an idea why all zeros are written? Artur
Hello! I am trying to trigger an ADC sample to write to DMA via a timer and trigger a green LED on PB0 after every sample so I can use an oscilloscope to verify the sampling speed. However, I believe after trying to debug as best I can, I do not have the correct configuration for the ADC or there is a problem with the DMA requests. I have included all of the user code that I have placed inside the main.c file at the bottom of this post. I have also included a photo of my ADC settings. I wasn't able to include it but I have enabled the NVIC interrupts by clicking the check boxes. I can successfully build and flash the code to the device, that is the code I shared. I do not get back any errors during building, its just the LED doesn't flash. I have ensured the LED is working by just placing a simple toggle code in the while statement and running that. #define BUFFER_SIZE 2 /* USER CODE BEGIN 2 */ HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET_LINEARITY, ADC_SINGLE_ENDED);
Hello! I'm trying to flash wireless stack into the STM32WB55 USB Dongle.I've successfully upgraded FUS to version 2.0.0.3.But now i cannot flash wireless binaries. Each time I try to do this, i'm getting the message, that image is downloaded, verified. Than that image found and authentic, but there's no space.ERROR: FUS_STATE_IMG_NO_SPACE.What am I doing wrong?My logs from CubeProgrammer are listed below... 19:56:30 : Old Firmware delete ...19:56:30 : Warning: Option Byte: nSWboot0, value: 0x0, was not modified.19:56:30 : Warning: Option Byte: nboot0, value: 0x1, was not modified.19:56:30 : Warning: Option Byte: nboot1, value: 0x1, was not modified.19:56:30 : Warning: Option Bytes are unchanged, Data won't be downloaded19:56:30 : Time elapsed during option Bytes configuration: 00:00:00.00019:56:30 : Succeeded to set nSWboot0=0 nboot1=1 nboot0=119:56:30 : Memory Programming ...19:56:30 : Opening and parsing file: 0x495_FUS_Operator.bin19:56:30 : File : 0x495_FUS_Operator.bin19
Hi, Is ST proved an example of USB CDC-ECM for H563 or something similar I can use for doing a connection between my pc and my nucleo H563 with USB?
Hi, I'm wondering if there are any recommendations/guidelines when trying to measure power consumption on the Nucleo-N657X0-Q when running a neural network model, both with NPU acceleration and without on the CPU for comparison. I have access to both a X-Nucleo-LPM01A power shield and a STLINK-V3PWR and do not know which one to choose. Are both options rated for enough power to measure the board? And does any of the two options require removing components, as the board is borrowed so I would prefer a non-invasive solution. Thanks in advance!
I've requirement of reading 100 samples of ADC data using DMA whenever it's needed in regular mode and I see the read buffer is not having right values and also HAL_ADC_ConvCpltCallback is not hitting.But same if I try just with one sample data is proper and HAL_ADC_ConvCpltCallback is hitting but when I retrigger ADC_DMA_READ I see HAL_BUSY.I'm using NUCLEO-545REQ board /*GLOBAL VARIABLE*/ #define ADC_CONVERTED_DATA_BUFFER_SIZE ((uint32_t) 100) /* Size of array aADCxConvertedData[] */ /* Variable containing ADC conversions data */ uint32_t aADCxConvertedData[ADC_CONVERTED_DATA_BUFFER_SIZE]; int isADCFinished = 0; #define VDDA_APPLI (3300UL) uint16_t uhADCxConvertedData_Voltage_mVolt = 0; /* Value of voltage calculated from ADC conversion data (unit: mV) */ /* Init variable out of expected ADC conversion data range */ #define VAR_CONVERTED_DATA_INIT_VALUE (__LL_ADC_DIGITAL_SCALE(ADC1, LL_ADC_RESOLUTION_14B) + 1) /********************************************************************
Hello, Is there any example code available for Multichannel ADC1 in regular DMA mode for NUCLEO545REQ board.
Hello, I am working on adding an IWDG to firmware on a STM32F070CBT6TR. The Watchdog resets perfectly fine. I cause the watchdog to reset the MCU by not resetting the timer. I then try to read the RCC_FLAG_IWDGRST and it is always 0. This is what my main looks like before trying to read the flag.bool g_wd_caused_reset = false; int main(void) { // MCU Configuration---------------------------------------------------------- NVIC_SetVectorTable(); // Reset vecter table __HAL_REMAPMEMORY_SRAM(); // Remap boot address to SRAM /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) { g_wd_caused_reset = true; } ... ... } My expectation is that RCC_FLAG_IWDGRST would read 1 after the watchdog causes a reset, but I never see g_wd_caused_reset == true. My IWDG is configured to reset after ~26 seconds. Any help is
can anyone please share the older version 1.3.1 of the i-cube-lrwan package
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.