Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello, I am making a project where i'm using usart2 as a virtual com port and where i'm making a CLI based HMI using teraterm , so there's a lot of diplay and hal_uart_transmit functions , it all worked fine until I added a DMA in the uart1 in order to read gps data.What happened is that the HMI menu doesn't work as it used to but when i removed the gps reading data part from dma receive to idle it worked like it used to.Someone told me that using DMA in receive mode like that + Hal_Uart_Transmit causes a block.Since HAl_uart_transmit is a blocking function, it will cause problems for dma receive ,And among the problems is that my functions in HMI don't work anymore like they used to, but at the same time i can implement dma with adc and it works fine, the problem is in the uart Can anyone please explain to me the logic behind it? The issue reminded me of the Hal_delay() block when used inside an interrupt.You'll find in the first picture how the normal behaviour should be an
The author of this how to get CANopenNodeSTM32 working video is very good (The length of the video is 3:31:33; The part that is pertinent to this post 57:05 - 1:18:22). Unfortunately, this video targets FDCAN (but I don't have this available; my chip just supports plain CAN) and this video also targets bare metal (but I don't have this available; FreeRTOS is what I am using). I tried to follow all of the author's steps but was unable to. When I ran I got a HardFault with the CAN node never even coming online.Executing this line is what causes the Hard faultcanopen_app_init(&canOpenNodeSTM32); From the instructions in the video, there are numerous steps that are different between FDCAN and CAN and I don't know what the equivalent (plain) CAN steps are which I believe may be the root of the problem. Under the "Parameter Settings" tab"FDCAN1" and "FDCAN2" are in the video at 1:00:55. Mine doesn't have these. Mine jus
I'm using LL_RCC_DeInit within a boot loader so that the clocks are in the reset state when the application is launched. However, LL_RCC_DeInit also clears the reset cause flags as its last action: /* Clear reset flags */ LL_RCC_ClearResetFlags();The application needs to use the reset cause, so I will need to either:Modify the LL_RCC_DeInit routine (not ideal, as there are no user code sections to retain the changes); orClone LL_RCC_DeInit and remove this part (also not ideal as I would need to keep on top of any LL HAL changes); orFind some other way of passing the reset cause into the application. I would rather not do this, as I want to keep the boot loader and application completely decoupled.Resetting the flags within LL_RCC_DeInit does not seem to be compatible with its stated behaviour ("Reset the RCC clock configuration to the default reset state"), as the flags could be seen as being part of that state.For now, I will use one of the TAMP->BKP?
Hi, I need to update the firmware of my MCU from the UART. I mean without physically touching the BOOT pin, but only via serial commands (classic FW update of a product).I'm not an expert, but I tried searching on the internet and I saw that for these things it is necessary to write a bootloader. It doesn't seem impossible, but for a non-expert it's not exactly simple.What I wanted to ask is, I think this is a very common need among users, has STM created anything official to support this feature? Is there something already given and official that I can use without necessarily writing my own custom bootloader? Maybe even supported directly in CubeMX.I've seen that there are dozens of amateur/community bootloaders available, but not knowing how to write it, I can't even evaluate whether it's done well or whether it's suitable for my application, which is why I'm looking for an official STM solution.
Hi Mike, Thanks again for your previous support on the SPI interface.I have since moved to using the SDMMC interface instead of SPI for better performance, but I am still facing issues. Current Issue Summary:I can successfully mount the 32GB SDHC FAT32 card and read the capacity using FatFs. However, f_write always fails. After debugging, I found that BSP_SD_WriteBlocks fails when writing to LBA 32768. I also verified this with direct HAL_SD_WriteBlocks, which fails at LBA 32768 but works on lower LBAs like 0 or 1. This suggests the problem is not in FatFs logic, but rather in high LBA (large address) block access stability. My Questions:Is this a known limitation with STM32H7 SDMMC or HAL drivers when writing to higher LBA regions on large-capacity SD cards (like 32GB)? What is the commonly tested and verified capacity for STM32H7 SDMMC + FatFs reference designs? Do most STM32 applications use 4GB / 8GB / 16GB cards, or is 32GB commonly used and verified? Any additiona
Hi ST Community,I’m working on a JPEG encoding pipeline using the STM32N6570 Discovery Kit, and I’m running into an issue when storing both my input and output buffers in PSRAM.Setup:Both JPEG Encoder input (RGB_ImageAddress) and output (jpgBuffer) buffers are placed in PSRAM.I’m using RGB888 input format, the same as in the official JPEG example here: JPEG_EncodingFromOSPI_DMA Linker script (.ld) snippet:MEMORY{ AXISRAM1_S (xrw) : ORIGIN = 0x34000400, LENGTH = 1023K PSRAM (xrw) : ORIGIN = 0x91000000, LENGTH = 16M}.psram_section (NOLOAD):{ . = ALIGN(32); *(.psram_bss) . = ALIGN(32);} >PSRAM Buffer declarations:__attribute__((section(".psram_bss")))__attribute__((aligned(32)))uint32_t jpgBuffer[160 * 160]; __attribute__((section(".psram_bss")))__attribute__((aligned(32)))uint32_t RGB_ImageAddress = {0}; // RGB888 image Problem:After running HAL_JPEG_Encode_D
HAL code for interrupt-driven SPI transmit attempts to fill a transmit queue, which uses up the 10 bytes I am transmitting. But, a TX interrupt is also triggered which grabs an extra byte past the end of the buffer and decrements the count which wraps. There is code to turn off TX interrupts in the handler, but it checks after transmitting a byte rather than before. Has anyone else noticed this?
I have set up an I2S interface. The idea is to send it an initial HAL_I2S_Transmit_IT() request.In the ISR of SPI2 I'm sending the next HAL_I2S_Transmit_IT() and this way the transmit should be continously kept running.What happens is, that the SPI ISR is entered once. The HAL_I2S_Transmit_IT() issued within the ISR, doesn't fire the subsequent IR. Why?
Hi,I would like to use LPUART3 to proceed the UART communication with hardware control flow enable.However, I found that when the Send_UART_DATA there indeed has TX signal from LA, but CTS/RTS hasn't changed, only when system reset, those two pins just could get the status changed.Here is the configuration of MX_LPUART3_UART_Init()static void MX_LPUART3_UART_Init(void) { /* USER CODE BEGIN LPUART3_Init 0 */ // Enable LPUART3 clock __HAL_RCC_LPUART3_CLK_ENABLE(); //Enable GPIOB clock __HAL_RCC_GPIOB_CLK_ENABLE(); /* USER CODE END LPUART3_Init 0 */ /* USER CODE BEGIN LPUART3_Init 1 */ // Enable NVIC interrupt for LPUART3 HAL_NVIC_SetPriority(LPUART3_IRQn, 0, 0); HAL_NVIC_EnableIRQ(LPUART3_IRQn); GPIO_InitTypeDef GPIO_InitStruct = {0}; /*Configure LPUART pins : UART communication */ // RTS/CTS pins GPIO_InitStruct.Pin = GPIO_PIN_4 | GPIO_PIN_5; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_
Hi, I'm trying to compile an STM32U599VJTX build containing the X-CUBE-NFC6 software pack to talk to an ST25R3916B on our prototype board but cannot get it to compile. I get the following errors related to "rfal" files: I believe the platform settings are ok: Any help on the errors would be greatly appreciated. STM32CubeIDE version 1.18.1 STM32CubeMX version 6.14.1 STM32Cube MCU Package for STM32U5 Series 1.7.0 X-CUBE-NFC6 version 3.1.0
Hi, I've been trying to configure a STM32H573I-DK board as a TFTP client on NetXDuo TCP/IP stack. Just as a test, I've configured a TFTP server that hosts a simple text file. I wish for the client to be able to open the file and save the contents of the text file (a simple string) to the memory. As of now, the functions nx_tftp_client_create and nx_tftp_client_file_open return NX_SUCCESS(0x00) but that seems to be misleading given that Wireshark decodes no such RRQ. Additionally, nx_tftp_client_file_read returns (0x01) meaning that no packets are received from the server but I am quite sure that the issue is in the client creation. I've attached the TFTP bit of the code below.P.S. I've verified the server is up and running well. I was able to open the file and read its contents using a different client. Has anybody been able to get the TFTP client running with NetXDuo on this board/MCU and could provide some insight on how to set it up properly
Hello,I am working on a project using the STM32H750B-DK board with an eMMC storage device, interfaced via the SDMMC1 peripheral and the FatFs library for file operations. However, I am unable to read or write files to the eMMC.I have implemented the drivers and example code from `~\STM32Cube_FW_H7_V1.12.1\Projects\STM32H745I-DISCO\Applications\FatFs\FatFs_Shared_Device` and `~\STM32Cube_FW_H7_V1.12.1\Drivers\BSP\STM32H750B-DK`, but we are still unable to create files or perform read/write operations on the eMMC (4GB).I am sharing my project zip file. Any guidance on adjustments or in configuration can be a big help.Thank You.
Hi, I bought the Nucleo-411RE board a few days ago, and try to test i2c protocol.In this MCU's reference manual(RM0383) page 492,493, about I2C register CR1, Bit 10 ACK, It explains me that acknowledge returned after a byte is received(matched address or data). Is it automatic? If my mcu received correct address, the mcu automatically returned ack by hardware?I saw that HAL_I2C_Receive function but there is only bit setting about ack. No ack output instruction.How return the mcu ack ? by hardware or software?Thank you.If you have any questions, please ask me.
Dear ST I am encountering an issue with our current setup involving an Analog-to-Digital Converter (ADC) and a Microcontroller Unit (MCU).The ADC is successfully receiving the input voltage when measured directly at its pins. However, the MCU connected to the ADC does not appear to be reading this voltage data. Consequently, I am unable to visualize the voltage output in our software interface.Here are some details that might be helpful:ADC Model: [ADS8688IDBTR]MCU Model: [STM32G0B1VET6]Connection Method: [SPI]Software/Firmware Used: [STM CUBEIDEA 1.12.1}Observed Behavior: The ADC shows the correct voltage, but the MCU's readings (when debugging or trying to output) are consistently zero or incorrect, and no data is reflected in the visualization software.Troubleshooting Steps Taken So Far:Confirmed voltage at ADC input pins using a multimeter.Checked physical connections between ADC and MCU for continuity.Verified power supply to both ADC and MCU.Could you please prov
Hi I need a guidance to use I2C communication protocol with stm32f103c8t6 using CMSIS RTOS v1. Can any one suggest any tutorial or article which can help me out to understand and implement it for my project.
Hi, I am using stm32u585 controller in my project I have downloaded https client code from the site https://github.com/eclipse-threadx/netxduo and integrated the code with my project Our requirement is to use https POST with payload and i have implemented the following steps(pseudo code), but we are failing at https request send api, any how, the security handshake is passed (step 3 given below) Integration steps 1)Include nx_web_https_client.c 2)required header file for build error free it is building error free Steps for https client POST command with pay load of 4KB(as of now and later on it shall be extended to 8KB) 1)create client 2)attach response header call back 3)tls connect for initial authentication(this step is passed, monitored on wireshark) 4)https client request initialize 5)packet allocate 6)add content type 7)append data of 4KB 8)https request send am i missing any steps? please support us to resolve the issues as soon as possible Thanks in advance G.V
Hi,I am trying to establish I2C communication between STM32C011 (Master) and STM32C031 Nucleo Board (Slave).I transmit a message from the master, however, the slave side sees that the master wants to write to the slave (using HAL_I2C_AddrCallback) however, the HAL_I2C_SlaveRxCpltCallback is never called.In another post, I see that the buffer length may be an issue, so I tried to transmit just one character but to no avail.ChatGPT suggested I shouldn't re-arm the HAL_I2C_Slave_Receive_IT function as it can cause it to get stuck. I tried it with and without but same result.I see "Master wants to write to slave" only once upon power up/reset of the slave MCU.Master Side:#include "main.h" #define SLAVE_ADDR 0x42 << 1 I2C_HandleTypeDef hi2c1; SPI_HandleTypeDef hspi1; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_SPI1_Init(void); static void MX_I2C1_Init(void); uint8_t TX_Buffer [] = "A"; //uint8_t TX_Buffer [] = "MasterToSlave"; // DATA to send ui
Hello,I am working with a Nucleo-F103RB board and trying to send printf output over UART using USART2. I have configured UART2 with the following parameters:Baud rate: 9600Word length: 8 bitsStop bits: 1Parity: NoneMode: TX/RXI also redirected printf to HAL_UART_Transmit() via __io_putchar() as shown below:PUTCHAR_PROTOTYPE { HAL_UART_Transmit(&huart2, (uint8_t *)&ch, 1, 0xFFFF); return ch; }In my main() loop, I am calling printf() every second like this:uint8_t count = 0; float f = 1.234; while (1) { printf("hello : %d, %f\r\n", count++, f++); HAL_Delay(1000); }However, nothing is being printed in Tera Term (v5.0).I selected the correct COM port and set it to 9600 baud rate. Other serial settings are default and matched.I have verified that:MX_USART2_UART_Init() is called in main.cGPIOs are configured by CubeMX for USART2 (PA2: TX, PA3: RX)No errors are reported during initialization.But still, I see no output on Tera Term.How can I troubleshoot or resolve this issue?Is t
In this regard, I would like to use STM32L5 or H5 development boards to implement the LWIP protocol stack+FREERTOS minimal system. I have no idea how to build the LWIP protocol stack on the FREERTOS system. May I ask if you can send me the LWIP protocol stack code or demo suitable for STM32L5 or H5。Thanks!
PA0_C/PA1_C/PC2_C/PC3_CWhat is the base address for the above four GPIOs that can be set?Also, do you have the following understanding about the above 4 pins?Pxy_C can be set to a pin of the same function or another function by controlling an analog switch.
Hello,I'm trying to migrate my project from STM32G474I-eval board to STM32H757I-eval (dual core)' but I'm facing some troubles.My original project has several peripheral : CANFD, ADC1, DAC, USART. I tried to define all these according to the Data sheet of STM32H757I on Core M7 only (just to try to migrate to single core at the beginning), but when I was trying to check ADC1 I have already encountered some problems.First of all according to the STMCubeMX the only available pins for ADC1 were (PA0, PA0_C, PA1_C), and in the DMA settings - I put DMA1 Streem3 (Circular). According to data sheet the pin PA0_C is connected to the CN5 and RV1 potentiometer so I was expecting that moving the potentiometer to different values would actually change the output on PA0_C.The problem is - when I'm running the debugger on the STM32H757I board I always find myself in the HAL_ADC_IRQHandler function, and never get to the ADC_DMAConvCplt callback (where the HAL_ADC_Co
In an inherited code I see LL_GPIO_Init() being called with pin definitions (LL_GPIO_PIN_xx) OR-ed together, presumably to define multiple pins of the same port to the same settings, in one call of the function.The documentation (doxygen header) to LL_GPIO_Init() does not say this is allowed; neither says so the description of the init struct. Is there any authoritative documentation which allows this?Thanks,JW
Hi! I read from many posts that it's possible to use FAFTS with this board, but I can't get the project to compile without errors. The weird thing is that errors appear between the files of the libraries themselves (attached photo). Variables that are defined show up as undefined. Moreover, in the main I have also defined this type of variables and it accepts them well. Any idea what might be going on?Thanks
Hello Community,I'm working on a storage module using SDcard for my project.The chip I'm using is STM32H743XIH6.At present, the SD card has been successfully read and written in the polling (ordinary) mode. However, I have never succeeded in reading and writing the SD card in DMA mode.Could you please provide a complete illustrated tutorial of the configuration process?For now, there is no need to introduce fatfs. Just read and write a block in DMA mode.If possible, please also provide a configured.ioc file and the test code. PS:STM32CubeMX Version: 6.14.1
I wonder why I have data in the buffer when my sample rate is 30KHz and 0 when the sample rate is 50KHz. My code:/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "adc.h" #include "dac.h" #include "dma.h" #include "spi.h" #include "tim.h" #include "usart.h" #include "gpio.h" /* Private inc
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.