Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I am running the FLASH_EraseProgram example code provided by STM32CubeU3. the code fails in erasing the flash and enters ErrorHandler. I have verified the FLASH_USER_START_ADDR & FLASH_USER_END_ADDR. it is set as follows. #define FLASH_USER_START_ADDR ADDR_FLASH_PAGE_128 /* Start @ of user Flash area */#define FLASH_USER_END_ADDR (ADDR_FLASH_PAGE_255 + FLASH_PAGE_SIZE - 1) /* End @ of user Flash area */I have tested in both debug and run mode, it is not working as expected. Is anything to be modified to run the code. regards,Rajath
Hi, I am currently working on a project where I want to adjust the duty cycle and trigger an ADC measurement on every counter rollover. I managed to get the PWM running in center-aligned mode, but I’m having trouble triggering the counter rollover at the correct moment. To verify whether the trigger is correct, I routed the output compare signal to an external pin and observed it on an oscilloscope. The basic idea is to run an additional counter alongside the PWM. This counter should count up to ARR and then generate a trigger that starts the ADC conversion. Becuase in the center aligned mode two update event occurs both on CNT=0 and CNT=ARR. On the oscilloscope, it looks like the trigger—presumably when CNT = 0 (at least that’s my assumption)—produces an edge. Im using NUCLEO-G491RE. What could I be missing here? What might be causing this behavior? Yellow (PWM TIM8 Channel3), Blue (PWM TIM8 Channel1), Orange (Capture Compare TIM8 Channel 4) Thank you in advance!
I think this is a very similar (perhaps the same) problem as described here. I replied to that thread but was asked to start a new thread - here it is. I'm reposting because I didn't feel the prior thread has a satisfactory answer (de-initialize and re-initialize the UART). HAL_UARTEx_ReceiveToIdle_DMA() seems to be intrinsically a very fragile function. If I call `HAL_UARTEx_ReceiveToIdle_DMA()` when the UART receive line is actively receiving data (when the other end is transmitting). A good percentage of the time it returns HAL_ERROR.I'm using STM32L4 HAL 1.13.6 (Cube 1.18.2).The problem is that the UART generates an overrun error immediately when `UART_Start_Receive_DMA()` enables the overrun error. The overrun error overwrites `huart->ReceptionType = HAL_UART_RECEPTION_STANDARD` which causes `HAL_UARTEx_ReceiveToIdle_DMA()` to return HAL_ERROR as shown in the code snippet from `HAL_UARTEx_ReceiveToIdle_DMA()` below: /* Set Reception type to
I am trying to use the microSD card on the STM32H753I-EVAL2 board with ThreadX and FileX.I generated the base project using CubeMX with the following configuration:Board: STM32H753I-EVAL2Peripheral: SDMMC1 enabledMiddleware: ThreadX + FileXOption "Is external transceiver present?" = Yes (since the board uses the IP4856CX35)Default CubeMX clock configurationHowever, the generated code fails during initialization at:HAL_SD_Init(&hsd1);inside:MX_SDMMC1_SD_Init()After debugging further, I found the failure occurs inside SD_PowerON() when sending CMD55 (APP_CMD).The error returned is:HAL_SD_ERROR_CMD_RSP_TIMEOUTFrom stepping through the code:SD_PowerON()-> SDMMC_CmdAppCommand()-> CMD55-> HAL_SD_ERROR_CMD_RSP_TIMEOUTSo the card never responds to CMD55.Additional observations: CubeMX configures the SDMMC1 kernel clock to 150 MHz. From the reference manual / datasheet, it seems the maximum SDMMC kernel clock should be around 125 MHz.I am not sure if this clock configurat
I've been able to get USB Host working on Nucleo F767I board, but I can seem to get it working on STM32WBA65RI part. I've tried the following two boards combinations:MB2130A on MB1801D (STM32WBA65I-DK1)MB21230A on MB2143A (Nucleo-WBA65RI) I've tried the following projects:STM32CubeWBA/Projects/NUCLEO-WBA65RI/Applications/USBX/Ux_Host_HIDSTM32CubeWBA/Projects/NUCLEO-WBA65RI/Applications/USBX/Ux_Host_HID_StandaloneMy own STM32CubeMX based project.I've done all my builds (both the working F767 and failing STM32WBA) using STM32CubeIDE. I've been able to build, flash, and debug into the executable in all cases. A fresh clone of STM32CubeWBA from github, I see the expected printed out:USB Host library started.Starting HID ApplicationConnect your HID Device**** USB OTG HS in HID Host ****However, plugging devices in CN9, does not result in them getting detected. Placing a breakpoint on _ux_hcd_stm32_interrupt_handler does n
Split from this post. Hello, Sorry to bother you again, but it seems that since yesterday (when I enabled the CAN bus), the UART on my Nucleo has stopped working, even though I haven’t touched anything since then. To be precise, I’m monitoring my UART signal and I’m only getting ‘framing errors’, obviously, I’ve checked and the baud rates are the same on both sides. Could activating the HSE clock have disrupted the operation of my UART ? Thank you in advance for your help,
Dear ST Community,I have successfully run the Object Detection Application on the STM32N6 Discovery Kit using the reference firmware from the STM32AI ModelZoo.As part of extending its functionality, I am looking to implement the following two features:Convert the captured RGB frame to JPEG formatStore the JPEG image onto the SD card available on the Discovery KitFor the RGB-to-JPEG conversion, I have referred to this JPEF Encoder example and integrated this JPEG encoding logic into the object detection firmware. Specifically, I am feeding the nn_in buffer (used as neural network input) to the JPEG encoder. However, during execution, the program gets stuck at this line:jpeg_encode_processing_end = JPEG_EncodeOutputHandler(&hjpeg);The jpeg_encode_processing_end flag is not being set to 1, indicating that the encoding process does not complete. I suspect either the JPEG input handling is not progressing, or the DMA isn't properly triggering the required callbacks.Could you kindly
HiI'm create a project that sending data from RFID reader (RS232) to PC (via USB HID) as a keyboard.I using RS232 to TTL for STM32 can read data and using USB HID to send it to PC.My code is working but a character sending is slow, but when i remove delay, character is missing. Ex: data from RFID: 4F002F144EWhen I have 15ms delay, my PC receive all characterBut when remove 15ms, some character is miss.So I want to ask have anyway to speedup ?This is my loop: while (RingBuffer_Availabel(&ring)) { uint8_t data; RingBuffer_Pop(&ring, &data); if(data == '\r'){ send_enter(); break; } keyboardhid.MODIFIER = (data >= 'A' && data <= 'Z') ? 0x02 : 0x00; keyboardhid.KEYCODE1 = ascii_to_hid((char) data); USBD_HID_SendReport(&hUsbDeviceFS, (uint8_t*) &keyboardhid,sizeof(keyboardhid)); HAL_Delay(15); usb_ready = 0; keyboardhid.MODIFIER = 0x00; keyboardhid.KEYCODE1 = 0x00; USBD_HID_SendReport(&hUsbDevic
Hello everybody I'm building the device with power delivery sink function. I need the 21V (PPS). I done the configuration with STM32CubeMX and wrote some code in STM32CubeIDE. Unfortunately, after about 14 s of estabilishing connection, the source send hardware reset. What is the problem? In the attached file is the trase from STM32CubeMonitor-UCPD. I use STM32CubeIDE v. 2.1.1 and STM32CubeMX v. 6.17.0. void USBPD_DPM_SNK_EvaluateCapabilities(uint8_t PortNum, uint32_t *PtrRequestData, USBPD_CORE_PDO_Type_TypeDef *PtrPowerObjectType) { /* USER CODE BEGIN USBPD_DPM_SNK_EvaluateCapabilities */ //DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: update USBPD_DPM_SNK_EvaluateCapabilities"); USBPD_SNKRDO_TypeDef rdo; rdo.d32=0U; rdo.ProgRDO.ObjectPosition=6U; rdo.ProgRDO.OutputVoltageIn20mV=1050U; //21V rdo.ProgRDO.OperatingCurrentIn50mAunits=60U; //3A rdo.ProgRDO.NoUSBSuspend=USBPD_ENABLE; rdo.ProgRDO.USBCommunicationsCapable=USBPD_ENABLE; *PtrPowerObjectType=USBPD_CORE_PDO_TYPE_APDO; *Ptr
Hi I would like to check if it is necessary to call MX_RNG_Init() after the MCU exits STOP MODE to reconfigure the RNG? BR Gilberto
I downloaded the STM32C5 software package from st.com, but I am unable to use IAR. How can I import the CMake project?
Hello all,I've been using this U5 chip for a couple of years but I am just now trying to update all of the packages to start working on the project again. I have the U5 firmware at 1.8.0, AZRTOS-H7 at 3.5.0 (I'll explain why I mention that), FileX is 6.4.0 and the CubeIDE is 2.0.0.When I started this project, I was using an H7 chip and that is where the Azure implementation started. Now things seem integrated and those choices in the software packs selection in CubeMX don't seem to matter...I assume. The H7 package is the one still loaded to my hard drive. I've tried creating a new project and setting everything up again but nothing has changed from my original project. I tried to apply some U5 patch with version 2.2.0 or something like that. MX took it and made it disappear into the void. Again, maybe I don't need to care about manual package setup anymore.ThreadOS works great and everything has been working great for me. I added USBX, F
According to Page 1354 of rm0394, setting LDMA_TX bit must occur only when SPE=0.However, from my reading of the function HAL_SPI_Transmit_DMA, this bit may be set or cleared when the DataSize <= 8bit and MemDataAlignment == HALFWORD, even if SPE=1.This looks like a bug.Am I correct?STM32Cube MCU Package for STM32F4 STM32L4, version 1.28.3
Hello, I tried to program a MSD on an STM32C071. My computer "sees" the USB device but didn't recognized it as a storage device. I use the NUCLEO-C071 and have setup the following: RCC:High Speed Clock(HSE): Crystal/Ceramic Resonator Clock Configuration:Input frequency: 8HCLK: 48ToUSB(Mhz) HSIUSB48: 48 CubeMX USB:Mode: Device_Only,USB interrupt enabled CubeMX USBX:UXDevice memory pool size: 1024*5USBX Device Generate Core Init code: yesUSBX Device System Stack Size: 1024*5 In CubeIDE:main.c: /* USER CODE BEGIN 2 */ MX_USB_PCD_Init(); // Line 94 /* USER CODE END 2 */ /* USER CODE BEGIN USB_Init 2 */ HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x00 , PCD_SNG_BUF, 0x20); // Line 180 HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x80 , PCD_SNG_BUF, 0x60); HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x81 , PCD_SNG_BUF, 0xA0); ux_dcd_stm32_initialize((ULONG)NULL, (ULONG)&hpcd_USB_DRD_FS); HAL_PCD_Start(&hpcd_USB_DRD_FS); /* USER CODE END USB_Init 2 */ In ux_device_msc.c /* USER CODE BEGIN P
I am trying to run a ADC+DMA program inside application based program. (generated FSBL+Application project)While debugging the application project, it automatically jumps to somewhere else as shown in screenshot and is unable to debug the application one.The prgram is stucking at for loop which is not inside application code.
I am trying to implement TFTP file transfer on my STM32 module (Nucleo-H723ZG). I have taken reference from:https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM324xG_EVAL/Applications/LwIP/LwIP_IAPhttps://github.com/JoeMerten/Stm32-Tools-Evaluation/tree/master/STM32Cube_FW_F4_V1.9.0/Projects/STM324xG_EVAL/Applications/LwIP/LwIP_TFTP_Server For file transfer I am using tftpd64 software. I used the software for PC-PC file transfer which were on the same local network and it was successful. But when I am trying to send file from PC-STM32 module I am only receiving write request from the client (PC). After that I am suppose the get a block 0 acknowledgement from the server (STM32 module) which I am not receiving. I tried debugging the code but in the code the acknowledgement is being sent successfully. For more information:- my ethernet is up - I have successfully ping the IP address that I have assigned or configured for the module. - Moreover, I am using
Hello, As part of a new project, I'd like to use DFU mode for programming my STM32F303VET6. I have a button that controls BOOT0. If the button is pressed during the microcontroller reset, there's no problem; I successfully enter DFU mode and can reprogram without any issues. I'd like to be able to perform this step without any physical intervention on the board, but rather by creating a 'jump' from my application to the internal ST Bootloader. My board is connected to the PC via a CDC connection. Using HyperTerminal, I send a command that calls a JumptoBootloader function. My function is as follows: void JumpToBootloader(void) { // 1. Stop USB peripheral RCC->APB1ENR &= ~RCC_APB1ENR_USBEN; // Disable USB clock RCC->APB1RSTR |= RCC_APB1RSTR_USBRST; // Reset USB RCC->APB1RSTR &= ~RCC_APB1RSTR_USBRST; // 2. Put USB pins (PA11/PA12) in analog mode RCC->AHBENR |= RCC_AHBENR_GPIOAEN; GPIOA->MODER |= (3U << (11 * 2)) | (3U << (12 * 2)); // Ana
Hi everyone,As part of one of my projects, I have to use an SD card to store my data. Since the final board has not yet been manufactured, I started developing my software on the STM32303E-EVAL evaluation kit.For reference, it uses the same microcontroller that will be on my own board.Back to the STM32303E-EVAL. When I received this board, the provided demo worked correctly (GUI display and so on).I wanted to test the examples dealing only with the SD card (FAT32 format), which are available in the repository:→ STM32Cube_FW_F3_V1.11.0\Projects\STM32303E_EVAL\Applications\FatFs\FatFs_uSDImported into CubeIDE, it does not compile, files are missing – in short, it is a mess.So I started over from scratch, installed AC6, opened the project, flashed it, started a debug session, and I get stuck in f_mount().The SD card is correctly inserted.Could you help me?Or, failing that, provide me with a working example?
The original question is here I too have experienced something like this with my STM32F407ZET controller. TCP Client mode was not working in IAR whereas it worked CubeIDE. Dont know the reason, but had to migrate my whole code to IDE.
Hi Team,Could you please confirm whether the following SPI erratum is considered in HAL version 1.11? I am currently using an MCU with revision V.
Hi,I have this toolchain and need to generate a SBOM:STM IDE v1.18STM IDE GNU Tools for STM32 13.3.Rel1STM32Cube FW_L4 V1.18.1, specified in `\*.ioc` fileSTM32_USB_Device_Library (v2.0_Cube)STM32CubeMX 6.14.0FreeRTOS (10.3.1)How could I turn this into a SBOM?I tried scanning the folder strucutre with syft but this did not work. I then tried to manually make a syft Json file, but when testing for vulnerabiliteies (like e.g. here ) i could not find them. I am not sure how to specify the above components, such that they get recognized by the automated search engine (Grype).I found a statement from ST, that SBOMs will be provided for their products, but I could not find said lists for my toolchain. Some repositories on the GitHub Repositores contain `sbom_cdx.json`. However, I struggle to connect my Toolchain components to the repositories on Github (there are over 700 and for example "stm32cubeIDE" returns 0). Any help is appreciated! Related Links:Wikip
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
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
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
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.