Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
#include "main.h" #include "fatfs.h" #include "usart.h" #include "usb_host.h" #include "gpio.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "ff_gen_drv.h" #include "usb_host.h" #include "usbh_diskio.h" #include <stdint.h> /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ #define USE_USB_FS // Uncomment for Full-Speed USB /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ /* USER CODE BEGIN PV */ FATFS USBDISKFatFs; /* File system object for USB disk logical drive */ FIL MyFile; /* File object */ char
Hello STM32 Community,I am working on designing a universal programmer for STM32 microcontrollers and would appreciate your guidance on the following: Software Development: What essential information is required to develop the software for a universal STM32 programmer?Memory Mapping: How can I obtain the memory mapping for various STM32 microcontrollers?File Format Decision: How should I decide whether to send a binary (.bin), Intel hex (.hex), or ELF (.elf) file to the microcontroller? What factors influence this decision?Existing Tools: How do existing development environments like Keil manage programming STM32 devices?
I am using the STM32H573VTx chip and require an External Loader to access a 128Mbits NOR Flash via OctoSPI in memory-mapped I/O mode. Firstly, regarding the STM32H573I_DK board sold by ST, it utilizes the Macronix MX25LM51245G in OctoSPI mode(8 data line), for which ST provides the external loader MX25LM51245G_STM32H573I-DK.stldr. The file is located at:STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/ExternalLoader/MX25LM51245G_STM32H573I-DK.stldr. In my product, I have designed it with Macronix MX25L1283x configured in Single Quad mode(4 data line) instead of MX25LM51245G. Therefore, I need an .stldr file compatible with the MX25L1283x and STM32H573VTx. Could you advise on how to generate such a loader file? For reference, when using Zephyr OS, the application located at zephyr/samples/application_development/code_relocation_nocopy successfully enables memory-mapped functionality with the MX25LM51245G. Additionally, I utilize XIP (eXecute-In-Place) to execute images
ADC1 configured asMode "Independend Mode"Scan Conversion DisabledContinuous Conversion EnabledDiscontinuous Conversion DisabledDMA Continuous REequests EnabledEnd of Conversion "EOC Flag at the end of single conversion"DMA2 configured asDirection "Peripheral To Memory"Mode "Circular"Increment Adress Memory (Peripheral is unchecked)Start code in main.c :/* Initialize all configured peripherals */MX_GPIO_Init();MX_DMA_Init();MX_USB_DEVICE_Init();MX_I2C1_Init();MX_ADC1_Init();/* USER CODE BEGIN 2 *///where?? HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED);HAL_ADC_Start_DMA(&hadc1,(uint32_t*)&value_adc,1); <= fetches only one value ! Questions:What file to include for HAL_ADCEx_Calibration ?Why do I have to guess the Include file's name ?Will Calibration make the DMA Transfer autorepeat (??) or just enhace accuracy?What is missing for "autorepeat DMA" ?Where do I see how frequently the ADC will run, if at all?What does "circular" do w/o being given a buffer to wri
i am using STM32F429ZIT6U board does the board support the mounting of SD card and USB at a time The main problem is both the devices get detected or get mounted when i use f_mount but the file that is get be stored in SD card is will be get stored in USB and SD card not have any filevoid sd_card_write(){ FATFS_LinkDriver(&USER_Driver, USERPath);fresult = f_mount(&sd_fs, (TCHAR const*)USERPath, 1);if (fresult != FR_OK){HAL_GPIO_WritePin(GPIOG, GPIO_PIN_14, 1);HAL_GPIO_WritePin(GPIOG, GPIO_PIN_13, 0);}else{HAL_GPIO_WritePin(GPIOG, GPIO_PIN_13, 1);HAL_GPIO_WritePin(GPIOG, GPIO_PIN_14, 0);} fresult = f_open(&sd_file, "0:FILE.TXT", FA_OPEN_EXISTING | FA_WRITE| FA_WRITE | FA_OPEN_APPEND); sprintf(buffer,"Temperature:%f\n",Temp); fresult = f_write(&sd_file, (const void *)buffer, strlen(buffer), &bw); f_close(&sd_file); clear_buffer(); FATFS_UnLinkDriver(USERPath);}void UsbTest_Write
Hello,recently I've been developing webserver using NetXDuo framework on STM32H573 MCU and I can't find an option to enable hostname for this device.I found that there is a parameter "name_ptr" passed to nx_dhcp_create() function and the name passed to it is even included in DHCP discovery request (checked with Wireshark), but I guess that it is not a hostname.When I am scanning local network (devices attached to my router), I can see devices and almost all of them have hostname (my PC, router, printer) but my device does not have one. I tried scanning using Angry IP Scanner, nmap and arp tools (currently using Linux).What am I missing? Does NetXDuo have option to enable hostname?
I'd be glad to help you create a post about the Ethernet and LwIP implementation issues you're facing after following the article you linked. Here's a comprehensive response incorporating insights from potential causes and solutions, while adhering to the guidelines of not using the confidential image content and avoiding code snippets:Post Title: Troubleshooting Ethernet and LwIP Implementation on STM32H7 with Nucleo-H753ZI (STM32CubeIDE 1.17.0, Hardware Pack 1.12.1)Body:I'm writing to seek assistance with challenges I'm encountering after implementing Ethernet and L w IP on an STM32H7 Nucleo-H753ZI board using STM32CubeIDE 1.17.0 and Hardware Pack 1.12.1. I've meticulously followed the steps outlined in the article: https://community.st.com/t5/stm32-mcus/how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/49308However, when I attempt to ping the device, I experience the following issues: Troubleshooting Steps Taken:Verification: I've thoroughly double-che
While in debug I get and error in this line of code. I do not get an error when running code not in debug./* Wait till HSE is ready */while (READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U){if ((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE){return HAL_TIMEOUT;}}SBC NUCLEO-U5A5ZJ-QCUBEMX IDE
https://github.com/STMicroelectronics/stm32h7rsxx-hal-driver/blob/ecc746788b9843dd4295f0acb58b3d15c3477abb/Src/stm32h7rsxx_ll_usb.cIn stm32h7rsxx_ll_usb.c in function USB_CoreInit:if (USBx == USB_OTG_HS){if (cfg.phy_itface == USB_OTG_HS_EMBEDDED_PHY){/* Init The UTMI Interface */USBx->GUSBCFG &= ~(USB_OTG_GUSBCFG_TSDPS);}/* Reset after a PHY select */ret = USB_CoreReset(USBx);if (cfg.dma_enable == 1U){USBx->GAHBCFG |= USB_OTG_GAHBCFG_HBSTLEN_2;USBx->GAHBCFG |= USB_OTG_GAHBCFG_DMAEN;}}It set USB_OTG_GAHBCFG_HBSTLEN_2 in GAHBCFG, so GAHBCFG.HBSTLEN should be 0b0100.But in RM0477(Reference Manual for STM32H7RS):Bits 4:1 HBSTLEN[3:0]: Burst length/type0000 Single: Bus transactions use single 32 bit accesses (not recommended)0001 INCR: Bus transactions use unspecified length accesses (not recommended, uses theINCR AHB bus command)0011 INCR4: Bus transactions target 4x 32 bit accesses0101 INCR8: Bus transactions target 8x 32 bit accesses0111 INCR16: Bus transactio
I apologize for I am new at learning bootloader and I am trying to create a custom bootloader for stm32f103 custom dev board. First, I just want to know how can create a compatible binary file to be flashed at existing bootloader.https://github.com/stevstrong/STM32-CDC-BootloaderI installed the bootloader from the repo link above and I have managed to flash an app but it has overwritten the bootloader.I have already edited the linker file of my application to start at the address wherein it wouldn't touch the memory allocated for the bootloader. /* Memories definition */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K FLASH (rx) : ORIGIN = 0x8001000, LENGTH = 20K } the binary file of the repo has a 4kb size and I follow the 4*1024 =4096decimal to hex = 1000 for memory addressing. Has anyone have been able to create an app binary file which is fit at the bootloader program?What is the best way to solve this?
I'm kind of stuck. I have USB_CDC running, data appears on the Kitty-Terminal in Windows10 via USB, presented as COM6: serial device in Windows. Sending data vis USB_CDC is easy: ret = CDC_Transmit_FS( buffer0, sizeof( buffer0 ) ); if( ret != USBD_OK ) { /* errors during sending ? ..... Receiving however doesn't work. That should be interrupt driven, not?The interface code allocates one buffer. And AFAIK there is a callback routinestatic int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len) Callback would mean it gets called automatically "by the system" (acutally the ISR) when there is data.Apparently I've to modify that routine into a non static version (correct?) and shovle away the *Len bytes at Buf(USB_CDC ring buffer) into my application buffer, waiting for me.However I think the callback never gets called. I type away at the terminal but nothing happens.Thus there are some fundamental questions:- is receiving via USB_CDC done interrupt driven?- do I have t
hi i have a question about stack memory.is memset or sprintf function take space on ram stack memory? For example i create global array like my_array[1024]. when i call memset in my private function, does memset function take extra space on ram(stack memory). What is the disadvantage using a lots of memset or sprintf usage in my code?
Hi, I have a development board with an STM32H745XIH6 microcontroller, which has dual cores. I am trying to debug using the SWDIO and SWCLK pins. Debugging works fine on the M7 core, but it does not work properly on the M4 core. This is what the issue looks like: Thank you in advance to everyone who helps!
Hi,I have developed an application using the STM32F103C8T6 MCU to function as a USB keyboard. The application uses the USB communication protocol to send keystrokes. One of the requirements is an emergency button that, when pressed, disables all other buttons, ensuring no letters are sent and no USB communication occurs. However, if the emergency button is pressed and the system is powered off and then back on, USB enumeration fails, displaying a "USB not recognized" error.Thank you,Deekshitha.
I am a beginner. Please help me figure out why the interrupt is not happening. I want to measure the duty cycle, but the interrupt is not enabled. I am losing hope that this is possible.#include <stdint.h> #include <stm32f0xx.h> #include <stdbool.h> #include "uart.h" int cnt = 0; #define ledPin GPIO_ODR_4 #define baudRate 115200 char receivedString[100]; volatile uint32_t capture_value = 0; volatile uint32_t frequency = 0; volatile uint32_t duty_cycle = 0; volatile bool state = false; void SystemInit(void); void TIM14_Config(void); void TIM14_IRQHandler(void); void init_PA4_LED(void); void TIM3_Init(void); void init_PA6_PWM_In(void); void TIM3_IRQHandler(void); int main(void) { SystemInit(); UART_Init(baudRate); init_PA4_LED(); TIM14_Config(); TIM3_Init(); init_PA6_PWM_In(); while (1) { if (state) { UART_SendString("Counter: "); UART_SendNumber(cnt); UART_SendString("\n"); state = false; } } } void SystemInit(void) { if ((RCC->CR &
Hello everyone,I'm using Netconn snmp over freertos on my project and I found an issue when using 2 netif interfaces. The problem is that when I receive udp messages, the response is always routed to the default netif despite having the LWIP_HOOK_IP4_ROUTE_SRC defined. Seems like in udp, the ip destination of the message received is not saved so we always answer on the default interface, that doesn't happen in tcp communication, where the message received destination ip is saved so in the LWIP_HOOK_IP4_ROUTE_SRC we can check that ip and select the correct the netif interface.Does anybody know if there is any option that can be activated using a DEFINE or defining a function for that scope?
i am looking for the equivalent function ofextern frac16_t GFLIB_Atan_F16_FAsm(frac16_t f16Val, const GFLIB_ATAN_T_F32 *psParam); from nxp mlib.h in a stm32 library
When starting uC (or performing a reset) with the cable connected to the router, ping.exe receives a response normally. If the cable is removed, ping.exe does not receive a response, but after reconnecting, ping.exe receives a response.The problem is that if the cable is disconnected, and the uC is initialized, then ping.exe does not receive a response, obviously due to the disconnected cable. But after connecting the cable, ping.exe still doesn't get a response.I tried to force the execution of MX_LWIP_Init () but it didn't work, even if the Ethernet is already responding to ping.exe, it will stop responding if I call MX_LWIP_Init () again.I noticed that MX_LWIP_Init () has a long timeout, 5000ms, but even so, I can't get it to work without restarting uC.Note: DHCP: off. External PHY: LAN8720. uC: STM32F407VG.I tested a code made with Arduino IDE, and it happens the same way it happens in STM32CubeIDE.How to reset the Ethernet, without having to restart the uC?
Hi, I am currently working on a project for the STM32H523 microcontroller. In the project I want to use AZURE RTOS to support a pendrive connected to the USB port. I know that I have to use the THREADX, USBX (host mode) and FILEX packages. Unfortunately, I have a lot of problems with running this, so I would like to ask if anyone knows if there is an example of a similar application somewhere that I could use in my project? So far I have tried to use the information available here:https://wiki.st.com/stm32mcu/wiki/Introduction_to_USBXHowever, they are too rudimentary for me. I also tried to be guided by examples written for the H7 microcontroller:https://github.com/STMicroelectronics/x-cube-azrtos-h7However, I ran into problems in that this microcontroller has a USB_HS_OTG library, not a USB one, and therefore the names and LL files are different. It doesn't make things any easier that I'm a beginner with AZURE RTOS and I don't even have the exact knowledge of how much n
Hello, everyone,I'm using a STM32L431CC and I'm having a hard time making an OTA firmware upgrade while my device has the RDP level set to 1.I've configured my Option Bytes on my bootloader and it appears to work correctly: the application code runs perfectly fine and I can't read the memory of my device using CubeProgrammer.To make the OTA firmware upgrade, my device reads the saved compiled program on a external memory and writes it to the internal flash of the MCU (using HAL here with HAL_FLASH_Program, starting from the address 0x0800C000 which is where the application begins) - however, when the device restarts, the old code is still running. I have a hard time debugging it since the RDP level disallows the monitoring on CubeIDE - however, when RDP is set to AA, the upgrade works perfectly fine. We use a similar bootloader on our STM32WLE5 and it can be upgraded just fine even with the protected firmware, so we don't know if there's something about the L431 that makes it work diff
Subject: SD Card Communication Issue in 4-bit Mode Iam using STM32F756ZG micro-controller.I am currently working on interfacing an SD card and have noticed an issue when switching between communication modes. The code executes as expected in 1-bit mode, but it fails when switching to 4-bit mode. Could you please provide insight into why this might be happening and suggest potential solutions to resolve the issue? Your expertise would be greatly appreciated. Kind regards,K.DHARANI Main.c #include "main.h" #include "dma.h" #include "fatfs.h" #include "mbedtls.h" #include "sdmmc.h" #include "usart.h" #include "gpio.h" /* USER CODE BEGIN Includes */ #include<stdio.h> #include<string.h> /* Private variables ---------------------------------------------------------*/ /* USER CODE BEGIN PV */ FRESULT res; /* FatFs function common result code */ uint32_t byteswritten, bytesread; /* File write/read counts */ uint8_t wtext[] = "Hello from STM32new!"; /* File w
GreetingsI am trying to use 2 UART interfaces on the STM32L4xx series and echo what's received on 1 interface. I am receiving strings of unknown length on UART1 using the DMA and echo-ing it with the virtual com port (UART2). I intend on using receiving one byte at a time and using the HAL_UARTEx_ReceiveToIdle_DMA() function, and be notified via the ISR HAL_UARTEx_RxEventCallback() function, when the UART1-reception is completed because UART1 will be idle, and I can form the array of bytes received and transmit it via UART2. However, HAL_UARTEx_RxEventCallback() only fires for each byte received. The brief of the function says it will fire when the uart line is idle.I have also tried to use the HAL_UART_RxCpltCallback() function to notify me that reception is complete, but it never fires.What am I doing wrong? My code is as follows #define UART_RX_BUFFER_SIZE 1 uint8_t UART1_RxBuffer[UART_RX_BUFFER_SIZE] = {0}; uint16_t RxDataLen = 0; uint16
I am working with the STM32U575 Nucleo board and trying to get the USB functionality working using one of the provided example projects "Ux_Device_CDC_ACM". I uploaded the code to the board with no problem and the USB-C is recognized by the host PC, however, I am having trouble getting it to run as expected.Could someone guide me on:Any additional configurations needed in CubeMX or CubeIDE?Common issues to check for USB-related examples?How to verify if the USB peripheral is properly initialized and?I’d appreciate any advice or resources to help troubleshoot this.Thank you!
Hi Team,I am generating the PWM with center aligned mode by using the Timer1 at 62.5Khz.this PWM is going to Bridge circuit, at this time I have to read the ADC2 with this frequency hence I made ADC trigger with Timer1 out event.I am able to read but I need the ADC to read at center of the PWM pulses. Please let me know how to achieve this??
Good morning to everyone.I met problems while trying to drive a 16x2 I2C Lcd display with STM32F446RE Nucleo boards.I tried 2 different displays (Freenove and Arceli brand). It gives the same error.I tried 2 different STM32F446RE boards. It gives the same error.First line, all characters full black squares, second line empty.I made the right connections (5Vdc on the Vcc pin, GND on GND pin, SDA on PB7, SCL on PB6.I placed a "Led check" on PA5 Led, to check if the program was "passing trough" the instruction body. The Led toggles as requested.What is not working?Please help.And thanks in advance for who can help.This is the 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
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.