Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Does anyone know if there are any software stacks available through ST that support DALI 2 colour tuneable (DT8) control gear devices (LED drivers). I can see that ST have a third party offering from MBS Solutions that claims to offer full DALI2 support but after contacting them they say that it doesn't support any DT8 control gear commands except RGBWAF - which none of my clients are asking for ...
I have been attempting to interface a STM32U575 mcu to a dual HYPERRAM/Flash memory set up in multiplexed mode as shown in the following image taken from the STM32 Octo-SPI AN5050 application note. I am trying to implement a POSIX based RTOS and have thus been trying to create this setup in my project devicetree as follows: &octospi2 { pinctrl-0 = <&octospi_pins>; pinctrl-names = "default"; status="okay"; flash: ospi-nor-flash@0 { compatible = "st,stm32-ospi-nor"; reg = <0>; size = <DT_SIZE_M(512)>; ospi-max-frequency = <DT_FREQ_M(50)>; spi-bus-width = <OSPI_OPI_MODE>; data-rate = <OSPI_STR_TRANSFER>; status = "okay"; }; hram: ospi-nor-flash@1 { compatible = "st,stm32-ospi-nor"; reg = <1>; size = <DT_SIZE_M(512)>; ospi-max-frequency = <DT_FREQ_M(50)>; spi-bus-width = <OSPI_OPI_MODE>; data-rate = <OSPI_DTR_TRANSFER>; status = "okay"; }; }; and I have also tried: &octospi2
Hello,I want to use the buffer program feature of my IS29GL064 NOR flash in order to increase the programming speed.For this I replaced HAL_NOR_Program() by HAL_NOR_ProgramBuffer() in the NOR flash demo and got a memfault. Did some debugging and doubt the code, especially because I found this post hereBUGS: HAL_NOR_ProgramBuffer() is riddled with them Has the reported bug, if any, been already fixed ?Second, I wonder if my ISSI flash is supported because of the following comment in stm32h7xx_hal_nor.cThis function must be used only with S29GL128P NOR memory.IMHO all devices which support the necessary commands, e.g. NOR_CMD_DATA_BUFFER_AND_PROG, should be able to use this feature and HAL function.Any hints, news, updates or comments?Thank you
Hello,I have an STM32G431 here that sends messages to a PC via MIDI. These are translated into OSC messages by a bridge and then interpreted by lighting control software. I would like to eliminate the intermediate step via the bridge and transmit the messages directly as OSC. My own research has shown that this is possible in principle if the controller acts as a network adapter via USB. Unfortunately, I couldn't find any examples for the G4. There seem to be a few examples of people configuring an F4 as a USB network adapter. Unfortunately, I haven't been able to integrate these examples into Cube IDE and get them to run on the G4. I have also tried to integrate a TinyUSB stack. Unfortunately, this was also unsuccessful. Therefore, I wanted to ask if anyone else has examples for me in which RNDIS has been integrated on the G4, or tips on how I can get closer to a solution.Thank you in advance.
Hi, I am using three STM32 devices for CAN communication:HardwareDevice A: STM32G431 (FDCAN)Device B: STM32F303 (Classic CAN)Device C: STM32H7A3 (FDCAN)SetupA sends a continuous sequence of commands to B.B processes each command and replies to A over the same CAN bus.One specific command requires B to perform a synchronization sequence with C (also over CAN).While B is synchronizing with C, A continues to send commands to B.IssueDuring the B↔C synchronization, B intermittently misses some frames from A (i.e., A transmits, but B does not process/see a corresponding message).The failure is not immediate: A↔B + B↔C run together fine for a while (sometimes short, sometimes long), then a frame from A is skipped.When the synchronization with C is disabled, A↔B runs reliably with no missed frames.CAN ID from A to B: 0x12CCAN ID from B to A: 0x12DCAN IDs between B and C (sync purposes): 0x2BC, 0x2BD and 0x2BEAs you can see from the inserted can config the sampling point for 3 devices is a
Hello.I have problem using STM32 USB Host HID. I`m stuck in the USBH_Process() function in usbh_core.c, or its better to say stuck in USBH_HID_Process() function in usbh_hid.c file. I am trying to connect a USB keyboard to my own designed stm32f407zgt6 board, code is generated through STM32CubeMX v5.2.1 with package software v1.24.2 and I work with IAR IDE v8. I`ve made a project just same as (https://www.youtube.com/watch?v=Co4ChSgVSek), but with different pins pack, every time I connect the keyboard the MCU gets the descriptors, but it never gets data from keyboard. I only used one keyboard model, also searched a lot about the problem. I`ve tried what pavel.a said in (https://community.st.com/s/question/0D50X00009XkZ4KSAV/usb-host), nothing changed, when I printf() the logs on uart, at first I get: after some "HOST_ENUMERATION"s it recognizes keyboard: and at last the process goes on like the: for ever "HOST_CLASS..." from USBH_Process() fuction in usbh_core.
I am using STM32CubeIDE as my development environment,and the board is STM32F429I-Discovery (MCU: STM32F429ZITx). I created an LCD display program using the BSP drivers (such as stm32f429i_discovery_lcd.c).The project builds successfully and flashes without any errors. However, after powering on the board, the LCD remains completely white and nothing is displayed. I downloaded the official firmware package from ST’s website:https://www.st.com/en/embedded-software/stm32cubef4.htmland imported the necessary BSP files from stm32cubef4-v1-28-0.zip into my CubeIDE project. Current situation: The folders Drivers/BSP/STM32F429I-Discovery and Utilities/Fonts are properly included in the project The build and flashing process complete successfully The LCD backlight turns on, but the screen stays white all the time I used the example project LTDC_Display_2Layers as a reference I would like to know what kind of initialization or configuration might be missing,or what are the common ca
HAL_ADC_Start on STM32U5G9J results in HAL error.Initializing the ADC/* ADC4 init function */ void MX_ADC4_Init(void) { /* USER CODE BEGIN ADC4_Init 0 */ /* USER CODE END ADC4_Init 0 */ ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC4_Init 1 */ /* USER CODE END ADC4_Init 1 */ /** Common config */ hadc4.Instance = ADC4; hadc4.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV256; hadc4.Init.Resolution = ADC_RESOLUTION_12B; hadc4.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc4.Init.ScanConvMode = ADC4_SCAN_DISABLE; hadc4.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc4.Init.LowPowerAutoPowerOff = ADC_LOW_POWER_NONE; hadc4.Init.LowPowerAutoWait = DISABLE; hadc4.Init.ContinuousConvMode = ENABLE; hadc4.Init.NbrOfConversion = 2; hadc4.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc4.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc4.Init.DMAContinuousRequests = DISABLE; hadc4.Init.TriggerFrequencyMode = ADC_TRIGGER_FREQ_LOW; hadc4.Init.Overrun = ADC_O
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 there, I have a simple one, I have run the exmaple project on camera dcmipp continous mode and snapshot mode for the stm32n6570 development kit, how, the image feed on the screen is blurred on the first run with out any edits, I have tried to play with the downsizing that is configured in the project in vain, hoping to get a clearer image.these are the default settings that I that come with the example DonwsizeConf.HRatio = 25656; DonwsizeConf.VRatio = 33161; DonwsizeConf.HSize = 800; DonwsizeConf.VSize = 480; DonwsizeConf.HDivFactor = 316; DonwsizeConf.VDivFactor = 253; if(HAL_DCMIPP_PIPE_SetDownsizeConfig(&hdcmipp, DCMIPP_PIPE1, &DonwsizeConf) != HAL_OK) { Error_Handler(); } if(HAL_DCMIPP_PIPE_EnableDownsize(&hdcmipp, DCMIPP_PIPE1) != HA
I’m working with an STM32G0 running ThreadX (Azure RTOS).The system UART is configured in circular DMA mode with an IDLE event interrupt for data reception.SymptomsIntermittently, after hundreds of successful receptions, the system enters HardFault_Handler.The fault always occurs at the same point in the code (on a C division instruction, inside a function unrelated to DMA).The register values at the HardFault are shown in Image 1.When it runs without triggering a hard fault, the registers are:xPSR = 0x01000000 and CONTROL = 2.When the hard fault occurs, these registers are:xPSR = 0x00000000 and CONTROL = 0.The failure does not depend on the received data.The thread stack (PSP) has sufficient space.I believe the intermittent HardFault is not related to the operation itself:If I modify the code—adding new instructions or removing code—sometimes it reproduces, and other times it still reproduces but in different parts of the code.QuestionWhat can I do to determine the root cause of this
As the title says.I am using STM32H523RCT6 with no RTOS (no ThreadX) and USBX in Standalone mode.The code is basically:MX_USB_PCD_Init();MX_USBX_Device_Init();HAL_PCD_Start(&hpcd_USB_DRD_FS); Which executes, but as soon as the USB_DRD_FS_IRQHandler is called, I run into a hard fault. The trace is:USB_DRD_FS_IRQHandler()HAL_PCD_IRQHandlerHAL_PCD_ResetCallback_ux_dcd_stm32_initialize_completeat/* Create the default control endpoint attached to the device.Once this endpoint is enabled, the host can then send a setup packetThe device controller will receive it and will call the setup functionmodule. */dcd -> ux_slave_dcd_function(dcd, UX_DCD_CREATE_ENDPOINT,(VOID *) &device -> ux_slave_device_control_endpoint);the USB_FNR register shows LSOF 0x3 as well as the LCK and RXDP bit set and the USB_ISTR has the bits ESOF, SOF, RST_DCON and SUSP set.Please help, I've already lost way too much time on this.
Subject: STM32H563RIT6 I2S1 Not Receiving Data from PCM1804 in Slave Mode (Polled) Description: I'm using an STM32H563RIT6 MCU with an 8 MHz external crystal. The I2S1 peripheral is configured in slave mode (receive only) and connected to a PCM1804 ADC chip, which is set as the I2S master (transmit only). The PCM1804 outputs audio in the following format: 32 kHz sampling rate, stereo, 24-bit data packed in a 32-bit frame. Using a logic analyzer, I confirmed that the I2S signals from the PCM1804 (I2S_WS, I2S_BCK, I2S_SDO) are correct and properly aligned. The connections are as follows: I2S_WS → PA4 I2S_BCK → PA5 I2S_SDO → PA6 I'm testing I2S data reception with the simplest polling-based code, but the STM32H563RIT6 fails to receive data correctly. During debugging in the Start_I2S1_Polling function, the temp_buffer array (used in HAL_I2S_Receive) contains all zeros, which does not match the data captured by the logic analyzer. Below is my code. Could you help identify what I'm
Hi, I am trying to create the I2C communication using the format used from the company seller of the device.I have to follow these steps:I2CReadFunciton ( uint8_t slAddr, uint8_t* wrData, int wrLen, uint8_t* rdData, int rdLen Initiate the bus by issuing a START condition.If there are bytes to write (wrLen > 0):Address the target device with its slave address in write mode.Transmit the wrLen bytes contained in wrData.Without releasing the bus (i.e., do not send a STOP), issue a REPEATED START to transition into the read phase.Begin the read phase:Address the same device with its slave address in read mode.Receive rdLen bytes, storing them sequentially into rdData.Terminate the transaction with a STOP condition.Key constraints:If a write phase occurs, it must be immediately followed by a repeated start—no STOP is allowed between the write and the subsequent read.The read always occurs after either the initial START (if no write) or the repeated START (if a write was performed).&n
Hi I am working on an STM32U585 microcontroller with TrustZone enabled and I need to update the RTC time with the HAL_RTC_SetTime function. During the execution of that function, the linestatus = RTC_EnterInitMode(hrtc); //stm32u5xx_hal_rtc.creturns HAL_TIMEOUT, so I am unable to update the RTC values. I have attached several screenshots that show the microcontroller configuration The Project Manager generates both MX_RTC_Init functions for the Secure and NonSecure zones. The main files of both Secure and NonSecure zone execute the MX_RTC_Init function without any errors, the software starts up correctly, but at some point I am not able to set the RTC Time. Upon debugging, I noticed that during the execution of RTC_EnterInitMode, the lineSET_BIT(RTC->ICSR, RTC_ICSR_INIT);does not set the INIT bit, which remains at 0. Thank you in advance for your support. Please let me know if you need any further information.Best regards,Eros
Hello everyone, I’m programming a B-U585I-IOT02A board. My goal is to capture audio through the integrated microphone at a sampling rate of 44 kHz and then analyze it using callbacks. I’m using the example provided by ST Electronics, the BSP, from which I use the audio functions, specifically:BSP_AUDIO_IN_Record(0, (uint8_t*) RecBuff, RECBUFF_SIZE*2); First, I initialize the structure like this: BSP_AUDIO_Init_t AudioInit;/* Select device depending on the Instance */AudioInit.Device = AUDIO_IN_DEVICE_DIGITAL_MIC1;AudioInit.SampleRate = AUDIO_FREQUENCY_44K;AudioInit.BitsPerSample = AUDIO_RESOLUTION_16B;AudioInit.ChannelsNbr = 1; AudioInit.Volume = 50; /* Not used */if (BSP_AUDIO_IN_Init(0, &AudioInit) != BSP_ERROR_NONE) { Error_Handler();} The issue I’m facing is: when I use a RecBuff (of type uint16_t) with a length of 44100, I get a callback every 250 milliseconds instead of every second.However, with a sampling rate of 11 kHz and a RecBuff length of 11000, I ge
I'm experiencing a configuration incompatibility between SAI1 and GPDMA1 on STM32N657 when using FreeRTOS with D-Cache enabled. The SAI/GPDMA configuration works individually but fails when used together, specifically related to D-Cache coherency issues.Hardware ConfigurationMCU: STM32N657X0HXQ (Cortex-M55 with cache) [Nucleo board]Audio: SAI1 Block B in Master RX mode, I2S format, 16kHz, 24-bitDMA: GPDMA1 Channel 0 in LinkedList Circular modeRTOS: FreeRTOS with both I-Cache and D-Cache enabledThese are the SAI and GPDMA configurations:static void MX_SAI1_Init(void) { hsai_BlockB1.Instance = SAI1_Block_B; hsai_BlockB1.Init.AudioMode = SAI_MODEMASTER_RX; hsai_BlockB1.Init.Synchro = SAI_ASYNCHRONOUS; hsai_BlockB1.Init.OutputDrive = SAI_OUTPUTDRIVE_DISABLE; hsai_BlockB1.Init.NoDivider = SAI_MASTERDIVIDER_DISABLE; hsai_BlockB1.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_EMPTY; hsai_BlockB1.Init.SynchroExt = SAI_SYNCEXT_DISABLE; hsai_BlockB1.Init.MckOutput = SAI_MCK_OUTPUT_DISABLE; hsai
I've run into an interesting problem and curious if anyone knows a solution. I am adding TFTP support to an amateur radio project (soon to be published as open source). All the other code is based on LWIPs netconn API and I want the TFTP code to use netconn as well. Almost all the embedded LWIP examples I can find are for a TFTP server, not a client and all seem to be the native API too. Undeterred I'm off writing my own, but I've run into what seems a fundamental incompatibility between the TFTP protocol and how I understand basic IP comms work!The weird part about TFTP is that while the client sends a UDP packet from it's "upper" port to the well know TFTP port on the server (69), for a read request, by spec the TFTP server responds not from its well-known port, but a new random upper port! With LWIP (and this seems normal and correct), if you set up a connection to another device and it's port, only replies back from that port come back to you. A
Hello,We have developed a product based on STM32M4 and would like to enable our clients to do DFU firmware update. We have develop a Windows based app which will include STM32_Programmer_CLI and make use of it. Although we would need our client to install also DFU windows drivers. Is there an official installer somewhere which will install only the STM DFU drivers?Thanks for your help,Andrea
Hi,I'm having a project that uses LTDC (565) UART4 (for printf debugging purposes) and ETH/LwIP. The issue i'm having is an infinite loop in `LAN8742_Init` : ```while(regvalue & LAN8742_BCR_SOFT_RESET)```always evalute to true and ```if((pObj->IO.GetTick() - tickstart) <= LAN8742_SW_RESET_TO)``` evalutes to true as well (tickstart is 0 and pObj->IO.GetTick() also returns 0).STM32CubeMX warns me about possible conflicts with PIN - but I don't think LTDC and UART/ETH are using the same pins. Ater enabling ETH CubeMX warned about Clock but autoresolver fixed the issue.
Hello,I'm encountering an issue when trying to write data to the flash memory on the STM32WL5C8U6. I'm using the official driver implementation (V1.3.1) and the following sequence of commands:HAL_FLASH_Unlock()FLASH_Program_DoubleWord(0x08030000UL, <data>)HAL_FLASH_Lock()The problem is that the data is only written to flash the first time I run this sequence on the chip. On subsequent attempts, no data is written. I’ve also tried calling FLASH_PageErase(0x30) before writing, but that didn’t resolve the issue. Additionally, I attempted to reset the flash to 0xFFFFFFFF manually, which seemed to help intermittently, but I have been unable to reproduce this reliably.Does anybody have any suggestions on what might be going wrong? Are there any working examples for this chip?Thank you in advance!
Greetings, So, I am developing a bootloader, that receives a firmware, using a similar protocol to xmodem (128 bytes), through the USB. I followed this tutorial to implement the USB and adapted it to make it work on a B-U585I-IOT02A board. The USB communication works. So I am making something like this (some minor details have been omitted, but the big picture is here): #define APP_START ((uint32_t)0x0800C000 #define OFFSET 128 uint32_t addr = 0; uint8_t buff[OFFSET] __atribute__((aligned(4))); // 32-bit aligned int main(void) { Flash_Erase(bank, page); for(;;) { if(!lastPacket) { GetPacket(&buff); Flash_Firmware(APP_START+addr, buff); addr += OFFSET; } else { Flash_Firmware(APP_START+addr, buff) break; } jumpToApp(); } static HAL_StatusTypeDef Flash_Erase(uint32_t _bank, uint32_t _page) { HAL_StatusTypeDef status = HAL_FLASH_Unlock(); if(status != HAL_OK) { return status; } FLASH_EraseInitTypeDef erase = {0}; uint32_t PageError = 0;
I am running an application with Azure RTOS, and CAN bus. All was well until I needed to increase the tick time to 2000/second (from 1000/second). When I did this the CAN Interrupts stop working. To make things even worse, when I change the tick time back to 1000/sec within CubeIDE, it still doesn't work and I have to pull and older version off Github to get it going again. I'm not overly familiar with Azure RTOS, usually I just do my own OS. CAN interrupts are priority 0, RTOS 15. TIM6 is used for tick for RTOS. CAN Initilization: /* Configure Rx filter */ sFilterConfig.IdType = FDCAN_STANDARD_ID; sFilterConfig.FilterIndex = 0; // sFilterConfig.FilterType = FDCAN_FILTER_DUAL; sFilterConfig.FilterType = FDCAN_FILTER_MASK;//Classic filter sFilterConfig.FilterConfig = FDCAN_FILTER_TO_RXFIFO0; sFilterConfig.FilterID1 = 0x7F1; sFilterConfig.FilterID2 = 0x7F1; if (HAL_FDCAN_ConfigFilter(&hfdcan1, &sFilterConfig) != HAL_OK) { Error_Handle
Merhabalar,https://community.st.com/t5/stm32-mcus-embedded-software/usb-hs-in-stm32u5a5/m-p/809596#M64236I am writing to continue my question here.When I checked the classic core middleware, I saw that it only supports the STM32U575 dev board.I am using the STM32A5U5 development board. Can I run classic core middleware on STM32A5U5 development board? If so, how do I run it? I need to work with bare-metal and CDC.How do I structure the .ioc file?Can you explain in detail?Thank you for support.
Hey guys!I am currently working on stm32F2 series, the issue i was facing in HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) when the UART transmit the first byte the interrupt call back function is not called instead calling the RxCpltCallback it call the " USART1_IRQHandler(void) "and the RxCpltCallback function does not trigger at first byte in UART at the second byte it call the RxCpltCallback function and it works fine and i attached the code i was wrote #include "main.h"UART_HandleTypeDef huart1;UART_HandleTypeDef huart3;unsigned char ra_buffer[32];void SystemClock_Config(void);static void MX_GPIO_Init(void);static void MX_USART1_UART_Init(void);static void MX_USART3_UART_Init(void);int main(void){HAL_Init();SystemClock_Config();MX_GPIO_Init();MX_USART1_UART_Init();MX_USART3_UART_Init();HAL_UART_Receive_IT(&huart1,ra_buffer,12);while (1){HAL_Delay(1000);}void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart){HAL_UART_Receive_IT
I’m trying to establish USART communication between two STM32F407-Discovery boards, where one board acts as Master and the other as Slave.Hardware setupMaster Board clk -> save board Clk - [common clock]Master Board TX → Slave Board RXMaster Board RX ← Slave Board TXBoth GND connectedUsing STM32F407-Discovery boards SYNCHRONOUS MODEconnectivity configurationsUSART port used (e.g., USART2)Baud rate (e.g., 115200)Word length (8 bits)Parity (None)Stop bits (1)Clock settings ( synchronous) clock polarity : lowclock phase : one edgecode of master and slave:// Masterchar data = 'A';HAL_USART_Transmit(&huart2, (uint8_t*)&data, 1, HAL_MAX_DELAY);// Slavechar rx;HAL_USART_Receive(&huart2, (uint8_t*)&rx, 1, HAL_MAX_DELAY);output : Im getting grbage value like 127@ , so onWhat I've tried - Verified TX/RX wiring- Checked baud rate matching- Tried loopback test on each board (TX→RX)- Switched from polling to interrupt-based reception
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.