Join discussions in the Product Forums. Ask questions, learn from your peers, and share insights on ST solutions to accelerate your design journey.
Most recent activity
I am using stm32f407 and stm32wb series for sending the data usimg uart.first i send th data using the stm32wb uart to the stm32f407 uart the data is correctly sent.After receiving the data i will return the data back to the stm32wb from the stm32f407 but this time the data is corrupted.I am using the hal_uart_receiveto_idle and hal_uart_transmit_it to send and receive the data. I will share the code please review and tell me if i need to make any changes.
#ifdef HWVR_AC_CG_NOV25 #include "lpuart.h" #include "main.h" UART_HandleTypeDef hlpuart1; DMA_HandleTypeDef hdma_lpuart1_rx; DMA_HandleTypeDef hdma_lpuart1_tx; #define LPUART_RX_BUF_SIZE (uint8_t)1 static volatile uint8_t lpuart_rx_buffer[LPUART_RX_BUF_SIZE]; // Buffer for DMA reception #define LPUART_TX_BUF_SIZE (uint8_t)64 static volatile uint8_t lpuart_tx_string[LPUART_TX_BUF_SIZE]; static uint8_t lpuart_tx_string_size = 0; // Size of the lpuart_tx_string buffer #define LPUART_FLAG_RX_COMPLETE ((uint8_t)((uint8_t)1U<<(uint8_t)0U)) #define LPUART_FLAG_READY_TO_SEND ((uint8_t)((uint8_t)1U<<(uint8_t)1U)) #define LPUART_FLAG_TX_ONGOING ((uint8_t)((uint8_t)1U<<(uint8_t)2U)) static volatile uint8_t lpuart_flag = 0; void_const_uint8_t_p_callback_t lpuart_fill_callback = NULL; // Callback for the loop function void_void_callback_t lpuart_loop_callback = NULL; // Callback for the loop function static volatile uint32_t last_timestamp = 0; void HAL_UART_RxCp
After updating the STM32CubeG4 Firmware Package from version 1.6.1 to 1.6.2, I discovered a bug that causes incorrect deadtime prescaler settings for HRTIM when using the LL driver and CubeMX. As a result, the deadtime value can change to a fraction of the original value without anyone noticing, which can lead to hardware damage.If I set in STM32CubeMX 6.17.0:HRTIM -> Timer x -> Dead Time -> Prescaler = "fDTG = fHRTIM * 2"The generated code contains:LL_HRTIM_DT_SetPrescaler(HRTIM1, LL_HRTIM_TIMER_x, LL_HRTIM_DT_PRESCALER_MUL2);LL_HRTIM_DT_PRESCALER_MUL2 is defined as HRTIM_DTR_DTPRSC_2 -> Register HRTIM_DTxR DTPRSC[2:0] = 0x4This results in the deadtime value:t_DTG = 2^4 * (t_HRTIM / 8) = 2 * t_HRTIM = fHRTIM / 2So instead of "fHRTIM * 2" I get "fHRTIM / 2"!I think the confusion comes from the fact that in CubeMX the prescaler is set as a multiple of the frequency, but in the datasheet and driver the multiple of the period is described.Before the driver update, there was an
I tried in use Nx_WebServer factory example written for STM32N6570-DK board. Finally I compiled (without error) and run the project but nothing (except single step) worked.It never got IP address from DHCP.The Green LED is not blinking.With static IP address it does not answer for ping command.The board does not appear in arp -a list.The breakpoint set inside of ETH1_IRQHandler is never hit.The green and yellow LEDS of RJN45 are not blinkingThe code is running inside the app_thread and wating for events.What did I wrong?Louis
After a recent update I am unable to run my code from vscode on my Windows 11 machine. The compilation succeed, but when I click on Run -> Start Debugging nothing happens. The System Bundle Manager shows that I have installed all the latest versions, but the bundle manager of the projects shows only a few of those bundles (see attached). How can I install the bundles in the project section?Note that I have already tried the usual things: remove the build, .vscode and .settings folders, rebooting the pc, upgrading the stlink firmware.I tested the same code on another linux pc and there it works as expected. On the linux PC `stlink-gdbserver` was installed at project level
Hello,I have a question about the distance values returned by the VL53L8CX across the 16 cells in 4*4 mode.I performed repeated measurement with my sensor facing the ground, both with and without a glass cover.I noticed significant discrepancies between the distance values of the different cells, even though the target is a flat ground plane.By repeating the measurements and plotting the 16 cell distances as bar graphs, I observed a consistent pattern.Graphs 1 and 2 were taken consecutively at 30 Hz.Graph 3 was taken with the sensor farther from the ground, while still facing it. From this pattern, it seems clear that the sensor was not perfectly parallel to the ground plane during the measurements. However, I am surprised by the magnitude of the difference between the highest and lowest cells. I have read in several posts that the VL53L8CX may return the perpendicular distance to the target plane rather than the radial distance along each cell’s line of sight. I would l
I found an ADC regression on `STM32H563RG` after upgrading from `STM32Cube FW_H5 v1.5.1` to `v1.6.0`.Setup:- MCU: `STM32H563RG`- Old package: `STM32Cube FW_H5 v1.5.1`- New package: `STM32Cube FW_H5 v1.6.0`- CubeMX: `6.17.0`Symptom:- I sample multiple external channels on `ADC2`, including `ADC2_INP0`.- Before the upgrade, `ADC2_INP0` measured correctly.- After the upgrade, `ADC2_INP0` no longer reflects the actual GPIO input voltage, while the other ADC2 channels still behave correctly.This is not a sampling-time or rank-order issue. The problem follows `ADC2_INP0` specifically.The regression appears to come from a change in the LL helper for Channel 0 GPIO switch control.In older FW_H5 code, `LL_ADC_EnableChannel0_GPIO()` always set `ADC1->OR.OP0`, regardless of the ADC instance passed in.In FW_H5 v1.6.0, that helper was changed to set `ADCx->OR.OP0` instead. On STM32H563, that breaks `ADC2_INP0`.What fixes the problem in my testing is:- still enabling Channel 0 GPIO switch cont
I am using Powerstep01 for stepmotor driving , comminucate with stm32H743 via SPI , and using x-cube-spn3's firmware for testing (IHM03A1_ExampleFor1Motor), but after initial function running , motor can not run. and after reset the power , powerstep01 is alway burned out . below is the schematic , Does someone could help to check what's the issue ? (VS=24V , VCC=3.3V)
I am generating an AI project from scratch in STM32Cube AI studio with the help of generating C-code for IDE and adding these generated middlewares, AI and generated folders to my pre-existing project in STM32 IDE. I am getting an error which I am unable to resolve. I am attaching it below.
Hi, I'm working on an stm32U0 with Makefile generated by CubeMX v6.17.0. The code has been built with: arm-none-eabi-gcc (Arm GNU Toolchain 14.3.Rel1 (Build arm-14.174)) 14.3.1 20250623 on a GNU/Linux machine. When I appended the -flto switch to the ASFLAGS, CFLAGS and LDFLAGS variables in the Makefile, this triggered a warning: lto-wrapper: warning: Options to '-Xassembler' do not match: -alms=/tmp/app/release/main.lst, -alms=/tmp/app/release/gpio.lst, dropping all '-Xassembler' and '-Wa' options. The .elf file was generating and it seems to be working. The code built with flag -O2. I wouldn't want this warning to lead to unexpected errors. Does anyone have experience with LTO and can tell me if it's a good idea to use it? I can't figure out if GCC bug. Many thanks.
I'd like to use a general purpose timer to continuously trigger a rtc timestamp (using H533)Is it possible ?How to map TRGO signal to Timestamp trigger ?(No HAL please, LL or direct register setup).Thanks in advance.
Working with a NUCLEO-L552ZE-Q development board. Requirement is to interface this board to another larger board where all the pinouts on unpopulated footprints for CN11 and CN12 ( the "Morpho" connectors ) can be brought out. Therefore, the posts that stick out the bottom of the board must all match up in height. The Nucleo PCB design files have listed the populated connectors CN7,CN8,CN9,CN10 on this board as CON_SAMTEC_SSW-110-23-X-D_N144_ARD ( pin counts varying of course )With an accurate digital caliper, I measured the posts that stick out of the bottom of this board measure 9.1mm long, taking the thickness of the PCB into consideration.I bought this part ( SSW-110-23-G-D ) from Samtec and saw the post length and post geometry is NOT the same as what is on the board already populated. I measured the posts on this part number. The posts on this specified part number are 10mm long, and also much wi
hi guys , I have been working on a stm32 project like a digital automotive cluster using STM32H7A3ViT6 MCU . I am using the LTDC module to drive the display . now the problem is the mcu dosent run the code on powerup but it ll do when i press the reset button . i have been debugging it for a long time but couldnt find why this happening to this . now since it is automotive the input voltage is at 12v so itll be converted to 5V 5A using a buck converter and then to 3.3 using a LDO , thats how i power my MCU . now the reset circuit and today i removed the capacitor from the circuit and in some boards the issue is solved . and in some boards i removed the whole reset circuit but still no hope in that . mcu has 100nf decoupling capacitors on vcc pins and 2.2uf capacitors in vcap pins . now when i check the vcore voltage i gets 1.08v but after the reset button is pressed i get 1.8 as expected . . i also tried to power the mcu only w
im having trouble displaying my own bitmap what converter should i use to convert a bmp file to array to work with this function
Hi all, I need to use TIM1 CH1 (PK1) as an input-capture pin for a speed sensor in my TouchGFX project. So, I generated the project from TouchGFX and opened the .ioc in CubeIDE, enabled TIM1 for CM7 and set channel1 (PK1). The display does not start correctly (black or freezes) after I debugged it. When I halt the CPU, the call stack shows it is stuck in MT48LC4M32B2_Delay, MX_FMC_Init() and entered bspsdram error handler. I indicated that the generated project uses tim6 for sys_m7 timebase source but I can't use TIM1 right now and don't know what to do.
Hi Team,I’m prototyping on a Nucleo-F303RE using STM32CubeIDE. In the clock configuration, I set the system clock to 36 MHz from HSI (HSI → PLL with the /2 divider), as shown in the clock tree screenshot. However, my firmware misbehaved. After debugging, I found that SystemClock_Config() function isn’t applying the HSI/2 divider when feeding the PLL. Instead of: RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;CubeIDE generates: RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI_DIV2; This effectively makes the system clock 72 MHz instead of the configured 36 MHz.Did I misconfigure something in the clock setup, or is this a CubeIDE code-generation bug when using HSI with the PLL /2 divider?
After upgrading STM32CubeIDE for Visual Studio Code to version 3.8.0, the code formatting function is no longer available. Currently, while writing the code and entering ";", the formatting feature is not functioning. When saving the code, the code will not be automatically formatted; both "Format on Save" and "Format On Type" in the settings have been checked.
Hello,I would like to build up an USB-CDC communication which gets the commands from the PC and forwards the messages to CAN. I have choosen a Nucleo-G431RB-C04 board, which have a FDCAN and a USB-FullSpeed inteface also. Do I able to create an USB-CDC for the mentioned board? I have read several different information of the USB interfaces on the Nucleo boards, and I would like to be sure before I will buy the mentioned card.If not, please recommend for me concrete Nucleo board type for this task.Thanks.
Hi, EveryoneI am trying to setup STM32H7R7Z8 XSPI2 in Quad mode for APS6404L-3SQR QSPI PSRAM.The original code is generated from MX v6.116.1 and developed with IDE v2.0.0.HW info:The PSRAM is connected to XSPI2 with NCS, CLK, IO0~3. There is no DQS pin (PSRAM does not support it).The XSPI2 is setup in 133MHz frequency PSRAM supported.APS6404L-3SQR: 133MHz for 32 Bytes Wrapped Burst, 64Mb, 8M x 8bits, pagesize 1024 bytes,SW configuration:/* XSPI2 parameter configuration */ hxspi2.Instance = XSPI2; hxspi2.Init.FifoThresholdByte = 4; hxspi2.Init.MemoryMode = HAL_XSPI_SINGLE_MEM; hxspi2.Init.MemoryType = HAL_XSPI_MEMTYPE_APMEM_16BITS; hxspi2.Init.MemorySize = HAL_XSPI_SIZE_64MB; hxspi2.Init.ChipSelectHighTimeCycle = 2; hxspi2.Init.FreeRunningClock = HAL_XSPI_FREERUNCLK_DISABLE; hxspi2.Init.ClockMode = HAL_XSPI_CLOCK_MODE_0; hxspi2.Init.WrapSize = HAL_XSPI_WRAP_32_BYTES; hxspi2.Init.ClockPrescaler = 0; hxspi2.Init.SampleShifting = HAL_XSPI_SAMPLE_SHIFT_HALFCYCLE; hxspi2.Init.Chi
Following the guide for the Developer Package, it describes creating a helper script for your custom board. Thhat works great and helps get you going. So, I generated a STM32CubeMX project and built it. Device Tree files are generated accordingly. STM32CubeMX gives them names of the format <device>-<stm32cubemx proj name>-mx. These names cannot be changed as the dts files include each other.The helper script lets you set names for all these files e.g.# Name of devicetree to use # Optee dt name optee_dt_name=$your_board_name optee_dt_programmer_name=$your_board_name # U-boot dt name uboot_defconfig=${your_soc_name}_defconfig uboot_dt_name=$your_board_name uboot_programmer_dt_name=$your_board_name # TF-A dt name tfa_dt_name=$your_board_name tfa_dt_programmer_name=$your_board_name # Linux kernel dt name # linux linux_dtb_name=$your_board_nameBy default, these do not match the names generated by stm32cubemx. Even if I change the entries to mat
Hi STM32Community,i am currently trying to build openSTLinux using the STM32CubeMX (6.17.0) generated device tree files with the yocto build process.For this I am using the STM32MPU Distribution Package. (stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18)I set up the Distribution Package according your Wiki Installing_the_OpenSTLinux_distribution and I have set up the STM32CubeMX Project according How_to_create_your_own_machine :I created the STM32CubeMX project directory "mx" /layers/meta-st/meta-st-stm32mp-addons and generated the project filesI created a new machine config file under /layers/meta-st/meta-st-stm32mp-addons/conf/machine, using the example stm32mp25-mx.conf as a template.I created the symlink for the EULAI modified the cubemx class accordingly under <STM32MP BSP layer addons>/classes/cubemx-stm32mp.bbclass and started the build process withsource layers/meta-st/scripts/envsetup.shbitbake st-image-core The buildprocess runs fine until it t
Hi,MCU - STM32H7 familyMCU package: FW_H7 V1.11.2FreeRTOSEnable Multi-threaded support -> Thread-safe locking strategy "FreeRTOS strategy #4 - Allow lock usage from interrupts"the issue:When I'm writing a file in Flash, I reach the main.c::void Error_Handler(void) while loop. in the stack, I see that the last steps was in newlib_lock_glue.c:void Error_Handler(void)static inline void stm32_lock_acquire(LockingData_t *lock)void __retarget_lock_acquire_recursive(_LOCK_T lock)__fflush_r()_swbuf_r()_putc_r()_fputc_r()After investigation I see that the Error_Handler reached because the lock object reached is limit 2.The lock LockingData_t struct defined in ST file stm32_lock.h (line 255):#define STM32_LOCK_MAX_NESTED_LEVELS 2 /**< Max nesting level of interrupts */typedef struct{uint32_t basepri[STM32_LOCK_MAX_NESTED_LEVELS];uint8_t nesting_level;} LockingData_t;When I'm set the STM32_LOCK_MAX_NESTED_LEVELS to 5, problem solved and I succeed to write the file.But i set it man
Following the tutorial here, when I get to the step "To generate binary to flashing via Cortex-A", the helper script fails to build when given the 'programmer' argument. The problem appears to be incorrect configuration of the path to a device tree file. All other steps in the tutorial build correctly using the device tree files given, just not the programmer step fails.The output is shown below. In it you can see the following paths are supplied:EXTDT_DIR=/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp2-openstlinux-26.02.18/sources/STM32MP215DK-AshMX EXTDT_DIR_OPTEE=CA35/DeviceTree/STM32MP215DK-AshMX/optee-osThe correct path to the dts file is ${EXT_DIR}/${EXTDIR_DIR_OPTEE}, but the path actually searched for the dts file is (refer line 58 in the log below):/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp2-openstlinux-26.02.18/sources/STM32MP215DK-AshMX/stm32mp2/a35-td/optee/Full log is:sdk_compilation-stm32mp2-mx-my-custom-board
HI ALL.I am using MB1549C board with NUCLEO-U5A5ZJ-Q cpu.SD card is connected to SDMMC1 pins 4bit mode.HAL code is generated with CUBE MX.During SD card initialization CMD8 command is sent.I see that after it sent some flags are set which relates to DPSM.But CMD8 does not require data transfer on D0 pin.So DPSM must not be enabled. But I see these flags in STAR register.BUSYD0,DPSMACT,DTIMEOUT.Response is received correctly but why DPSM is enabled and of course timeout error occur becausethere is no and should not be data on D0?Thanks
Hi all,I'm having an issue with a pre-existing project. It was initially built a few months ago on version 1.16 of the IDE, and confirmed to be working. I have since updated to stm32cube ide version 2.1, and am having an issue with this project not being able to launch. The projects builds with zero warnings or errors as expected, but on trying to flash my board I get "Unable to launch. the selection cannot be launched, and there are no recent launches". One change I made (that I'm not sure if it is relevant) is updating the GCC flags to inlcude "-Wno-implicit-function-declaration", as it was having trouble finding a C wrapped extern method. I have seen a previous thread that resolved this issue by using the example importer (Solved: Unable to launch, The selection cannot be launced ... - STMicroelectronics Community), but I want to avoid that to prevent any unintended changed to the current project structure. Additionally, unless I have a m
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.