Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Greetings, I am using a Discovery Kit (B-U585I-IOT02A) and I want to use the LPTIM1 to wait 5 seconds (counting x ticks), at the end of the 5 seconds enter in a Callback to do something and then restart the counter again.I want to use as clock source the 32.768Khz crystal (LSE). So, I configured the LSE clock in the RCC section of the .ioc, then I set the LSE as clock source for LPTIM1, and activated the interrupts. At the main function, I used the HAL_LPTIM_TimeOut_Start_IT(&hlptim1, 16383) and used the void HAL_LPTIM_AutoReloadMatchCallback (LPTIM_HandleTypeDef* hlptim) callback to do something. The callback is not being called, I measured the signal at the crystal, and I can't see any clock in it. I guess something's missing in the configuration but I have no clue what it is and I can't make it work. An helping hand would be appreciated.
We are using the STM32U575RIT6 device and performed a RX/TX swap on LPUART1, ports PC0 and PC1. When we enabled the Swap TX is properly transmitting out of PC0. But we are unable to read anything on the new RX pin PC1. Other than enabling the pin swapping what else would need to be changed? Are there any known issues with the SM32u5 pin swapping?
Hello colleagues,Hope you may help me in one issue I'm facing w/. What I have in hands:STM32F407 discovery kitWaveShare LAN8720 ETH board is connected to discoverySTM32CubeIDE. Version: 1.18.1. Build: 24813_20250409_2138 (UTC) Simple LWIP projectint main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_LWIP_Init(); MX_RTC_Init(); MX_USB_DEVICE_Init(); MX_CAN1_Init(); MX_SPI2_Init(); MX_I2C1_Init(); MX_SDIO_SD_Init(); MX_USART6_UART_Init(); MX_USART1_UART_Init(); MX_USART2_UART_Init(); MX_USART3_UART_Init(); MX_DAC_Init(); MX_FATFS_Init(); /* USER
Hello,With freertos cmsis_os2 osTimerStop() returns osErrorResource despite timer is running and trigs the callback after the correct time.Is there a known bug?How a timer returning pdFALSE at test xTimerIsTimerActive (hTimer) can trig a callback???How can I stop the timer otherwise?Best regardsMich
Good Day, Recently I started working with a new MCU (STM32L152). I ported some UART code to handle received data from a different MCU, which worked fine. But as soon as I started testing edge cases I saw some weird things happen. I am using the DMA on the receive, and I rely on the Idle interrupt to send data to a different buffer for processing. It seemed like the Idle interrupt would trigger correctly for the following:- data length < half buffer length - data length = half buffer length - half buffer length < data length < full buffer length - full buffer length < data length But it does not trigger for: - data length = full buffer lengthIt turns out in HAL_UART_IRQHandler (in stm32l1xx_hal_uart.c) there is a missing piece of code that enables this to happen. This code existed in the previous MCU's UART driver. I checked that I had the newest library downloaded for STM32L152. The piece of missing code is attached. /* * NOTE: This else was manually put
Hi,I am implementing RS-485 communication on the STM32G491. Based on available references, I’m currently using a custom GPIO pin for the DE (Driver Enable) signal, since the default USART1_DE pin is already allocated for another function. In the RS-485 initialization API, there are three parameters: DE polarity, assertion time, and de-assertion time. Do these parameters have any effect when a regular GPIO is used instead of the hardware-controlled DE pin?I am using the below configuration for init.huart1.Instance = USART1; huart1.Init.BaudRate = 115200; huart1.Init.WordLength = UART_WORDLENGTH_8B; huart1.Init.StopBits = UART_STOPBITS_1; huart1.Init.Parity = UART_PARITY_NONE; huart1.Init.Mode = UART_MODE_TX_RX; huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart1.Init.OverSampling = UART_OVERSAMPLING_16; huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1; huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_MSBFIRST_INIT; huart1.Adv
Two of my MCUs are halting in same problem after running for about a year. There have not been many writes/cycles as I have a erase cycle counter which shows 27 so its not wear out problem. The EE_Init function gets stuck at step 4 and returns with EE_WRITE_ERROR. Here is the page situation. I use page 2 and 3 of second bank. Page 2 is in state RECEIVE (aaaa, ffff, ffff, ffff), the page is otherwise empty. Page 3 is in state ERASING (aaaa, aaaa, ffff, aaaa) and the page is full with data. The problem is already found in step 3 (pagestate = STATE_CORRUPTED), where it checks that page 2 is RECEIVE but page 3 is not ERASED. The code however does not do anything about it. It only deals with the case if (pagestate = STATE_RELIABLE). Recovery transfer occurs in step 3 only for reliable page state . Therfore in step 4, there is no active page, no valid page and finally the function exits with EE_WRITE_ERRORHere are the contents of page 2 starting at 0x08041000:Here are the co
Our product requires FIPS certification, and the chip is stm32u595. I found that the stm32 cortex-m33 core already has a library certified by the CAVP algorithm, but the version of the STM32CubeExpansion_Crypto-V4.2.0 library does not match the certified version. Where can I download the certified version 4.0.0 build1 ?Because the client and FIPS certification require code review, can you provide the source code? Cryptographic Algorithm Validation Program | CSRC Data brief - X-CUBE-CRYPTOLIB - STM32 cryptographic library software expansion for STM32Cube
I want to write data to an external flash (w25q128 with SPI) by sending a hex file from a PC to the STM32 over UART using tools such as Realterm or a python scriptI have seen examples using the external loader with STM32CubeProgrammer, but I want to avoid doing it this way and just use UART. The reason being is that for production I want the user to be able to simply flash new data without the need for ST programming hardware and software tools. Are the any examples or can anyone help me achieve this ?I am using the NUCLEO-L433RC-P board with the w25qxx driver....https://stm32world.com/wiki/STM32_W25Qxx
Hi team,We are working on the custom bootloader on stm32u073RC. not able to jump on the specific location.#define APPLICATION_PARTITION_1 0x0801D000 void jump_to_application_partition_1(void) { /* Disable Interrupts */ __disable_irq(); /* Get the stack pointer and reset vector from the backup application section */ uint32_t app_stack_pointer_1 = *(volatile uint32_t *) APPLICATION_PARTITION_1; uint32_t app_reset_vector_1 = *(volatile uint32_t *) (APPLICATION_PARTITION_1 + 4); /* Mapping of the backup application reset vector */ pfunction app_entry_1 = (pfunction) app_reset_vector_1; /* Setting of the vector table to backup application */ SCB->VTOR = APPLICATION_PARTITION_1; /* Setting MSP - (Main Stack Pointer) */ __set_MSP(app_stack_pointer_1); /* Enable Interrupts */ __enable_irq(); /* Jump to backup application */ app_entry_1(); } Thanks,Shubham
I am trying to add the NUCLEO-N657X0-Q (MB194-N657X0Q-C01) to the IMBootloader project, which currently uses the Legacy Classic USB device middleware. I ran into a problem where, after calling the HAL_PCD_Start() function, I receive an unexpected interrupt. If I comment out the line USBx_DEVICE->DCTL &= ~USB_OTG_DCTL_SDIS; the issue no longer occurs.Exact position of line in the code:https://github.com/IMProject/IMBootloader/blob/add_nucleo-stm32n657x-q/Drivers/STM32N6xx_HAL_Driver/Src/stm32n6xx_ll_usb.c#L1152The full code is available in this branch:https://github.com/IMProject/IMBootloader/tree/add_nucleo-stm32n657x-q It can be built with a simple command: make nucleo_n657x0_q_ram Also attaching a video showing how the issue occurs. Any pointers to help save time would be appreciated. Thanks in advance!
Hello,I followed https://community.st.com/t5/stm32-mcus/how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/49308 tutorial from the scratch to the end, including the Hello UDP part, and adding the "ETH CODE" code.However, I can't ping my board. After some debug, I found that I am locked in HAL_MspInit. I tried this on 2 eval boards, with same results. I do not have further ideas to try.Please find attached my projects.Also, I wanted to know if FreeRTOS is mandatory for a project using Ethernet ? If somebody have a "plug and play" project for STM32H757, I would be happy to try it out.Thank you very much,Matteo
Kindly confirm whether STM32H723VGT6 supports Zephyr using the NUCLEO-H723ZG evaluation board.
Hi,I’m using the STM32U5G9J-DK1 board and working on implementing a FileX-based filesystem on the onboard eMMC. On the first run, I format the eMMC using fx_media_format(), open the media, create a file (e.g., file1.txt), write data to it, and read it back — all of which works correctly. However, in the second run, I flash new firmware that skips the formatting step and attempts to open and read from file1.txt. In this case, although the media opens successfully and checks for the file’s existence, it returns FX_ALREADY_CREATED, but trying to open the file results in an FX_FILE_CORRUPT error.If I do only the formatting in the first run and perform the file creation and access in the second run, everything works fine.I’m unsure why the file becomes unreadable across firmware flashes unless the file is created again after formatting. Thanks!
I am using this example to read data from an external flash (W25Q128) using SPI on a NUCLEO-L433RC-P board...https://stm32world.com/wiki/STM32_W25QxxThe code is here...https://github.com/lbthomsen/stm32-w25qxxHow do I modify this example to use SPI with DMA ?The end result is to read a WAV file from the external flash and play it using the internal DAC.I have enabled DMA for SPI... But don't know what other modifications I need to make.In w25qxx.c, I tried changing...if (HAL_SPI_Receive(w25qxx->spiHandle, buf, len, HAL_MAX_DELAY) == HAL_OK) {to...if (HAL_SPI_Receive_DMA(w25qxx->spiHandle, buf, len) == HAL_OK) {but when I step through the code it jumps to the HardFault_Handler.I will need to use double DMA buffers, so that the DAC reads from one buffer whilst the external flash writes to the other buffer (for glitchless playback)
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.
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
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);
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 all I am trying to run ethernet stack along with freertos using TcpServer,so the issue what I am facing is I am not able to ping my board via hercules. I have checked all the configuration and register MAC MMC DMA is fine and even my three tasks 1ms 5ms 10ms are working fine .I am running systick timer for freertos and TIM2 for HAL delay. and timer also working fine . I have checked plenty of times there is no issue with initialisation process as per my knowledge could you please help me. NOTE: So I have few doubts related to ethernet first who will validate or where I will receive the incoming data or something when I try to first do hand shake by connect with the port from hercules. Second doubt is there any buffer where I can see received information when connection is attempted via hercules. so that I can atleast know whether my phy or MAC or DMA or TCP stack is not correctly working. I am looking forward for your response like you helped me in previous queries I raised before.
I have STM32F4, using ADC3 for injected conversions. Driver code is generated using the latest CubeMX. I have 4 channels in group and was using LL_ADC_INJ_ReadConversionData12(ADC3, ADC_INJECTED_RANK_1) for reading (where rank was from 1 to 4). But the values that I got back were all exactly the same and consistent with expected value on the first channel. Accessing ADC3->JDR1 to JDR4 gives correct results. If I understand LL_ADC_INJ_ReadConversionData12 correctly, then this is a bug. volatile uint32_t jsqr = ADC3->JSQR; volatile uint32_t j1 = ADC3->JDR1; volatile uint32_t j2 = ADC3->JDR2; volatile uint32_t j3 = ADC3->JDR3; volatile uint32_t j4 = ADC3->JDR4; volatile uint16_t h1 = LL_ADC_INJ_ReadConversionData12(ADC3, ADC_INJECTED_RANK_1); volatile uint16_t h2 = LL_ADC_INJ_ReadConversionData12(ADC3, ADC_INJECTED_RANK_2); volatile uint16_t h3 = LL_ADC_INJ_ReadConversionData12(ADC3, ADC_INJECTED_RANK_3); volatile uint16_t h4 = LL_ADC_INJ_ReadConve
Hello, I am developing STM audio streaming device by nucleo-H753ZI. Just I have done is bellow like:1. configure HSE by Cube MX and applied 25 MHz external oscillator physically .- It works well when USB OTG FS mode.2. Physically connected between H753ZI and USB3300 ULPI (D0~D7, 3.3Vs, GNDs, NXT, DIR, RST, STP, CLK)D0->PA3,D1->PB0,D2-> PB1,D3->PB10,D4->PB11,D5->PB12,D6->PB13,D7->PB5,STP->PC0,NXT->PC3,DIR->PC2,CLK->PA5,2 of 3.3V pins,2 of GND pins 3. Checked Cube MX options : - USB OTG FS : Disabled- USB OTG HS - Device only- USB Device - (Class for HS IP) Audio Device Class, 48000 sample/s, Device descriptor : 1200- NVIC : priority USB OTG global interrupt = 0 USB OTG EndPoint I/O global interrupt = 04. Connected to PC as USB : No device detected on PC!( I have edit MX_USB_DEVICE_Init(void) function for debugging : /* USER CODE BEGIN USB_DEVICE_Init_PostTre
Hi!I want to build a project for STM32U575. I want to use FreeRTOS, but it seems like there are some functions that won't work with it (like the SD). Is there any place where I can see what works or doesn't with each one? Or if I can use FreeRTOS anyways and still use the SD? Thanks
Hello, I am trying to flash a STM32G0B0CET6 and keep getting "Error: No STM32 target found!" When trying to connect. Through the power supply I can see that the device properly resets. The voltage target also goes to 0 when the device turns off. I am using an ST-Link V2 with a Tag-connect TC2050-ARM2010 and TC2050-IDC cable to program.
Occasionally after several hours our USBD CDC will get stuck in a state where "CDC_Transmit_FS" always returns "USBD_BUSY" due to the "TxState" flag never being cleared. During this time the USB IRQ "HAL_PCD_IRQHandler" is never called even though IRQs are still enabled. I am using "STM32Cube FW_F4 V1.25.2" but have tried copying "STM32Cube FW_F4 V1.28.2" with no luck. MCU is STM32F405RGT6. The only remedy is to reset USB by calling HAL_PCD_DeInit & HAL_PCD_Stop, then reinitializing with HAL_PCD_Init, USBD_Start, and MX_USB_DEVICE_Init. This issue can be recreated by attaching a UART (non-USB) to the board which seems to provide additional 5V power potentially causing a disturbance in the USB. Doing so recreates the issue fairly quickly, however this can also happen without UART attached after several hours. I also noticed that I can get into this state if I call CDC_Transmit_FS multiple times and bypass the "TxState" flag, eff
ST Community highlights – April to June 2026
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.