Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Been trying to get an test application working on a STM32F469NIH Discovery board.Should be fairly simple - Write a file to the SD Card, with FatFS, the read back:Try as I might, I couldn't get things working.After a bit of debugging, I think the issue lies with the DMA callback functions. I'm using FW_F4 V1.27.1, on CubeIDE, and it seems that the supplied SD_DMATransmitCplt() function isn't quite complete, when compared to the SD_DMAReceiveCplt() function. There seems to be a couple of things missing - Firstly the call to the callback function - This is a must for the SD interface, because there's a queue that is waited on. Without the callback function being called, nothing is ever put on the queue, so a timeout error is received. The other important bit seems to be the line of code that unlocks the HAL. A sensible thing to do, as we've just finished transferring data. Again, without it, some other bits of code later on fail as the HAL is still locked. So I copied the code from the RX
Hello ST Community - I am seeking to migrate a functioning HTTP Client application from a SAMD51 MCU to STM32 silicon, I have an STM32H573I-DK on hand, objectives: HTTP Client Ethernet (wired) connectivity using a static IP address Storing retrieved JSON objects on an SD card DIsplaying selected attributes on the 240x240 LCD Other than the demo program, I have not deeply explored the STM32H573I-DK. Any configuration, and coding tips / examples would be greatly appreciated. Thanks much, Kelly
Hello everyone,I am working on the STM32U5G9ZJT6Q MCU and am trying to use the JPEG Encoder by feeding him data through a GPDMA linkedlist mode from RAM. The data to encode is an image of 640*480 8-bit grayscale image (the image is stored in a .c file ; for jpeg, i use tables 0, no chrominance in sight).I am not using the HAL methods for jpeg/dma, eventhough the JPEG_DMA_StartProcess inside HAL_JPEG_Encode_DMA in stm32u5xx_hal_jpeg.h function seems to support dma linkedlist transfers.I ran the JPEG_EncodingFromFLASH_DMA example for stm32u5g9 discovery kit, without issue, but having to work with normal dma transfers and having to handle the input/output in interrupts seems a bit off to me. I would like to use the linkedlist for simpler automation.I configured the jpeg_rx (input) and jpeg_tx (output) dma transfers as linkedlists. The jpeg output works fine, the nodes are correctly updated and stream data as wanted.However, the jpeg input dma stalls after the first node, eventhough the ne
譬如說我使用一個按鍵,按下去之後執行函式"jump_to_sys_memory_bootloader",再搭配STM32CubeProgrammer,使用uart來更新我的MCU,但是一直無法連接成功,以下是我的函式請問哪邊有遺漏嗎?static void jump_to_sys_memory_bootloader(void){uint32_t i;void (*SysMemBootJump)(void);__IO uint32_t sys_memory_address = SYSMEM_BOOT_BASE;// 1. 關閉全域中斷__disable_irq();// 2. 停止 SysTickSysTick->CTRL = 0;SysTick->LOAD = 0;SysTick->VAL = 0;// 3. 釋放所有已初始化的外設HAL_ADC_DeInit(&hadc1);HAL_I2C_DeInit(&hi2c1);HAL_SPI_DeInit(&hspi1);HAL_SPI_DeInit(&hspi2);HAL_UART_DeInit(&huart1);HAL_UART_DeInit(&huart2);HAL_TIM_Base_DeInit(&htim14);// 4. Reset RCC (回到預設 HSI 狀態)HAL_RCC_DeInit();// 5. 關閉 NVIC 所有中斷for (i = 0; i < (sizeof(NVIC->ICER) / sizeof(NVIC->ICER[0])); i++){NVIC->ICER[i] = 0xFFFFFFFF;NVIC->ICPR[i] = 0xFFFFFFFF;}// 6. 記憶體重映射到 System Flash__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();// 7. 設定主堆疊指標 (MSP)__set_MSP(*(uint32_t *)sys_memory_address);// 8. 取得 Bootloader Reset Handler 入口點SysMemBootJump = (void (*)(void)) (*((uint32_t *)(sys_me
Hello, I am using STM32C071 in my project, the main work is to receive data from PC, then do some controls, then send data to PC.However, during the send data to PC step, sometimes the data will be sent continuously, it doesn't meet my requirements, sometimes it working well, this is very unusual. please provide some advise.After I send the data and proceduce the 'handleRecvData()' func, the data I received from PC is not un-stoppable.I have checked several days and I can't find what caused this ab-normal.I follow the steps from @B.Montanari , this link:https://community.st.com/t5/stm32-mcus/how-to-implement-the-usb-device-cdc-vcom-in-stm32-using-the/ta-p/599170the write and read threads code shows as below:/* Private function prototypes -----------------------------------------------*/ /* USER CODE BEGIN PFP */ uint8_t resultCode = 0; extern TX_MUTEX mutexCode; /* USER CODE END PFP */ VOID usbx_cdc_acm_write_thread_entry(ULONG thread_input) { /* Private Variables */ ULONG tx_ac
A BOT protocol read fail error is occurring in usbh_msc.bot.c:- See "*** MY MOD-" below USBH_StatusTypeDef USBH_MSC_BOT_Process (USBH_HandleTypeDef *phost, uint8_t lun) { ... else if (URB_Status == USBH_URB_STALL) { /* This is Data IN Stage STALL Condition */ MSC_Handle->hbot.state = BOT_ERROR_IN; /* Refer to USB Mass-Storage Class : BOT (www.usb.org) 6.7.2 Host expects to receive data from the device 3. On a STALL condition receiving data, then: The host shall accept the data received. The host shall clear the Bulk-In pipe. 4. The host shall attempt to receive a CSW.*/ #if (USBH_USE_OS == 1) osMessagePut ( phost->os_event, USBH_URB_EVENT, 0); #endif } else if (URB_Status == USBH_URB_ERROR) // *** MY MOD- *** added as getting error here! { /* This is Data IN Stage ERROR Condition */ MSC_Handle->hbot.state = BOT_ERROR_IN; // tried this but no change } break; case BOT_DATA_OUT: ...
Hello everyone, I am trying to use STM32F429I eval board to do some basic signal processing labs, like show a sinewave on the LCD display, and fft spectrum on the display too.But it is not easy to manually configure the LCD display to show some custom waveform. It looks like we need to configure FMC -> LTDC -> LCD...Since there is only one LCD on the board, I assume I need to enable LCD1... Then, how am I supposed to configure FMC in the first place ?Thank you.
This should be a simple use case but to my surprise it does not seems obvious how to do it. Say I have 3 PWM channels in the same timer, how do I turn them on simultaneously?If I do if (HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1) != HAL_OK) Error_Handler(); if (HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_2) != HAL_OK) Error_Handler();There could be delay between the two steps. Is there a model where I can1) Enable PWM CH1, 2) Enable PWM CH2, 3) start timer What is the proper way to achieve this?
Hello,I am trying to get f_mount() to work with the SDIO peripheral. Currently, the f_mount() reaches the first disk_read() function, where it hangs in the osMessageQueueGet() call. Stuff I already tried:- increase min & max heap to 0x400, 0x800- increase default static rtos task stack size to 8000- call f_mount in the default task- have delay before f_mount- pullup on all IO pins except the CLK- the hsd.Instance has recognized card type and class- the NVIC prio is 5 for SDIO and DMA stream- tried SDIO_RX/SDIO_TX combo and just SDIO- tried setting GPIO pins to lower speeds- tried SD bit 1 mode and then switching to 4bit mode- tried SD bit 1 mode and keeping 1 bit mode- SDIO_IRQ interrupt hits, but does not put anything in the SDQueueID queue. i would prefer to use the cubemx generated drivers and not write one myself. is this configuration (RTOS+SDIO+FATFS) not possible/bugged? thanks.
I believe I am seeing the same issue raised here:https://community.st.com/t5/stm32cubeide-mcus/problem-with-stm32h7-erasing-flash-bank-1-while-running-from/td-p/86979but there were no replies before that thread was locked.I'm working on a firmware-update mechanism, testing on a Nucleo STM32H755ZI (rev U). When a new firmware is available, I erase the inactive flash bank and then write the new firmware into the freshly erased bank, ping-ponging between banks each time the firmware gets updated.// Find which flash bank we are running in now if (FLASH->OPTCR & FLASH_OPTCR_SWAP_BANK) { ActiveBank = BANK2; } else { ActiveBank = BANK1; } ... // Bank-erase the inactive flash, and prepare to program it if (ActiveBank == BANK1) { // Only unlock if currently locked if (FLASH->CR2 & FLASH_CR_LOCK) { FLASH->KEYR2 = 0x45670123; FLASH->KEYR2 = 0xcdef89ab; } FLASH->CR2 |= (FLASH_CR_BER | FLASH_CR_START); // perform bank 2 erase while (FLASH->SR2 & FLAS
Hello,I am implementing a Web Server in my STM32H743 Board.I have referenced the example implemented in STM32H735G-DK board.Refer to the belowhttps://github.com/STMicroelectronics/x-cube-azrtos-h7/tree/main/Projects/STM32H735G-DK/Applications/NetXDuo/Nx_WebServer(AzureRTOS, NetXDuo, FileX using microSD) But I changed the memory pool location of D1(AXI-RAM) to D2(SRAM1, SRAM2). .tcp_sec (NOLOAD) : { . = ABSOLUTE(0x30000000); *(.RxDescripSection) . = ABSOLUTE(0x30000060); *(.TxDescripSection) } >RAM_D2 .nx_data (NOLOAD): { . = ABSOLUTE(0x30000100); *(.NxServerPoolSection) . = ABSOLUTE(0x30004100); *(.NetXPoolSection) } >RAM_D2In this state, the web page does not function properly. The symptoms are similar to this in the link below.https://community.st.com/t5/stm32-mcus-embedded-software/stm32h735g-dk-takes-a-long-time-to-open-the-web-page/td-p/797153 I restored that part back to the D1 domain. .tcp_sec (NOLOAD) : { . = ABSOLUTE(0x24030000); *(.RxDescri
I am using the core STM32H743IITx with Dev board OpenH7XXI-C. PHY IC - DP83848,With RMII configuration. I am facing issue in Ethernet communication for every 10 min of interval, I am getting DMA Error with RBU,ETI,AIS bit in DMACSR is set. but after few sec(30 to 40sec), It is reconnecting again.DMA descriptors allocated in RAM_D2 section. LWIP_RAM_HEAP_POINTER @ 0x30020000guidance on why this issue happens with regular interval will be helpful .lwip_sec (NOLOAD) : { . = ABSOLUTE(0x30040000); *(.RxDecripSection) . = ABSOLUTE(0x30040060); *(.TxDecripSection) . = ABSOLUTE(0x30040200); *(.Rx_PoolSection) } >RAM_D2MPU Configuration MPU_InitStruct.Number = MPU_REGION_NUMBER5; MPU_InitStruct.BaseAddress = 0x30020000; MPU_InitStruct.Size = MPU_REGION_SIZE_128KB; MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1; MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE; HAL_MPU_ConfigRegion(&MPU_InitStruct); /** Initializes and configures
Hello, I am working on a project that uses both SD card and USB interface with FatFs. For SD card, I am using FatFs User Defined mode. For USB, I am using FatFs USB Disk mode. The issue I am facing is:When I call f_mount() for the SD card using disk_open("0:"); and later try to use USB disk, there is a conflict/collision with f_mount. It looks like the two FatFs configurations are interfering with each other. My question: How can I properly configure FatFs to use both SD card (user defined) and USB disk together without conflicts? Is there a way to isolate or separately handle f_mount for each disk (e.g., "0:" for SD and "1:" for USB) so that they don’t collide? Environment: MCU: STM32H750VBT6 Middleware: FatFs + USB Host MSC IDE: STM32CubeIDE Any suggestions or working examples would be very helpful.
I use stm32f427 I find the NetxDuo can run so good.But When I want to run ptp_client.c I find a lot of difficultsCan ptp_client.c support E2E ? or only P2P, If support both how to configure ?I use a master clock that only can support E2E , It can't work I debug it for a long time ,but can't find why it don't work
Hello ST,I have been working on trying to get the FreeMODBUS library working on the NUCLEO-F446RE development board. The FreeMODBUS library can be found here,https://github.com/cwalter-at/freemodbusI am having trouble getting the USART port working correctly,So far I am able send packets to the microcontroller and get interrupt calls to the USART2_IRQHandler();However calling HAL_USART_Receive_IT(&uart_mb, (uint8_t *)byte, 1) only returns zeros in byte.BOOL xMBPortSerialGetByte(CHAR *byte) { //*byte = MB_USART->RDR; HAL_USART_Receive_IT(&uart_mb, (uint8_t *)byte, 1); //HAL_UART_StateTypeDef state = HAL_UART_GetState(&uart_mb); //*byte = MB_USART->DR; return TRUE; }I am configuring the USART port in the following manner,BOOL xMBPortSerialInit( UCHAR ucPORT, ULONG ulBaudRate, UCHAR ucDataBits, eMBParity eParity, UCHAR stopBit) { HAL_Delay(10); // Enable UART peripheral clock MB_USART_CLK_ENABLE(); HAL_Delay(10); // Enable GPIO clocks MB_TX_GPIO_
Hi,I am currently working on integrating Modbus RTU communication using the STM32H747I-DISCO board. Unfortunately, I have not been able to find any official example code or reference implementation specific to this board.I have already attempted to integrate the protocol using a sample code I put together, but it is currently not working as expected. I would greatly appreciate it if you could review the attached code and let me know if there are any issues or missing components.If you also have a working example or any official reference for implementing Modbus RTU (ideally using UART, FreeRTOS, and the CM4 core), it would be extremely helpful.Thank you in advance for your support.
I have created TCP client on my STM32H723 module. Now I am stress-testing the code by abruptly closing the server before the TCP client could connect. As per my code it retries TCP connection after 30 seconds. But after multiple times the code freezes. I debugged it and it was getting stuck in tcp_fasttmr function: All the conditions under the while are not satisfied so it directly jumps to line 1519 and back 1489.
Post edited by a ST moderator. Please use </> button to paste your code. Hi, I’m working with an STM32H7 (dual-core) and I want both CM4 and CM7 to be able to transmit on the same UART. On CM7, I initialize the UART normally MX_USART1_UART_Init(). On CM4, I try to send data via HAL and I’ve protected access with a hardware semaphore. Problem is that CM4 doesn’t see the properly initialized huart1 from CM7 and nothing is transmitted. What exactly do I need to do so that CM4 can use the same huart1, i tried the __attribute__((section(".RAM_D2"))) UART Handle TypeDef huart1; but it doesn't work ither. . Also why both cores declares huart1on their own?? Thanks in advance for any help! code: int __io_putchar(int ch) { // Take semaphore HAL_HSEM_FastTake(UART_HSEM_ID); if (ch == '\n') { uint8_t cr = '\r'; HAL_UART_Transmit(&huart1, &cr, 1, HAL_MAX_DELAY); } HAL_UART_Transmit(&huart1, (uint8_t*)&ch, 1, HAL_MAX_DELAY); // Release semaphore HAL_HSEM_Release(UART_
Hello. This is HPNRT Co., Ltd. We are currently in the process of PESSRAE certification for our escalator auxiliary brake, a component that requires certification. We are developing the system using the STM32H743 MPU and plan to use Azure RTOS as the operating system. We were informed that the development and sales of Azure RTOS are free, but we need the Certificate Document for PESSRAE certification. Could you please assist us with this? Does the PESSRAE-related process require a separate contract? We would also appreciate it if you could provide us with the procedure for obtaining Azure RTOS PESSRAE certification and the email address of the relevant department at your company. Thank you.
Hello, im new in embedded system and im using the SBSFU project from this https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/B-U585I-IOT02A/Applications/SBSFU . I used the b-u585i-iot02a example and needed to do some changes to work perfectly in STM32U585CIU6. Im wondering now if there is a way do only use USB to communicate between my computer and the bootloader without any USART TX-RX pins.
The function printf is not thread-safe in multitasking environments. While correct output can be expected when a single task utilizes printf, concurrent use by multiple tasks may result in garbled or overlapping text. Implementing additional synchronization measures is necessary to prevent such issues.Val Gretchev
Dear Team, I hope you’re doing well. I am currently working on a project using the STM32F412ZGT6 board, and I need assistance to play audio via the built‑in codec. I have configured the I2S, I2C Pin and initiated some tests, but I am facing difficulties in getting proper audio output. Could you please help me with: Sample initialization code (HAL / low‑level) for I2S / codec setup Recommended DMA / buffer handling strategy Any tips or pitfalls specific to the STM32F412 series audio path Example code or reference projects that use the built‑in codec If needed, I can share my current code, configuration settings (clock, pin mappings, CubeMX file, etc.). Your guidance would be of great help in moving forward. Thank you very much for your time and expertise.
Hello,I have been using the example for priority inheritance from the FreeRTOS on STM32CMSIS_OS APIv2.0 slide set for some time noe as an example to show to my students how priority inheritance ist working. But since upgrading to STM32CubeIDE v1.19.0 it seems this is not working any more. The is no difference now between using mutexes or semaphores. Has anybody made the sam experience so far?regardsHerbert
I have build the project with Nucleo_U5A55ZJ-Q with 1.4.0 and 6.2.0 library from the start, following the example code (working) with IOC setup (USBPD and USBX). After fixing the CSRST issue earlier with missing __HAL_RCC_SYSCFG_CLK_ENABLE() but I note the demo code do not use this command.The code is running, but there is no COM port (the demo code (2021) did work with COM3). I found the USBPD_DPM_CADCallback(..) is not calling.Below is code found in uspd_dpm_core.c where the DEF_TASK_FUNCTION(USBPD_CAD_Task) is working (via breakpoint), which suggests the interrupt is responding okay. I have spent 5 hours trying to figure out the difference between the generated code (2024) and the demo code (2021). I'm open to investigating why USBPD_DPM_CADCallback(..) is not calling. I attached ioc file. DEF_TASK_FUNCTION(USBPD_CAD_Task){uint32_t _timing;#ifdef _LOW_POWERUTIL_LPM_SetOffMode(LPM_CAD, UTIL_LPM_DISABLE);#endif /* _LOW_POWER */for (
On the STM32H753, I have configured ThreadX with static allocation. When doing a new and delete, where does the memory come from? As well, where does the memory come from when a, for example, std::vector is created on the stack and then increased in size with a concatenation?
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.