Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi, I am testing the System Memory UART protocol in STM32G070CB.I tried the Get command, the Go command, and the Read Memory command standalone, all success.However, when I try to execute the Read Memory command, which is successful, and then execute the Read Memory command, the ST does not send any response.Full pattern:Successful Enter Boot Mode:Read Memory CMD with Address = 0x0801FFF0 and read data size is 0x10Try to execute the Read Memory CMD again but without ACK/NACK As I know, the protocol is able to execute other CMD when the pervious CMD completed or Failed. How could I execute CMD continuously? Note: UART Protocol version of the MCU is V3.1
Hello Community,I have been attempting to use the STM32CubeIDE to combine two examples:https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/NUCLEO-U545RE-Q/Applications/ThreadX/Tx_MPUhttps://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/NUCLEO-U545RE-Q/Applications/ThreadX/Tx_SecureLEDToggle_TrustZoneWherein I want to have a ThreadX module within the TrustZone. I have been able to get both examples individually building, flashing, and debugging on my board. However any attempts to add modules/manager to the Trustzone example, and conversely Trustzone to the Module example have been entirely unsuccessful - due to my experience with the tool I am unable to add the middlewares.Is there any example out there doing what I want?Or if not, does anyone have any instructions on how to combine these two projects. My assumption is that the solution will have three subprojects with three distinct linker files, with relevant partitioning of memory:Secure (St
I'm implementing UART communication between an Arduino Uno and an STM32L476RG. When the STM32 acts as the master (transmitter) and the Arduino Uno as the slave (receiver), data transmission works as expected. However, when I reverse the roles—making the STM32L476RG the slave (receiver) and the Arduino Uno the master (transmitter)—the STM32 fails to receive data correctly. I'm looking for a reliable solution to ensure proper UART communication in this configuration.
How is ThreadX expected to be used with the STM32U5 family using the STM32CubeIde?I was expecting to see an X-CUBE-AZRTOS-U5 package like there is for the STM32H7 family which is X-CUBE-AZRTOS-H7. I don't see it. I'm using a STM32CubeIDE 19.0 that I downloaded last night. I do see there are ThreadX examples for the U5 development boards that I have not installed yet. So ThreadX does seem supported.I'm wrapping up an H7 project where I used ThreadX, FileX, and USBX with the STM32CubeIDE with STM32CubeMX so got familiar with how all those work together. I'm in the earliest stages of a new project where I have different criteria so the H7 family isn't a good fit. I'm much more board size and power constrained. The U5 seemed like the best fit.Anyone out there using ThreadX and USBX with a STM32U5 processor? Your experiences? I haven't committed yet but am leaning towards the STM32U575. I need Audio ADC support ie SAI and USB Class 1 audio support p
Hello everyone,I’m currently working with the STM32H723ZG Nucleo board and am trying to interface microROS using UDP transport. I’m using the following environment:STM32CubeIDE: v1.16.1STM32Cube Firmware: H7 V1.11.2Toolchain: GNU Tools for STM32 (GCC 12.3.rel1)I’ve carefully reviewed several guides covering MPU, Ethernet, LWIP, and FreeRTOS configurations. I was able to get microROS working over USART (per the Micro_ROS guide), but when I attempt the UDP transport I encounter a hard fault. I’ve tried replicating setups from the STM32H723_Nucleo_ETH and LWIP_UDP_Echo_Server examples (generated by CubeMX), but they don’t work as expected.My project files are available here: tapererwaj/h723zg_microros_udpBelow, I have summarized my current configuration:MPU Configuration SCB_EnableICache(); SCB_EnableDCache(); /* Region 0: Ethernet DMA descriptors */ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.Number = MPU_REGION_NUMBER0; MPU_InitStruct.BaseAddress = 0x0; MPU_Ini
I am working with STM32 U575/U5A5 series of STM32 controllers in low power mode. I have programmed the controller to enter into Stop 3 mode and wake from stop3 mode based on wakeup Pin(High on PF2). With this implementation issue what we observed is once immediately flashing hex file into controller using STlink programmer, Controller is entering in stop3 mode but it is not waking up from stop3 mode even after low to high transistion on wakeUp pin(PF2). If I remove the power and connect it back, it is working as expected enterning into stop mode 3 and waking up from stop mode 3 on low to high transistion on wakeUp pin(PF2) all the time. The question here is why for the first time after flashing hex file into controller, entering into stop3 mode but not waking up from stop3 mode and requires power reset?low power mode is configured as follows:void LowPowerInit(){ LL_RCC_SetClkAfterWakeFromStop(RCC_STOP_WAKEUPCLOCK_SELECTED); __HAL_RCC_PW
Hi everyone!I'm working on USB MSC implementation on STM32U0 series MCU with W25Q32JV (NOR Flash) by using USBX + ThreadX.W25Q32 Memory organization:- It has 64 blocks and each block is of size 64KB- Each block has 16 sectors and each sector is of size 4KB (Total 1024 sectors)- Each sector has 16 pages and each page is of size 256B (Total 16384 pages)- Total size of flash memory = 4MBI've already created and mounted a file system in W25Q32 using FatFS library. Also created one folder with one text file in it. Then, using USBX I tried to implement the MSC and till now I'm able to achieve these things:1) My laptop (USB Host) is able to detect the device i.e MCU as "USB Mass Storage Device" (in the Device Manager -> USB controllers) and "AzureRTO USBX storage dev USB Device" (in the Device Manager -> Disk drives)2) Coming to the capacity information of this disk, it is showing correctly as 4MB but the volume of the Drive (D:) as 2MB. And when I open the Properties of this Drive
I am trying to get USBX Device MSC to work in Standalone mode (without RTOS) on Stm32u083mc microcontroller. However, I am interested in configuring an external Flash as a mass storage device. i am using the same clock frequency of HID standalone example which i referred from official STM32U0 Work shop tutorial from youtube. Now i am planning for mass storage class, i am defining pool_size and stack_size is from app_usbx_device.h file #define UX_DEVICE_APP_MEM_POOL_SIZE (10*1024)#define USBX_DEVICE_MEMORY_STACK_SIZE (10*1024).from MX_USBX_Device_Init() function i am getting usbd_ok. before returing i am calling these function USBX_APP_Device_Init(); VOID USBX_APP_Device_Init(VOID){MX_USB_PCD_Init(); // Endpoint 0 (Control)HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x00, PCD_SNG_BUF, 0x00); // EP0 OUT at PMA offset 0x00HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x80, PCD_SNG_BUF, 0x40); // EP0 IN at PMA offset 0x40 // Endpoint 1 (MSC Bulk)HAL_PCDEx_PMAConfig(
Hi,I have been working on STM32F4 discovery board, I have developed Bootloader Code. There is 2 option to jump to application that includes blinking led app. First button interrupt runs perfectly, i mean hal_delay() runing with no issue.Second option is, if UART interrupt gets the jump command and address from my computer. In this situation it jumps to application and leds are turn on but not blinking because of hal_delay() func (i guess). In 2 option before the jump func if i use hal_delay() , it crahs also.
Product: STM32F401VET6Firmware Package: STM32Cube_FW_F4 V1.28.0Tool: STM32CubeIDE (latest version)Description:Hi!I’m currently working on a USB CDC device project using the STM32F401VET6 microcontroller with the STM32Cube_FW_F4 firmware package (V1.28.0) in STM32CubeIDE.I have encountered a series of issues when enabling USB_DEVICE with the CDC class. Specifically:The generated project fails to compile due to errors, such as USBD_ClassTypeDef being undefined in some modules (e.g., usbd_ioreq.h), even though usbd_def.h is included and USBD_ClassTypeDef is defined in usbd_def.h.The structure USBD_HandleTypeDef is not recognized in some compilation units, leading to cascading errors.There seem to be conflicts or inconsistencies when including usbd_def.h, especially between header files like usbd_ctlreq.c, usbd_core.c, and usbd_ioreq.c.Even after ensuring all relevant include paths (e.g., Middlewares/ST/...) are configured correctly in the project, the problem persists.I found t
Hi ! I'm working on a STM32F429VET, with keil as an IDE. My problem is the next, this code which is NOT reached (because it need a command from the terminal to be). Make my entire program crash in contact of loop, causing an IACCVIOL if i let this part of the code commented, works fine if i uncomment it. Anybody have encounter similiar behavior ? I dont get it at all.void adc_measure(uint16_t channel, uint8_t *result) { measureInProgress = true; adc_init(channel); HAL_TIM_Base_Start_IT(&htim2); // while (measure_pending_count < NB_MEASURES) // { // // adc_read(); // __disable_irq(); // Prevent race condition // measure_pending_count++; // __enable_irq(); // // } HAL_ADC_Stop(&hadc1); float measure = adc_compute_value(channel); // convert the value toward needed unit (mA or V) //snprintf((char *)result, RESULT_PRECISION, "%f", measure); }
We have been using some code to allow jumping into bootloader from the application that has been working well for many years, but has since failed on all our newest batches of PCBs. All PCBs have the same STM32H743ZIT6 processor, all revision V. The only difference is that the jump is working on processors with bootloader version 0x90, but not on boards with version 0x91. The code for the jump into bootloader is mostly taken from this post.#define USB void Bootloader_Jump(void) { uint32_t i=0; void (*SysMemBootJump)(void); /* Set the address of the entry point to bootloader */ volatile uint32_t BootAddr = 0x1FF09800; #ifdef USB __HAL_RCC_USB_OTG_FS_FORCE_RESET(); HAL_Delay(1000); __HAL_RCC_USB_OTG_FS_RELEASE_RESET(); #endif /* Disable all interrupts */ __disable_irq(); HAL_DeInit(); /* Set the clock to the default state */ HAL_RCC_DeInit(); /* Disable Systick timer */ SysTick->CTRL = 0; SysTick->LOAD = 0; SysTick->VAL = 0; /* Clear Interrupt Ena
Hello,I am making a new project by importing the .ioc file of example code "Ux_Device_CDC_ACM" of STM32U5G-DK2. All the .c files of USB_stack are also copied from the example project. Both, example project and My project, look same. My project builds also successfully. But no COMM port is being formed after loading the project to STM32U5G-DK2 whereas, COMM port is being formed with Example project.What could be the reason ? Please help. With regard,Sudarshan Chaudhary
Hello,I'm working with the STM32N6570-DK board and trying to merge two example projects provided by ST:Project 1 (DCMIPP):https://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/STM32N6570-DK/Applications/DCMIPP/DCMIPP_ContinuousMode Project 2 (USB CDC):https://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/NUCLEO-N657X0-Q/Applications/USBX/Ux_Device_CDC_ACM While merging, I added the following files from Project 1(DCMIPP) into the Project 2(USB CDC) project in Keil: 1 . libn6-evision-awb_keil.a 2 . libn6-evision-st-ae_keil.aHowever, I’m encountering the following build issues:Build target 'Ux_Device_CDC_ACM'armclang: warning: ../../../../../../Middlewares/ST/STM32_ISP_Library/evision/Lib/libn6-evision-st-ae_keil.a: 'linker' input unused [-Wunused-command-line-argument]armclang: warning: argument unused during compilation: '-mfloat-abi=hard' [-Wunused-command-line-argument]armclang: warning: argument unused during compilation: '-mcmse
Hello,After loosing days trying to implement paho mqtt with lwip and freeRTOS on a nucleo-F207ZG, I restarted from scratch and try do implement it in bare-metal mode.After a few hour of debug, using wireshark and mosquitto on a PC :- Connecting to the broker as anonymous works- Connecting to the broker with user/pwd fails.Wireshark shows that there is no user/pwd on the CONNECT packet and the associated flags are reset.The official mqtt_client_connect() looks quite strange : it does not take care of the eventual user/pwd provided in argument (mqtt_connect_client_info_t *client_info)Flags are set to MQTT_CONNECT_FLAG_CLEAN_SESSION, and user/pwd are never used by this function. Is the provided MQTT file is just a demo file with limited functionalities ?Thank youRegards
When I call the tx_event_flags_create() function, the code returns an error at the following line: else if (event_control_block_size != (sizeof(TX_EVENT_FLAGS_GROUP))) { /* Event flags group pointer is invalid, return appropriate error code. */ status = TX_GROUP_ERROR; }I'm not sure why this would be a problem since I only have one TX_EVENT_FLAGS_GROUP defined in my program as far as I can see and the size of the struct passed in should match. Is there anything I could possibly be missing here?
I am trying to setup a local MQTT over a local network with port 1883 and B-U585I-IOT02A using the Nx_MQTT_Client example project. I have followed the steps in :https://community.st.com/t5/stm32-mcus-embedded-software/how-to-connect-stm32u5-b-u585iot02a-using-mqtt-to-local-mqtt/td-p/62128However I still get error: x10005 NXD_MQTT_CONNECT_FAILUREI have tried modifying the generation of code in CubeMX to not require crypto and TLS for the example project however the compiler screamed even more at me. Anybody managed to succsesfully setup MQTT over local network?I disabled firewall on my broker and attempted the communication across other networks, still same error.in my app_nextduo.h file I have set: #define MQTT_PORT NXD_MQTT_PORT // defined as 1883 non-tls in the client .h file#define MQTT_BROKER_NAME "" /* MQTT Server */ // I put the IP here in the form "192,xxx,xxx,xxx" have also tried using construct IP(192, XXX, XXX..)#define USER_DNS_ADDRESS IP_ADDRESS(1, 1, 1, 1) /
In continuation of debugging the Ethernet ping test (from this thread) @Andrew Neil @bouazizm Main issue:When debugging the project, everything works well and i am able to ping the MCUWhen flashing the project, the ping test failsHere are the details of my stm32 cube environment.Operating system: UbuntuSTM32cubeIDE version details:Firmware version : 1.17.3I have attached the project for your reference.Main configuration changes for the project for a successful ping:In the ethernet module: RX and TX descriptors addresses are 0x2007c000 and 0x2007c0a0 respectively.In LwIP , Under General Settings, DHCP is disabled and static IP(192.168.1.125) and mask(255.255.255.0) are providedIn LwIP , Under Key options, MEM_SIZE is 16000 Bytes and LWIP_RAM_HEAP_POINTER is 0x2007c140In FreeRTOS module, the default task stack size increased to 3000 words.In the linker .ld file add .lwip_sec .lwip_sec (NOLOAD) : { . = ABSOLUTE(0x2007c000); *(.RxDecripSect
HiI am in the need to have USB working on the STM32U5G9DK2 board, however I specially do not need ThreadX, so I will configuring USBX in standalone mode. And I do not need to be using UART to complement my sample code as a lot of the sample codes found on CUBEIDE do.What I am looking for is to communicate the board with a terminal on my PC using the USB port rather than the ST-LINK.So far after configuring IOC and complementing main.c with some initialization, I am able to have the PC recognize the board as a Serial Device, which is half the battle. The problem now is figuring out how to send and receive data to and from the PC (I am using a Teraterm terminal). To compliment the information I am providing here, I started by getting the sample code Ux_Device_CDC_ACM, which uses ThreadX and USBX, from which I replaced the used of the UART and instead use both Send and Received Threads to communicate with the Teraterm terminal on the PC, which works well. My issue is that the overhea
Hi everyone,I’m trying to chain two timers on an STM32U585 so that:TIM1 generates a PWM on PA8 at 125 Hz (2 ms high / 6 ms low).TIM8 acts as a 20 µs sampler: it should reset and start counting at the falling edge of the TIM1 PWM, then fire its Update IRQ after 20 µs.So far I’ve tried: // TIM1: 125 Hz PWM at 160 MHz / APB2 htim1.Init.Prescaler = 319; // 160 MHz/320 = 500 kHz → 2 µs tick htim1.Init.Period = 3999; // 4000×2 µs = 8 ms → 125 Hz // … TIM_MasterConfigTypeDef mcfg = {0}; mcfg.MasterOutputTrigger = TIM_TRGO_OC1REF; // TRGO on CCR1-match (PWM falling edge) HAL_TIMEx_MasterConfigSynchronization(&htim1, &mcfg);// TIM8: 20 µs sampling, slave-reset on TIM1_TRGO htim8.Init.Prescaler = 159; // 160 MHz/160 = 1 MHz → 1 µs tick htim8.Init.Period = 19; // 20×1 µs = 20 µs sample interval // … TIM_SlaveConfigTypeDef scfg = {0}; scfg.SlaveMode = TIM_SLAVEMODE_RESET; scfg.InputTrigger = TIM_TS_ITR0; // ITR0 = internal TIM1_TRGO HAL_TIM_SlaveConfigSynchro(&htim8, &scfg); H
Hello,I have got STM32U5G-DK2 and i downloaded the example repository for the same. I build the example (Ux_Device_CDC_ACM) at the original location in Repository folder by opening it in STM32CubeIDE. It builds successfully but when I copy the same example code to another folder and import it in new workspace then I am getting the following error after building the project (Ux_Device_CDC_ACM): 11:06:51 **** Incremental Build of configuration Debug for project Ux_Device_CDC_ACM ****make -j16 all make: *** No rule to make target '/Middlewares/ST/usbx/common/core/src/ux_device_stack_alternate_setting_get.c', needed by 'Middlewares/USBX/UX Device CoreStack/ux_device_stack_alternate_setting_get.o'. Stop."make -j16 all" terminated with exit code 2. Build might be incomplete. 11:06:51 Build Failed. 1 errors, 0 warnings. (took 274ms)This is happening with any project I copy from original repository to my new workspace. I copy these projects just to leave original code untouched.Kindl
Hello,I am working on the STM32H743BIT6 ethernet communication. I am using the external PHY DP83TC814RRHARQ1 for my requirement. I am configuring in CubeMX as USER_PHY under platform settings of LwIP. How can i communicate via external PHY.? Does configuring the pins for this external PHY is enough or do we need to include drivers of DP83TC814RRHARQ1 in the software. Can you help me on this how to communicate with this external PHY.
Hello,in all examples for the STM32H7S78-DK - including the TouchGFX applications - the frequency for the external APS256XXN-OBR-BG PSRAM is set to 200 MHz:extmem_list_config[1].PsramObject.psram_public.FreqMax = 200 * 1000000u; But in the datasheet for the APS256XXN-OBR-BG, seehttps://www.mouser.at/datasheet/2/1127/APM_PSRAM_OPI_Xccela_APS256XXN_OBRx_v1_0_PKG-1954780.pdfit says that the default maximum read and write clock is 133Mhz, see page 16 and 18:It also says:"Write latency, WLC, is default to 5 after power up. Use MR Write to set write latencies according to writelatency table. When operating frequency exceeding Fmax listed in the table will result in write data corruption." Could the be a potential bug in the memory configuration of the STM32H7S78-DK board, which could lead to RAM corruption? Thank you and best regardsrk_iot
Hi, I tried adding APPKEY on the flash to read from bootloader to find if valid application there or not. I added as below in scatter file :EXCLUDE app_key.oAPPKEY 0x08043FF8 FIXED { ; 0x08013FF0 = last 16 bytes of 64KB appapp_key.o (.app_key)} and in app_key.c, below lines are added:__attribute__((used))__attribute__((section(".app_key")))const unsigned int APPKEY = 0xFEFFFEFF;But once code is built, changes done in scatter file are disappearing and also when I check in map file, app_key is not getting allocated in specified location of flash
Hello, I have a STM32U585CIUA and generate a PWM with 125Hz 2ms high and 6ms low phase on TIM1 on PA2.I would like to start another PWM with TIM2 50Khz 1us high and 19us low on the falling edge of PA2, which is then stopped after 200 cycles.In all my setting attempts, however, TIM2 starts before TIM no matter how it is configured and even if I set the HAL for TIM2 after TIM1 in the code...Can anyone help me with this?Dave static void MX_TIM1_Init(void) { /* USER CODE BEGIN TIM1_Init 0 */ /* USER CODE END TIM1_Init 0 */ TIM_ClockConfigTypeDef sClockSourceConfig = {0}; TIM_MasterConfigTypeDef sMasterConfig = {0}; TIM_OC_InitTypeDef sConfigOC = {0}; TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; /* USER CODE BEGIN TIM1_Init 1 */ /* USER CODE END TIM1_Init 1 */ htim1.Instance = TIM1; htim1.Init.Prescaler = 319; htim1.Init.CounterMode = TIM_COUNTERMODE_UP; htim1.Init.Period = 3999; htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim1.Init.Repetit
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.