Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello everyone, I am using an STM32 microcontroller and I am facing a problem when I try to mount an external flash memory. The problem is inside the function lfs_dir_fetch which is returning unexpected values in the test buffer here: struct lfs_disk_dir test; int err = lfs_bd_read(lfs, tpair[i], 0, &test, sizeof(test)); lfs_dir_fromle32(&test); the returned values are: Invalid size: test.size = 335610112, block_size = 40960 Invalid size: test.size = 335610112, block_size = 40960 lfs error:495: Corrupted dir pair at 0 1 lfs error:2214: Invalid superblock at 0 1 (*)Error in mounting external flash memory I have successfully communicate with the external flash, since I am able to read its manufacture ID. I have also configured properly the littlefs function and I test them by writing raw data to the external flash and I was able to receive them correctly. I cannot understand what is the test variable that is being declared and why
So I made a custom bootloader that I use to update the MCU firmware. So I have both the bootloader and the main app in the Flash. What I wanted to do, is to write on a specific address (out of bootloader and application, of course) a kind of a flag that notifies the app when it is necessary to go to the bootloader to update the firmware. Any clue on how to do it? I am using a STM32U585, using the B-U585I-IOT02A board. Thank you!
Hi ST Community,once again I have found a USB PD Specification violation, that I can't find the reason for:Source operation: According to USB PD Spec the order of action is as follows:1. Detect Sink using CC lines and only if sink is detected continue with the next points2. Enable VBus to safe5V3. Once safe5V is applied send source capabilities message However current implementation of the ST Stack does not care about the state of VBus. It starts immediately sending out source capabilities messages.I guess the problem is that PE Task is started immediately on Attach event in USBPD_DPM_CADCallback. And it never checks for the bus voltage. I composed a crude minimal example that does not even do anything when it should enable VBus but still source capabilities message is blown out immediately. Please find the minimal example attached. Did I miss anything? Will I need to find a workaround or can we get a fixed version of the library?Best regards,Adrian
The serial port 1 code generated by the latest STM32CubeMX 6.13.0 will print garbled characters, and using the serial port routine UART_Printf in STM32Cube_FW_H7_V1.12.0 will also print garbled characters. It doesn't work when using the serial port routine UART_Printf in STM32Cube_FW_H7_V1.11.2. After comparison, there is a difference here. I can’t understand the function here. I will be careful whether changing it will affect other functions. *This post has been translated from Chinese to comply with the ST Community guidelines.
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code. Hello! I connect one I2C target and one I3C target device both to PB6/PB7, which is configured to be "mixed I3C and I2C bus" through STM32CubeIDE. I3C parameter configuration is as below: /* USER CODE END I3C1_Init 1 */ hi3c1.Instance = I3C1; hi3c1.Mode = HAL_I3C_MODE_CONTROLLER; hi3c1.Init.CtrlBusCharacteristic.SDAHoldTime = HAL_I3C_SDA_HOLD_TIME_1_5; hi3c1.Init.CtrlBusCharacteristic.WaitTime = HAL_I3C_OWN_ACTIVITY_STATE_0; hi3c1.Init.CtrlBusCharacteristic.SCLPPLowDuration = 0x18; // 5MHz hi3c1.Init.CtrlBusCharacteristic.SCLI3CHighDuration = 0x18; hi3c1.Init.CtrlBusCharacteristic.SCLODLowDuration = 0x7b; //1MHz hi3c1.Init.CtrlBusCharacteristic.SCLI2CHighDuration = 0x7b; hi3c1.Init.CtrlBusCharacteristic.BusFreeDuration = 0x69; hi3c1.Init.CtrlBusCharacteristic.BusIdleDuratio
Hi,Im new to STM and trying to use 1 adc with DMA with 2 input and reading value.Board :STM32H753XI EVALADC 1 :INP0 rank 1INP1 rank 2Functions : void adc_dma_multi(void)void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) Results :I tried to swap rank between INP0 and INP1 to check if my second entry was read correctly and there were no hardware problems, and the result is the same: rank1 is read correctly but rank2 = 0. I have attached main.c and IOC.
I am new to STM32 programming.I am doing an stm32 project with STM32F407VET6 MCU, I want to implement a music player that can read a list of wav files from sd card and stream the music data to a external DAC chip (PCM5012a) using double buffering apporach. I have configured SDIO and FATFS with DMA enabled for perfrming the sd card interfacing and read files, which should be working normally. But the main problem is comming from I2S3 with DMA, as it doesnt continue stream subsequent audio chunks after the 1st one. Here is my i2s3 ioc configurations:I tested the playback in my main.c file, this is an abridged version:/* Includes ------------------------------------------------------------------*/ #include "main.h" #include "fatfs.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "lcd.h" #include "touch.h" #include <stdio.h> #include "sd_interface.h" /* USER CODE END Includes */ /* Private define -----------
Hello, I have a problem with a STM32L431CC generating a circular PWM burst with the DMA. I am using the Timer1 to generate 4 PWM signals on the Pins PA8, PA9, PA10, PA11. The systemclock of the Timer 1 is 80 MHz. The frequency of the PWM signal should be 20kHz. I have attached the code snipped were i configured the GPIO, Timer and DMA in the software. I get no PWM signal from the GPIO pins. When I manipulate the CCRx registers of the Timer1 with the ST Link debugger, I am able to generate PWM signals with the correct frequency and duty cycle. I suspect that the Timer1 do not make a DMA request and I am not able to find the failure. The DMA do not set any interrupt flags. Also when I manipulate the DMAR register of Timer1, I can see a valid PWM signal. Would be great when someone can support me Thanks Patrick #define TIM1_PSC_INIT 0u #define TIM1_ARR_INIT 3999u /* ~20 kHz at 80MHz systemclock frequency */ #define TIM1_RCR_INIT 0u uint16_t volatile tim1_dma_buffer[] = {
rm0456 describes CKDIV belonging to the FDCAN register structure, However the actual header in the cmsis_device_u5 repo make it a member of the FDCAN_Config_TypeDef. This is missleading! Probably FDCAN_Config_TypeDef. is some structure found in the MCAN IP. There is no description of FDCAN_Config in the reference manual. A description is welcome,
Hello,I use a STM32F777 with FreeRTOS and LwIP. I also run a display control with TouchGFX and partial framebuffer via SPI. I have configured the Ethernet and LwIP as shown in the following link: https://community.st.com/t5/stm32-mcus/implementing-a-lwip-and-freertos-v1-udp-echo-server-on-the/ta-p/780261 .The Ethernet works so far after booting. However, there are always artifacts on the display, as LwIP seems to write to the areas of the frame buffer.However, I have created the Linkerscript configuration as in the tutorial from the link and also added a LwIP heap section. Unfortunately it still does not work stable.What do I have to adjust so that it works without errors?Here is my configuration:
When connecting via USB to a STM32 board in DFU mode, it is possible to read a serial number from the instance path.However, in runtime, the serial number exposed via USB must be programed by the user... It would be nice then if ST provided the algorithm they used to create this string.We do have some hints though. When generating a STCube project, by default a `Get_SerialNum` function is generated in usbd_desc.c.However, it does not produce the same string as the bootloader does. Can anyone please tell us what is the algorithm stored in ROM of each type STM32 to generate the USB serial number string based on the 96-bit UID?On STM32F76/STM32F77, I have found that this function outputs a string that matches the one produced in ROM:`static void Get_SerialNum(void){ uint32_t deviceserial0, deviceserial1, deviceserial2; deviceserial0 = *(uint32_t *)DEVICE_ID1; deviceserial1 = *(uint32_t *)DEVICE_ID2; deviceserial2 = *(uint32_t *)DEVI
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code. HI ALL: In my project, I use AWD1 to monitor ADC3_CHN1, then set the high and low threshold, it works very well. However, when I switch to AWD2 and AWD3, there is no interrupt triggered, the setting codes are below: The configuration for AWD1: AnalogWDGConfig.WatchdogNumber = ADC_ANALOGWATCHDOG_1; AnalogWDGConfig.WatchdogMode = ADC_ANALOGWATCHDOG_SINGLE_REG; AnalogWDGConfig.Channel = ADC_CHANNEL_1; // output1 current AnalogWDGConfig.HighThreshold = 800; AnalogWDGConfig.LowThreshold = 500; / AnalogWDGConfig.ITMode = DISABLE; HAL_ADC_Stop(&hadc3); if (HAL_ADC_AnalogWDGConfig(&hadc3, &AnalogWDGConfig) != HAL_OK) { Error_Handler(); } HAL_ADC_Start(&hadc3); LL_ADC_ClearFlag_AWD1(hadc3.Instance); LL_ADC_EnableIT_AWD1(hadc3.
Hello,I'm using STM32H75x and NOR flash e.g. IS29GL064. I get the NOR demo running but I'd like to do modifications in order to get rid of all the polling stuff.According to the demo, the FMC is configured like this hnor1.Init.NSBank = FMC_NORSRAM_BANK3; hnor1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE; hnor1.Init.MemoryType = FMC_MEMORY_TYPE_NOR; hnor1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_16; hnor1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE; hnor1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW; hnor1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS; hnor1.Init.WriteOperation = FMC_WRITE_OPERATION_ENABLE; hnor1.Init.WaitSignal = FMC_WAIT_SIGNAL_ENABLE; hnor1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE; hnor1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_ENABLE; hnor1.Init.WriteBurst = FMC_WRITE_BURST_DISABLE; hnor1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ASYNC; hnor1.Init.WriteFifo = FMC_WRITE_FIFO_ENABLE; hnor1.Init.
Hello everyone,I'm currently working on a custom board with an STM32H735AGI6, and I'm trying to create the external loader for the MX25LM51245g NOR flash on it. I use the OCTOSPI1 for the communication. I first created a basic project using STM32CubeIDE in version 1.18.1 to validate the OCTOSPI communication and hardware of my board. And I'm able read/write the register of the external flash, as well as erasing block or full chip, and writing data into it.Then I tried to create the external loader fallowing this tutorial : https://controllerstech.com/w25q-flash-series-part-10-qspi-ext-loader-in-h750/ adapting it to my needs.My problem is that when I test my external loader, through the STM32CubeIDE or the STM32CubeProgrammer, by erasing the first block and writing into it, the erase goes well, but I next get the error log 'failed to download sector[0].I debug my external loader project directly from the RAM (0x24000004) address using STM32CubeIDE, and I'm able to erase a
Hi,I am working with an STM32 microcontroller (STM32 C0 & STM32H5 series) and want to implement Modbus communication without using FreeRTOS . Most examples I found are based on FreeRTOS, but I need to handle Modbus protocol in a non-RTOS environment.Are there any recommended Modbus libraries that can work without an RTOS?
Hello, I'm having problems with a simple task: receive blocks of data from UART. The blocks are sequences of 1-300 bytes, that are receiveid with a 1 second interval. The value is stored in one buffer of 350 bytes.When I send a big block of 270 bytes after other blocks(of 60 bytes by example) in that 1s interval, the Stm32 RESETS! But if the interval is longer, like 5 seconds, it doesn't reset and receive the data correctly. I tried with pooling and interruption, the result is the same. I'm using 115200 baud. Lowering the baud rate also reduces the interval that doesn't cause a reset, but I can't use this solution.WatchDog is already disabled. By this moment, the code doesn't do anything more.
Hello, I have managed to generate a IP through the LWIP in the STM32 IDE and establish a connection via Ethernet, although now when I upload the files from hasseb/stm32h7_atsame70_ptpd: IEEE 1588 PTP daemon for STM32H7 and ATSAME70 (github.com) I seem to have a large portion of the code in the main.c file greyed out. As well, I'm not sure if it is concerning that there is a warning saying "_gettimeofday is not implemented and will always fail". I found some documentation stating this is not too much of a concern, as it's only a warning and not an Error. Furthermore, I have tried getting an output using this function just as a test and no luck: https://stackoverflow.com/questions/42747128/does-hal-gettick-return-ticks-or-milliseconds-and-how-to-measure-in-microsec/42749284#42749284 __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) { /*configuring the SysTick to have an interrupt in 1ms time basis*/ HAL_SYSTICK_Config(SystemCoreClock /1000); /*Configure
Hi ST Team,I’m working with an STM32F303VET6 and need help with EEPROM emulation. I’m looking for guidance on the correct Flash setup, example code for read/write, and best practices for reliability.Any ready examples or tips for integrating this into STM32CubeIDE/EWARM would be really helpful.Thanks in advance for your support!
Hi,Im new to STM and trying to use ADC with DMA in circular mode but the value of my ADC remains at 0. I also tested it with Polling, which works.ICache and DCache : Enable void menu_adc(void) uint32_t adc_buffer[1]; uint16_t adc0; uint8_t flag_adc; void menu_adc(void) { char buf[30]; HAL_ADC_Start_DMA(&hadc1, adc_buffer, 1); while(1){ if (flag_adc == 1) { flag_adc =0; int len = snprintf(buf, sizeof(buf), "ADC0: %u\r\n", adc0); HAL_UART_Transmit(&huart1, (uint8_t*)buf, len, HAL_MAX_DELAY); HAL_Delay(200); } if (HAL_ADC_PollForConversion(&hadc1, 100) == HAL_OK) { uint32_t adc_value = HAL_ADC_GetValue(&hadc1); int len = snprintf(buf, sizeof(buf), "ADC0: %lu\r\n", adc_value); HAL_UART_Transmit(&huart1, (uint8_t*)buf, len, HAL_MAX_DELAY); } } } void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) { if(hadc->Instance == ADC1) { adc0 = adc_b
Hello everyone,I'm a beginner in embedded systems and I'm trying to flash my LVGL UI resources to the external QSPI flash (a W25Q64) on an STM32H743IIT6 using OpenOCD. I'm running into some issues with OpenOCD detecting the flash.Here is what I have done so far:Linker Script (.ld): I have defined the external flash memory region in my linker script and created a section named .lvgl_assets that points to this external flash address.Data Placement: I'm using __attribute__((section(".lvgl_assets"))) in my code to place the UI resource data into this specific section.Binary File: I have successfully generated a separate .bin file that contains only the data from the .lvgl_assets section.My goal is to flash this .bin file to the W25Q64.My OpenOCD Problem:I am using the stm32h7x.cfg target file provided by OpenOCD. I saw that it contains a QSPI driver, so I added the following line to my config:set QUADSPI 1I then run OpenOCD with:openocd -f interface/cmsis-dap -f target/stm32h7x.cfgAfter it
Edited by a ST moderator: Please kindly don't use capital letter as it gives the impression of "shouting" Hi Team, I am using stm32h743 to interface lan9353 (3 port ic). for the first step if i connect one end of the ethernet cable to board and another end is connected to pc. the led is not blinking on both sides. if i check the command prompt the ethernet is not connected only. why is there any process for this please send me.
HiI currently use a timer in interrupt mode that triggers every 50 µs and executes my function inside HAL_TIM_PeriodElapsedCallback. I also have another timer running every 1 second. To reduce CPU load, I want to replace the 50 µs interrupt-based timer with a DMA-based implementation. My goal is for the DMA-driven timer to invoke HAL_DMA_XferCpltCallback every 50 µs. Is this approach possible, and if so, how can I implement it? If there is any other approach to implement the timer to trigger every 50us using DMA please let me know.NOTE: I am implementing using STM32CubeIDE on STM32F439ZIT6 Nucleo Board.Thanks and Regards@avbST
Hi friends ,I need to make a TCP Server client in my STM32F769NIH6 board using LWIP. I referred many documents but so far it have led me to nowhere. Does any of you knowhow to do it, in that case tell me the steps.
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code. Hello, i have a Project, where i have an FPGA connected to a STM32H723 via PSSI. The FPGA sends out 16 Bit of Dummy Data over 8 Data Lines Every 1 ms. In the STM i can receive the Data without using DMA like this: "HAL_PSSI_Receive(&hpssi,&received_pssi, 1, 5000)" Now i enabled DMA in CubeMX (DMA1 Stream 0). Inside the main.c Cube created " MX_DMA_Init();" for me. I added: HAL_PSSI_ENABLE(&hpssi); if (HAL_PSSI_Receive_DMA(&hpssi, (uint32_t*)rxBuffer, BUFFER_SIZE) != HAL_OK) { Error_Handler(); } HAL_NVIC_EnableIRQ(DMA1_Stream0_IRQn); And this does not end up in the Error Handler. As Soon as the main while loop is executed, i end up in the "HAL_PSSI_ErrorCallback" with the Error ID "0" (which corresponds to "HAL_PSSI_ERROR_NONE", so an Err
I am looking for a way to obtain the PHY timestamp of when Ethernet packets are received. I am using the board NUCLEO-F767ZI, which should support hardware timestamping. I can barely find documentation about this online, but some investigation led me to the function HAL_ETH_ReadData, which contains the following lines: /* Get timestamp high */ heth->RxDescList.TimeStamp.TimeStampHigh = dmarxdesc->DESC7; /* Get timestamp low */ heth->RxDescList.TimeStamp.TimeStampLow = dmarxdesc->DESC6; I can see that this code is executed. When I print the values of dmarxdesc->DESC7 and dmarxdesc->DESC6, I always get the value 0. I am wondering if this is some sort of configuration issue, or if I am missing something. I'm not sure how important this is, but I'm using LwIP to handle my networking stack, which seems to work correctly on a higher-level (i.e. I can receive and send packets as expected). Any hint as to what might be happening would be appreciat
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.