Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi, I have an USBPD sink application created with CubeMX that can be found here:https://github.com/ThiRom/H563NucleoUSBPDSink The project can be build using cmake. If the project is build using Debug configuration, it works. But using Release it shows timeouts on requests. As you can see below during one millisecond the firmware sends 3 retries and a soft reset. This problem can be seen with -O2 and -O3 option. It seems that the file usbpd_timersserver.c is not working correctly. I found that function: uint32_t USBPD_TIM_IsExpired(TIM_identifier Id) { uint32_t _expired = 1u; switch (Id) { case TIM_PORT0_CRC: _expired = TIMX_CHANNEL1_GETFLAG(TIMX); break; case TIM_PORT0_RETRY: _expired = TIMX_CHANNEL2_GETFLAG(TIMX); break; case TIM_PORT1_CRC: _expired = TIMX_CHANNEL3_GETFLAG(TIMX); break; case TIM_PORT1_RETRY: _expired = TIMX_CHANNEL4_GETFLAG(TIMX); break; default: break; } return _expired; } When I change it to this: uint32_t USBPD_TIM_Is
The FSBL → Application jump is working fine, and the application is running properly from external flash.However, I am facing the following issues:Ethernet IssueEthernet initialization is successfulPHY link is UP, but speed is 10 Mbps (Full Duplex)Ping is not workingEthernet TX is failing continuouslyNo UDP data transmissionCamera IssueCamera (IMX335) is detected over I2CInitialization is successfulStreaming is startedBut no frame data is received (first frame timeout)Support RequiredHow to fix Ethernet bring-up (speed, ping, TX issue)Any example/project for Ethernet + UDP communicationGuidance for CSI/DCMIPP camera interface and how to read frame dataThe suggested VENC_RTSP_Server example contains only initialization; full configuration and setup details are not clear & .ioc also missingThese issues are blocking further progress. Kindly provide guidance or reference examples.
Hi all !I'm trying to write a driver for a LevelX system to talk to a QSPI chip over the OCTOSPI1 peripheral (STM32H563). I got the chip to respond to most commands, set it up in reading / protected mode.But, later, I've spotted an issue : I cannot sent over DMA two buffer, one after the other (as I did, two call to the Transmit_DMA function). Or, the LevelX API provide me two buffer, that may not be contigous. That's the issue, how to do ?I reminded that this chip has Linked List functionnality, which does match what I want (two DMA transfer from / to two different memory space, but, within one frame (Only one NCS being low).And, I cannot find a way to make them work...From a general perspective, the code is build like that : if (xfer_size > GD25_DMA_THRESHOLD) { /* * Clean the semaphore, to ensure we restart from 0. */ while (tx_semaphore_get(&
Hi everyone, I’d like to ask for your expertise. I’m working with a custom board based on the STM32H755ZIT, configured in LDO mode. My issue is that when I connect the board to my PC via USB to use the Virtual COM Port (VCP), the computer does not detect the device. I haven’t encountered this problem on other boards I’ve used, such as those with STM32L4 or STM32WB, where USB VCP works as expected. Is there a particular difference in the USB VCP implementation between the STM32H7 series and the STM32L4/WB series that I should be aware of? Here is the noteworthy configuration of my project in CubeMX RCC, HSE=Crystal/Ceramic Resonator SupplySource = PWR_LDO_Supply (This is in line with my hardware design) Power Regulator Voltage Scale = Scale 2 USB_OTG_FS,Mode=Device_Only USB_DEVICE_M7, Class For FS IP = Communication Device Class (Virtual Port Com) For the code: usbd_cdc_if.c /* USER CODE BEGIN PRIVATE_VARIABLES */ USBD_CDC_LineCodingTypeDef LineCoding = { 115200, /* baud
Hi,How do I serve request Get Source Capabilities Extended? I'm using STM32G0B1 with a port configured as SRC.When a SINK sends the Get Source Capabilities Extended the STM PD library responds with 'Not Supported' and my code is not aware that this even did happen. Is there way to intercept and serve this request? At least the callback structure does not appear to have direct support for this. USBPD_DPM_ExtendedMessageReceived is never called. /* CAD callback definition */ static const USBPD_PE_Callbacks dpmCallbacks = { USBPD_DPM_SetupNewPower, USBPD_DPM_HardReset, USBPD_DPM_EvaluatePowerRoleSwap, USBPD_DPM_Notification, USBPD_DPM_ExtendedMessageReceived, USBPD_DPM_GetDataInfo, USBPD_DPM_SetDataInfo, USBPD_DPM_EvaluateRequest, USBPD_DPM_SNK_EvaluateCapabilities, USBPD_DPM_PowerRoleSwap, USBPD_PE_TaskWakeUp, #if defined(_VCONN_SUPPORT) USBPD_DPM_EvaluateVconnSwap, USBPD_DPM_PE_VconnPwr, #else NULL, NULL, #endif /* _VCONN_SUPPORT */ USBPD_DPM_EnterErrorR
Hello all,There might be a possible bug in HAL_UART_DeInit(). When calling HAL_UART_DeInit() when it is already initialized could lead to CPU starvation. Assume that an interrupt fires after calling __HAL_UART_DISABLE(huart); and before huart->Instance->CR1 = 0x0U; the interrupt is going to keep firing provided that some conditions are met. I was able to run a debug session and saw that only the interrupt was firing.From the ref. manual -> Note: If TE bit is reset and no transmission is on going, the TC bit is immediately set.This means that the TC bit is always going to be set and the interrupt is constantly going to fire regardless of clearing the TCF in ICR. The reference manual also mentions to ensure TC bit is being set before calling __HAL_UART_DISABLE(huart).I am running into this issue when TE is reset and TXIE is set after calling __HAL_UART_DISABLE(huart). This happens extremely rarely but I am able to reproduc
is there a template for developing a custom bootloader that uses the lpuart?Has the application firmware the ability to trigger a bootloader state so I can upload the new application firmware into stm32g051g8?What are the changes that I have to do on the application firmware?Thank you all.
I’m working on STM32F405RGT6, receiving audio from ICS43432 (MSB First, 24bit on 32 bit frame).sing Circular DMA (double buffering) to read it in. After 3 days of debugging and millions of mem corruptions and stackoverflows later I finally managed to get the pipeline to work without MemCorruptions.Basically my implementation:I have a UItask, that handles button presses and changes the system states. The StartWriteAudioTask() starts the DMA and creates a .wav file. Also sets the systemState to STATE_RECORDING. DMA fills the buffer and gives semaphore to my MicTask, which basically does an endian conversion and writes a wav block. Just in case I also implemented a copy of the audiobuffer, because DMA might overwrite before I can manage to write it to a wav block. Using the debugger I see that my state machine logic and start/stop works fine, file initialization works as well and even the file appears and is playable. But the tim
Hi tech supoort reps, According to the documentation for the NUCLEO-563ZI (MB1404C), the board is expected to support I3C mode. However, during our evaluation, we were unable to successfully issue I3C shell and CCC (Common Command Code) commands.At this stage, it is unclear which configuration or setting does not meet the expected requirements. Could you please provide:The correct steps to enable and use the I3C interface on this boardAny required software, firmware, or device-tree configurationsA simple example or reference demonstrating successful I3C shell and CCC command execution Thank you for your support. [00:00:00.000,000] <inf> i3c_hub_init: I3C Hub I2C init start[00:00:00.004,000] <inf> i3c_hub_init: Hub I2C init done[00:00:00.104,000] <inf> i3c_bus_mgr: I3C bus re-enumeration start[00:00:00.104,000] <inf> i3c_bus_mgr: I3C CCC: RSTDAA[00:00:00.204,000] <err> i3c_bus_mgr: RSTDAA failed (-116)*** Booting Zephyr OS build v4.3.0-6019-gef798176ad4c
Greetings,I am working on testing a STM32H573 based HW design, which uses an external 4-port USB-2.0 Hub.I plan on using USB Flash drives, and read/write files to them as a diagnostic test.I will instantiate the STM32H573 USB interface as Host-mode, and have it discoverthe USB hub, and enumerate the downstream devices (flash drives/sticks).Our current SW base is using the FreeRTOS OS.Should I switch to Azure ThreadX? I have heard that the USBX ThreadX library isthe way to go?Can I run USBX under FreeRTOS, or does it require ThreadX?Thanks for any guidence!Ken CarlsonDraeger Medical Systems Inc.
Hello,On a STM32H7RS are using the USB_OTG_HS peripheral in PCD_SPEED_FULL mode using internal clock.After I was able to configure the clock so that the MCU is responding on enumeration requests. The responses however seem to be partially incorrect; the trace tool shows stalls.I did not found an example in current https://github.com/STMicroelectronics/STM32CubeH7RSThe following changes are applied to a CubeMX generated projectmain.c SystemClock_Config:LL3.PLLN was set to output 24 MHzRCC_OscInitStruct.PLL3.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL3.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL3.PLLM = 4; RCC_OscInitStruct.PLL3.PLLN = 60; RCC_OscInitStruct.PLL3.PLLP = 2; RCC_OscInitStruct.PLL3.PLLQ = 40; RCC_OscInitStruct.PLL3.PLLR = 16; RCC_OscInitStruct.PLL3.PLLS = 2; RCC_OscInitStruct.PLL3.PLLT = 2;Configure CRS __HAL_RCC_CRS_CLK_ENABLE(); RCC_CRSInitTypeDef RCC_CRSInitStruct = {0}; RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1; // default RCC_CRSInitSt
Hello, i am using F446 and i am contemplating using FreeRTOS CMSIS V2 software timer to generate PWM to control motors via motor drivers (IC chipset). Is this possible? Or must I use the hardware timer, TIM1~7 ?
Hello, I am using an STM32U585 with STOP mode and FreeRTOS in tickless idle mode. The datasheet says the current consumption should be around 4.5uA, however I am measuring 35uA on my custom board that only has the MCU and some decoupling capacitators. Can someone tell me if I need to add something in the code to lower consumption? Are the datasheet consumptions possible running an RTOS? I will leave my code and measurements in attach: void PreSleepProcessing(uint32_t ulExpectedIdleTime) { /* place for user code */ (void)ulExpectedIdleTime; __HAL_RCC_GPIOC_CLK_DISABLE(); __HAL_RCC_GPIOH_CLK_DISABLE(); __HAL_RCC_GPIOA_CLK_DISABLE(); __HAL_RCC_GPIOB_CLK_DISABLE(); HAL_ICACHE_Disable(); HAL_SuspendTick(); HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); } void PostSleepProcessing(uint32_t ulExpectedIdleTime) { /* place for user code */ (void)ulExpectedIdleTime; SystemClock_Config(); __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE()
I am using stm32f756zg. In which i configure LWIP with FREERTOS cmsisv2. I am getting hard faults when ping devices from other devices.It works fine when I change FREERTOS cmsis v1 and increase the default task stake.
Hello,I am currently experiencing some unusual Ethernet transmission (STM to PC) issues with a few of our custom PCBs. We use the STM32H753II chip and the KSZ8081RNB. The KSZ8081RNB is connected to the MCO2 and the RMII-interface of the STM.The IP/TCP/UDP checksum check primarily fails due to corrupted payloads ranging in size from 1 to 20 bytes, or, more rarely, due to corrupted protocols. It doesn't happen regularly, but it happens too often.This means that, for TCP, two or more retransmissions are sometimes needed.udp bad:udp good:Sometimes, packets with complete defects are sent. These defects are not sent by the application. Even, when I paused the application, I could still see these packets.For tests the PCB and the PC are directly connected. Using different cables does not solve the issue; only using different PCBs does.I set up the LwIP example project in CubeIDE 1.19, as described in Github STM32H7-LwIP-Examples#how-to-create-project-from-scratch.This project's
I created an independent task to run the TCP client and send.[424] local 192.168.10.188 port 5001 connected with 192.168.3.100 port 57804 [ ID] Interval Transfer Bandwidth [424] 0.0- 1.0 sec 5660 KBytes 46368 Kbits/sec [424] 1.0- 2.0 sec 5500 KBytes 45055 Kbits/sec [424] 2.0- 3.0 sec 5389 KBytes 44149 Kbits/sec [424] 3.0- 4.0 sec 5191 KBytes 42526 Kbits/sec [424] 4.0- 5.0 sec 5088 KBytes 41681 Kbits/sec [424] 5.0- 6.0 sec 4936 KBytes 40436 Kbits/sec [424] 6.0- 7.0 sec 4832 KBytes 39583 Kbits/sec [424] 7.0- 8.0 sec 3816 KBytes 31258 Kbits/secThe above is the data volume and status received by my iperf server. After that, my client task no longer sends any messages. I use my computer to ping the IP address of my STM32, and then the client will resume sending.I observed that the gState of my heth variable is HAL_ETH_STATE_STARTED, and the ErrorCode is HAL_ETH_ERROR_BUSY. The DMAErrorCode and MACErrorCode do not have any flags.I think it is the osSemaphoreAcquire(TxPktSemaphore, ETHIF_TX_T
HiInitial situationMCU = STM32U599VJTxQSTM32CubeIDE = v1.19.0TouchGFX = v4.26.0EEPROM Emulator = x-cube-eeprom-v8-0-0 (downloaded direct from STM website)I use the eeprom emulator to save an array of 251 bytes permant on the flash. To save the data into the flash I use the EE_WriteVariable32bits functionThis are my function to init the EEPROM emulator, write data to EEPROM and read data from EEPROMvoid Datastore::EEPROM_Init() { HAL_FLASH_Unlock(); // 1. Flash freigeben // 2. Sicherstellen, dass Flash idle ist uint32_t timeout = 1000000; while(__HAL_FLASH_GET_FLAG(FLASH_FLAG_BSY)) { if(timeout-- == 0) { HAL_FLASH_Lock(); this->m_errorHdl_p->Add(ERR_ID_EEPROM_INIT_FAILURE); return; } } // 3. Critical Section / Interrupts kurz maskieren __disable_irq(); // 4. EEPROM Init mit Retry EE_Status status = EE_WRITE_ERROR; const uint8_t max_retries = 3; uint8_t attempt = 0; while(((status != EE_OK) && (status != EE_PAGE_FULL)) && (attempt &l
Hello STM32 Community,I am currently developing a USB Type-C Active Cable application using an STM32 with the official USB-PD Middleware.My Goal: The MCU needs to behave as an EMarker/Active Cable. Therefore, it should:Ignore all SOP messages on the CC line (no response and no GoodCRC ).Only respond to SOP' and SOP'' messages.Able to monitor (Snoop) SOP messages exchanged between the Source and Sink to maintain state awareness.The Problem: In the current X-CUBE-USB-PD middleware and STM32CubeMX configuration, there is no explicit option to disable SOP handling while keeping SOP'/SOP'' active. Since GoodCRC is typically handled by the UCPD hardware autonomous logic to meet the strict tTransmitSOP timeout, the hardware automatically sends a GoodCRC when it detects a valid SOP message CRC, even if the firmware isn't intended to process it.Technical Details & Questions: I am looking for a way to bypass or disable the hardware-level auto-response for SOP only.Register Control: Is there
Hello,I am using X-CUBE-EEPROM as a mean to store variable in internal FLASH memory on STM32U5G9-DK2 board. Here is my function where a variable in flash:static FLASH_STATUS flash_slot_write_shared_key(const FLASH_INDEX *index, uint8_t slot, uint8_t *shared_key) { if (slot > FLASH_SLOTS_NUMBER) return FLASH_WRONG_PARAM; if (shared_key == NULL) return FLASH_NULL_PARAM; EE_Status ee_status = EE_WRITE_ERROR; HAL_FLASH_Unlock(); taskENTER_CRITICAL(); ee_status = EE_WriteVariable96bits((uint16_t)index->entries[slot].addr, (uint64_t *)(shared_key)); if (ee_status != EE_OK) return FLASH_ERROR; ee_status = EE_WriteVariable96bits((uint16_t)index->entries[slot].addr + 1, (uint64_t *)(shared_key + 12)); if (ee_status != EE_OK) return FLASH_ERROR; ee_status = EE_WriteVariable32bits((uint16_t)index->entries[slot].addr + 2, *(uint32_t *)(shared_key + 24)); if (ee_status != EE_OK) return FLASH__ERROR; ee_status = EE_WriteVariable32bits((uint16_t)index->entries[
Hello,I think I have interesting case, but from the beginningI use STM32F446ZEJx and HAL Drivers from STM32Cube_FW_F4_V1.28.3.When I use HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)with Size=5 it internally checks the argumentif ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U)) return HAL_ERROR;and passes the Size to/* Set the transaction information */ hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pTxBuffPtr = (const uint8_t *)pTxData; hspi->TxXferSize = Size; hspi->TxXferCount = Size; hspi->pRxBuffPtr = (uint8_t *)pRxData; hspi->RxXferSize = Size; hspi->RxXferCount = Size;later it configures the DMA channels,Rx/* Enable the Rx DMA Stream/Channel */ HAL_DMA_Start_IT(hspi->hdmarx, (uint32_t)&hspi->Instance->DR, (uint32_t)hspi->pRxBuffPtr, hspi->RxXferCount)Tx/* Enable the Tx DMA Stream/Channel */ HAL_DMA_Start_IT(hspi->hdmatx, (uint32_t
Is there a guide that shows how to set up a CDC USB device on the STM32N6 without using ThreadX in baremetal mode? I've tried following both, but it seems to hardfault on both examples crash at __lib_init_array(). I've tried increasing the stack and heap sizes to no success:https://community.st.com/t5/stm32-mcus/how-to-use-stmicroelectronics-classic-usb-device-middleware-with/ta-p/599274 https://community.st.com/t5/stm32-mcus/how-to-implement-usbx-in-standalone-mode/ta-p/614435 It's frustrating that the old USB_Device middleware got removed. We shouldn't be forced to use an RTOS where it is not needed...
Hello!I have a custom board with STM32F746VGT6 MCU, LAN8742A Eth PHY and Ethernet socket. I would like to implement MQTT communication in my project with my board as a client. I am familiar with LwIP and FreeRTOS and use both of these libraries in my current program.I already tried using WolfSSL and WolfMQTT (and succeeded to some degree), but it wasn't very pleasant experience and I had to manually copy and change many files to make it work. I want to rewrite the MQTT implementation as the current one doesn't work very efficiently, but I don't really know where to start. I'm grateful for all suggestions!
First and foremost, they aren't perfect. The code has tons of work left. But it took me SO long to get ANY i2s audio data from my guitar to my computer, the major hurdle being mostly the lack of USB Microphone drivers provided by the stack.Now that I've made them, and I am pretty sure it's the other parts of the code that are at fault for the clock drift, I am sharing it in hopes that it will help someone else who was in the same boat I was.This is designed for the STM32 to be the SLAVE to a CODEC with Full-Duplex mode support (4-5 wire bidirectional I2S Standard, 16 bit 48k. I know, nothing to call home about, but it is the simplest to get working) Try your luck with your specific CODEC, maybe you can configure things differently and get it working right. On the PCM3060, this was the best I could manage.I have no field experience, no college degree, I am just persistent. If I can do it, you can too. Don't give up. I know I haven't, this is just the start.Note: if you're just picking u
Hi all, Quick question for those working with STM32 embedded devices: If you had a tool that could analyze logs or telemetry using AI — would you feel comfortable sending that data externally? Or is data sensitivity (customer data, device behavior, industrial info) a hard blocker? I’m exploring ways to preprocess/anonymize this data before it leaves the device or server. Curious where people stand on this — is this a real need or overengineering?
Hey there,I'm currently working on an audio application for the STM32U5A5 (which I'll later port to the STM32N657), using MDF.The application closely follows the MDF/ADF examples for audio recording found in the U5/N6 Cube firmware packages, with the difference that it does not output the transformed audio signal immediately via SAI, but instead stores it in a large buffer to download it later via the STMCubeProgrammer.Although the application generally works great, it does not record more than ~2 seconds of audio, even if I increase the size of the storage buffer (e.g., to a size corresponding to 4 seconds of audio recording capacity). No matter how large I set the buffer, the function HAL_MDF_AcqCpltCallback is called approximately 2 seconds after the recording starts. Within the implementation of this function, HAL_MDF_AcqStop_DMA is called to stop the recording.I would be interested in the criteria according to which the HAL_MDF_AcqCpltCallback function is called. I would
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.