Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi,When I was using the STM32H743ZI chip, I set the system frequency of the chip to 160 MHz. Only enable the ICache, do not enable the DCache and the MPU.According to the prompt from CubeMX, the maximum peripheral clock is 240 MHz. Therefore, I configured HPRE as 1, as shown in the following figure:During the test, I found that if I disabled the ICache, LWIP was unable to obtain the IP address.If I configure HPRE as 2, LWIP can successfully obtain the IP.Using Wireshark to capture the data on the network, no DHCP protocol was found. That is to say, the Ethernet data was not sent out. However, during the debugging process, the Ethernet data was sent out through the sending function.Using a logic analyzer to test the data of the MDIO bus under the two configurations, I found that the MDIO versions automatically parsed by the logic analyzer were different. However, the values of all the registers of the PHY were the same in both cases, except for the status register. The test results of t
Hi All,I do struggle with high-cycle flash read.By using the example:https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/NUCLEO-H563ZI/Examples/FLASH/FLASH_EDATA_EraseProgramIt is doable to erase/write sector or halfword but reading from address (with simple memcpy) without writing/erasing it just before causes NMI_Handler().How to init/configure the EFLASH to simply retrieve data after startup?Write function: HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD_EDATA, address, (uint32_t)&halfword)Read 'function':uint16_t halfword = *(uint16_t*) address;Regards,Mat
Hi,I have an issue with the UASRT communication being abnormal.First case:Access System Bootload Mode by Options bytesAccess the Main Application by the UART protocol ( UART2)Send the first UART packet to the ST MCU via UART2 that contains the UART error code: 0x4 (Frame Error)Send the same UART packet to the ST MCU via UART2 again without the UART error codeSecond case:Using IDE Debug Mode, break at main()Send a UART packet to the ST MCU via UART2 without the UART error codeI tried to De-Init and Re-Init the UART2, which I expect to reset all the UART2 register values before I send the UART packet. According to my test case, could I say that the UART error code 0x4 is due to System Bootload Mode?How could I fix the issue?Please let me know if more information is required.
Hi Team, I'm new to STM32H7 controller. I've started exploring the shared memory in this dual core controller. I found a great one from MAJERLE. Thanks for that. I used the same concept and made a Flag to check for new data to read and write, it was working okay. But, the time gap between write to read was so huge. I'm not getting why it's so. Then, I tried to poll the while(1) loop by toggling GPIO, to see how frequently it is polling the flag, but I found that the while(1) loop itself running very slow, unable to figure out what causing it slow. Please, guide me to resolve this issue. My requirement is that, I'm trying to share the some amount of data between M4 and M7 at very fast frequency. Suggest the best way to handle this problem.--------------------------------------------------------------------------------------------------------------------------------common.h /* Buffer from CM4 to CM7 */ #define BUFF_CM4_TO_CM7_ADDR MEM_ALIGN(SHD_RAM_START_ADDR) #de
I have generated the code generated from MCSDK 6.4.0 for the micro STM32G431CB to STM32G431RBT6 micro.My understanding is all the Hall drivers remain the same, the startup file and the .ld file will vary based on the micro controller. But i am running into the issue where ADC2 handler is getting called which it shall not as long as the PWM is OFF. There is one signal handler called as shown above i am not sure what it is? I have been struggling to understand, please help.
I have implemented microros on an stm32 nucleo f446re and wrote a publisher in it, while using default qos the messages published can't exceed the frequency more than one hertz even after removing the delay function.....Is there any way to increase the speed of the message publishing this is the code of the thread void StartDefaultTask(void *argument) { /* USER CODE BEGIN 5 */ // micro-ROS configuration rmw_uros_set_custom_transport( true, (void *) &huart2, cubemx_transport_open, cubemx_transport_close, cubemx_transport_write, cubemx_transport_read); rcl_allocator_t freeRTOS_allocator = rcutils_get_zero_initialized_allocator(); freeRTOS_allocator.allocate = microros_allocate; freeRTOS_allocator.deallocate = microros_deallocate; freeRTOS_allocator.reallocate = microros_reallocate; freeRTOS_allocator.zero_allocate = microros_zero_allocate; if (!rcutils_set_default_allocator(&freeRTOS_allocator)) { printf("Error on default allocators (line %d)\n", __LINE__); } // micro
I am just a bit confused about how the CDC examples using USBX work. In the sample I've seen it seems that the code sets up some sort of UART to USB bridge. I think I don't need the UART and wanted to send and process data like the classic library used to do. However, when I remove the UART code, the device enumerates but USBD_CDC_ACM_Activate is now never called. Is the UART essential to using USBX or did I miss something in refactoring the program?
Edit by ST Moderator: This post has been translated from Chinese to comply with the ST Community Terms and Conditions (§10.2). STM32's TIM triggers SPI's DMA send using NSS when MSSI is usedUsing stm32h743, timer TIM12 enable event, spi1 enable NSS, set MSSI to 15 to enable cyclic sending of DMA for SPI and select TRGO of TIM12 as trigger source. STM32的TIM触发SPI的DMA发送使用NSS时MSSI的问题使用stm32h743,定时器TIM12使能事件,spi1使能NSS,将MSSI设置为15,使能SPI的DMA的循环发送,并将触发源选择TIM12的TRGO。 The MSSI has an effect when only the first data sent is delayed during the phenomenon, and none of the later ones have an effect.现象时只有第一个发送的数据会有延时,MSSI有效果,后面的都没有效果。
Hi, I am using an STM32H523 MCU where I transmit some data via SPI (master tx only) in blocking mode.In debug build the SPI behaves as it should be and everything is fine.In release build the SPI CLK line remains high for too long, after the last bit of a transmission has been sent.This results in the (software) CS line going high before the CLK returned to 0 (the DAC7562 slave does not like that)How it looks like in Release:How it looks like in Debug (correct):My code for the transmits: HAL_GPIO_WritePin(GPIOA, CS_Pin, GPIO_PIN_RESET); hal_status = HAL_SPI_Transmit(spi_handle_, data, sizeof(data), HAL_MAX_DELAY); HAL_GPIO_WritePin(GPIOA, CS_Pin, GPIO_PIN_SET); CubeMX config code:void MX_SPI1_Init(void) { hspi1.Instance = SPI1; hspi1.Init.Mode = SPI_MODE_MASTER; hspi1.Init.Direction = SPI_DIRECTION_2LINES_TXONLY; hspi1.Init.DataSize = SPI_DATASIZE_8BIT; hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; hspi1.Init.NSS = SPI_NSS_SOFT; h
I'm using STM32H750Is it possible to read and write like EEPROM in a specific part of the program (the last part of the internal flash area?)?I think it's impossible because there's only one sectorIf possible, I would appreciate it if you could give me an example
tried to set up a USB device serial emulation (CDC) for STM32H563. Started a Free RTOS based project project in STM32CubeMX. But there I only can activate USB as "device_only in the "connectivity" segment but do not find any other USB related settings. I did that previously with the stm32F series and there it was in STmCube, no prob.The generated code also seems not to have the USBD_DESC_Private_Defines or similar things needed. Is it somewhere hidden under another name in STM32Cube? Or does STM32Cube does not support it? Or is this CPU issue? Or do I need to somehow get me drivers from other places and when yes, from where?
Hello,I have an application that shows image from camera from time to time on the screen. This app flashed at 0x7010'0000 and works well when I run FSBL in dev mode from debugger.But if I flash this FSBL at 0x7000'0000 and switch to flash boot app works in general (according to uart output and ethernet activity) but screen flickers.Sometimes correct image appears for very short time.What can cause the problem?(FSBL is almost unmodified Projects/STM32N6570-DK/Templates/Template_FSBL_XIP)
The X-CUBE-LED1642 software seems to have gone missing. There are no links on the web page where you can download it.Should be here: https://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-led1642.html Found this old thread with the same issue, apparently it's been un-fixed: https://community.st.com/t5/stm32-mcus-products/get-the-x-cube-led1642-driver/m-p/372192
Hi,I created the STM32H743 project based on RT Thread and LWIP, only open ICache, if I modify the content of a function, it will lead to the Ethernet transmission success, but there is no data on the MII interface, debugging compared the ETH register under normal communication and the ETH register under abnormal condition. The configuration is the same; Dynamically allocated memory is placed on 0x24000000, and Ethernet descriptors and received data are placed on 0x30040000.In the above case, through multiple tests, it was found that increasing the size of the function block can restore the sending of ETH to normal, such as adding multiple __nop instructions.Why this is the case, and what to look out for if you want to open only ICahe or DCache.static err_t low_level_output(struct netif *netif, struct pbuf *p) { uint32_t i=0; struct pbuf *q; err_t errval = ERR_OK; static ETH_BufferTypeDef Txbuffer[ETH_TX_DESC_CNT]; memset(Txbuffer, 0 , ETH_TX_DESC_CNT*sizeof(ETH_BufferTypeDef));
Any update on when the middleware will be extended to support EPR? The availability of TCPPE or devkits is not really all that important for a software update and probably should not be gating. Should I switch to the HUSB238A instead of the STM32G0?
Hi I configured spdif rx with dma in circular mode and it works fine except that the signal should persist when mcu starts. The "wait for activity before synchronization" has no effect. The code for spdif mostly generated by cubeIDE. Am i missing something or it will not work in combination with circular dma? Also in case if cable was disconnected and connected back, what is the right procedure to restart reception? My attempts only lead to mcu stuck.
Hello STM32 Community,I'm developing a cellular IoT device using STM32L4 and facing an architectural challenge regarding IWDG implementation with long cellular communication timeouts. I'd appreciate your expertise and recommendations.System Overview:Hardware: STM32L4 custom board with cellular modem (Quectel BG95/BG96)Communication: UART-based AT commands with IDLE line interrupt (no DMA)Application: Periodic sensor data transmission to server via UDPPower Management: Device enters STOP2 mode between measurement cyclesIWDG Configuration:Clock Source: LSI (32kHz)Timeout: ~32.8 seconds maximum (IWDG_PRESCALER_256, Reload=4095)Behavior: Once enabled, cannot be disabled; pauses during STOP modesThe Challenge: My low-level AT command function implements timeout-based communication to prevent infinite loops:int <function_name>(const char *command, const char *expected_response, /* other params */, int timeout_ms) { uint32_t start_time = HAL_GetTick(); // Send AT command via UART
Hi allFor some reason unknown to me, my PHYSEL bit in GUSBCFG is not setting, and I don't know why static inline void core_initialisation(void) //from page 3403 { // 1. Program OTG_GAHBCFG register: // - Enable global interrupt mask bit (GINTMSK) // - Enable Rx FIFO non-empty interrupt (RXFLVL) // - Set periodic Tx FIFO empty level (PTXFELVL) // Enable global interrupt (GINT) SET_BIT(USB_OTG_HS->GAHBCFG, USB_OTG_GAHBCFG_GINT); // Enable Rx FIFO non-empty interrupt mask SET_BIT(USB_OTG_HS->GAHBCFG, USB_OTG_GAHBCFG_PTXFELVL); // periodic Tx FIFO empty level // Note: RXFLVL interrupt is unmasked in GINTMSK, not GAHBCFG. // 2. Program OTG_GUSBCFG register: // - Set full-speed device mode (FDMOD) // - Select embedded PHY (PHYSEL) // - Set turnaround time (TRDT) MODIFY_REG(USB_OTG_HS->GUSBCFG, USB_OTG_GUSBCFG_FDMOD | USB_OTG_GUSBCFG_PHYSEL | USB_OTG_GUSBCFG_TRDT, USB_OTG_GUSBCFG_FDMOD | USB_OTG_GUSBCFG_PHYSEL | _VAL2FLD(USB_OTG_GUSBCFG_TRDT, 0x09) ); // 3. Un
Hello, I’m working on a project using the STM32H753 controller, and I have a NOR Flash connected via the FMC interface (BANK1 at address 0x60000000). My goal is to use this NOR Flash memory as a USB Mass Storage Device. I’ve attempted the following approaches: Tried formatting the NOR Flash directly from the host PC — this was unsuccessful. Used FATFS to format the NOR Flash and then connected it to the host PC. The PC detects the filesystem and displays the correct disk size, but I’m unable to create any files on the disk from the host. I’ve searched through the ST forums but couldn’t find any discussions related to using FMC-connected external memories as USB Mass Storage. My questions are: Is it possible to use external memory connected via FMC (like NOR Flash) as a USB Mass Storage device? Can a host PC reliably access and write to memories connected to FMC through USB? Are there any examples or reference projects demonstrating this functionality? Any guidance or suggestions would
I am building a device using a STM32H523RET6 microcontroller on a custom board (self-powered, with VBUS detection). My eventual goal is to operate a USB-CDC interface between the board and a computer for telemetry, but since the only standalone USB example I could find in the STM32CubeH5 examples was HID, I am trying to get a HID interface working first. I do not want to use the RTOS for my device. I have attempted to adapt the code from this example, https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/NUCLEO-H563ZI/Applications/USBX/Ux_Device_HID_Standalone to the H523 device, but the program crashes in the function _ux_device_stack_tasks_run when the function ux_slave_dcd_function is called. As you can see from the stack trace, this is called from the USBX_Device_Process() function which is periodically called. I have been unable to find any detailed information or examples pertaining to USB on the H523 device, so any information or
I need to do a 1024 point FFT on the STM32F446RE Eval Board. I try to integrate the CMSIS-DSP Libraries as mentioned in the forum and it creates errors only and I can't even run the program. I need to do a q15 FFT ,but it is not working. Help me to to integrate CMSIS DSP Library with the STM Cube IDE.This is a simple issue and some ones guidance can help me a lot.
I'm working on building an Ethernet infrastructure using LWIP on an STM32H7 series MCU for various purposes. In this setup, I want to avoid using malloc, and instead rely entirely on LWIP’s memory pool system for all memory allocations. Here's the configuration I’m planning to use:MEM_LIBC_MALLOC 0 // Don't use the standard malloc (i.e., disable mem_malloc from libc) MEMP_MEM_MALLOC 1 // Use mem_malloc for allocating MEMP pools MEM_USE_POOLS 1 // Redirect mem_malloc calls to the defined memory pools MEMP_USE_CUSTOM_POOLS 1 // Enable support for user-defined custom pools MEM_USE_POOLS_TRY_BIGGER_POOL 1 // Allow searching for a larger pool if neededIn lwippools.h, I’ll define custom pools with different sizes like this: LWIP_MALLOC_MEMPOOL_START LWIP_MALLOC_MEMPOOL(24, 128) LWIP_MALLOC_MEMPOOL(16, 256) LWIP_MALLOC_MEMPOOL(8, 512) LWIP_MALLOC_MEMPOOL(4, 1024) LWIP_MALLOC_MEMPOOL(4, 1536) LWIP_MALLOC_MEMPOOL_END For RX, I will use the following structure from STM's LWIP exam
I have tried to measurement the current consumption in standby mode but it is too high. I am using the example "PWR_STANDBY_RTC" listed in AN5315, STM32Cube firmware examples for STM32G4 Series which should work in Nucleo Board G474RE. The values I obtained are in the range of 250 microampers which are quite far from the listed in the datasheet which are around 1.4 [microA]. To measure the current I use a X Nucleo LPM01A. Has anybody worked with that example and obtained the reported values from the datasheet?Does anybody know if it could be a kind of "bug" in the microcontroller?. Please read: https://community.st.com/t5/stm32-mcus-embedded-software/how-to-enter-standby-or-shutdown-mode-on-stm32/m-p/145849Following I attach some images.Thanks in advance!
hey @m.beddi , have you find the solution . i am struck at this too. edit : to reformulate the issue Issue description : I am trying to implement the MSC_Standalone example (USB device mode with SD card) on the STM32469 Discovery board using CubeMX (with USB OTG FS mode). USB initialization appears to work, but the SD card is not recognized or accessible. The program hangs with a timeout error in the SD card command response function SDMMC_GetCmdResp1(), indicating that SD card commands are not completing successfully. I suspect a timing or clock configuration issue, despite trusting CubeMX to handle this. uint32_t SDMMC_GetCmdResp1(SDIO_TypeDef *SDIOx, uint8_t SD_CMD, uint32_t Timeout) { uint32_t response_r1; uint32_t sta_reg; uint32_t count = Timeout * (SystemCoreClock / 8U / 1000U); do { if (count-- == 0U) { return SDMMC_ERROR_TIMEOUT; } sta_reg = SDIOx->STA; } while (((sta_reg & (SDIO_FLAG_CCRCFAIL | SD
Moved from this discussion as it's linked to the embedded software USB and FreeRTOS. My problem has always been that when USB and USART1 are working at the same time, USB as a virtual serial port is not working properly. In my code, two different threads were opened to test, one thread for usart1 and the other thread for the USB virtual serial port. Don't know what's wrong with this?
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.