Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I'm trying to wrap my head around HAL_GPIO_EXTI_IRQHandler...Why is only the "Pin" used in the parameter, and not the "Port". Really, why not both?According to en.DM00031020.pdf page 382 section 12.2.5 "External interrupt/event line mapping", it appears EXTI# is already mapped to a given Pin# for every port.So if EXTI0_IRQHandler is triggered, it is supposedly meant for ANY port that had a Pin0 assigned, that was interrupted.Let's say I have 2 buttons on PortA,Pin0 and PortB,Pin0.It sounds like they are both tied to that same EXTI0_IRQHandler.When "HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0);" is called inside of it, it is being told it is supposed to do something with Pin0 ("__HAL_GPIO_EXTI_CLEAR_IT" and callback) for that Pin, but there is NO knowledge of what port it's associated with.Let's say 1 of those buttons (PortA,Pin0) is supposed to trigger the opening of a front door, and the other one (PortB,Pin0) for the back door.When the interrupt is called, it knows the button on Pin0 was pre
Hello,I'm trying to use the USB-HS peripheral with the built-in PHY on Nucleo STM32H7S3L8I'm using CubeMX generated code from CubeIDE. I have not chosen the Nucleo board on CubeMX, because it was causing some issues with the MPU. Instead, I've chosen the MCU (STM32H7S3L8).The peripheral times out during initialization at a usb core soft reset, just after enabling the internal PHY. What am I doing wrong? Has anyone been able to use the USB HS PHY on this device/board.This is the USB_CoreReset call where I am getting a HAL_TIMEOUT: HAL_StatusTypeDef USB_CoreInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg) { HAL_StatusTypeDef ret; #if defined (USB_OTG_HS) if (USBx == USB_OTG_HS) { if (cfg.phy_itface == USB_OTG_HS_EMBEDDED_PHY) { /* Init The UTMI Interface */ USBx->GUSBCFG &= ~(USB_OTG_GUSBCFG_TSDPS); } /* Reset after a PHY select */ ret = USB_CoreReset(USBx); ... These are the things in the code which are possibly relev
I am working with AZURE RTOS and I have implemented an HTTP web server application following the application example called Nx_WebServer and prepared for the demo board STM32F429ZI-Nucleo.The example uses files html, js, jpg, svg to create a web site. These files are written in the flash of the STM32F429 starting from address 0x08100000.To write these files into the flash it is necessary to create the file web_demo.bin that is provided with the other files of the example.Now I need to change some of the files of the Web Site (essentially index.html and dashboard.html) an so I have to regenerate the corresponding web_demo.bin, but I not able to do that.Someone can help to do this step?ThanksPS: I have seen an other identical question did by an other community member (@agalindo) in the past, but that question did not have a satisfactory answer.
https://www.st.com/en/microcontrollers/stm32g0-series.html?icmp=tt9016_gl_****_dec2018&querycriteria=productId=SS1960 :but on https://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32-mainstream-mcus/stm32g0-series/stm32g0x1.html?querycriteria=productId=LN2048 there is no mention of USB HOST/DEV, not even in the future products.Is this some oversight, or are 'G0x3 with USB planned?JWPS. Can that picture on website be provided in higher resolution, please?
Hi,I was able to run a demo project on a STM32H573 dev board. I am using ThreadX and NetxDuo, with mqtt addon.I was able to connect to the mqtt broker and send/receive messages.I want also to be able to use the bsd sockets to send packets on layer 2. As far as I have understood, for sending and receiving layer 2 packets I need to use bsd sockets.I followed the doc from github, added the files .h and .c I had to add the line#define TX_THREAD_USER_EXTENSION int bsd_errnoin the user code part of "tx_user.h", so it can survive a code generation.Then I enabled NX_ENABLE_EXTENDED_NOTIFY_SUPPORTandNX_ENABLE_IP_RAW_PACKET_FILTERThen I got into a problem: the redefinitions of structs and function names, so I added#define NX_BSD_ENABLE_NATIVE_APIin the user code part of "nx_user.h"I want to have raw support, so I also added#define NX_BSD_RAW_SUPPORTin the user code part of "nx_user.h"Now I get an error when I compile:"nxd_bsd.c:474: undefined reference to `_nx_driver_har
Hello everyone, I have a problem with sending a variable of type string using the USART interrupt in order to control an SG90 servo with PWM. Initially, the idea was to use keyboard key presses to make the motor rotate either to the right or to the left. The microcontroller is not responding; I tried using my own application as well as RealTerm. I don't understand what could be causing the interrupt not to work. I thought the issue might be related to not handling the flag register, but unfortunately, I haven't been able to figure out the solution. #include "stm32f303xe.h" #include "stdint.h" #include "stm32f3xx.h" #include <stdio.h> #include <string.h> volatile int currentindex=0; volatile int position = 150; volatile char message[50]; void clock_config(void) { RCC->CR |= RCC_CR_HSION; while (!(RCC->CR & RCC_CR_HSIRDY)); RCC->APB1ENR |= RCC_APB1ENR_PWREN; RCC->CFGR |= RCC_CFGR_HPRE_DIV1; RCC->CFGR|= RCC_CFGR_PPRE1_DIV2; //PP
The initialisation code generated (by CubeIDE v1.13.0) leaves both the transmitter and the receiver enabled!This is clearly not a valid state!See: https://community.st.com/t5/embedded-software-mcus/hal-uart-transmit-with-single-wire-half-duplex/m-p/579328
We are continuing having a bear of a time getting the USB2514 to work properly with the STM327H73 both with the USB2514 built into our board and also with the STM327H73 connected to a EVB-USB2514BCQFM36 eval board.The latest issue is as follows:Connect a cdc acm port for serial connection to one of the USB portsConnect a USB storage drive to another port.When writing to the USB drive after a short amount of time the USB drive will hang and ultimately timeout. It appears that the HCINT OUT interrupt is never received for the last write to the USB. The USBx storage thread is hung and there it will stay. Incidentally once the HCINT OUT interrupt gets dropped then there is a subsequent interrupt storm. the symptom is in file X, the bulk output transfer blocks on a semaphore and that semaphore times out. The semaphore is signaled on completion of the transfer in the HC INT OUT interrupt and there is one more send than complete and then the timeout occurs.Has anybody seen anyt
Hello,As far as I know,STM32 does not support the POSIX abstraction layer for FreeRTOS.That means I can not use functions like:Interact with tasks through: 'pthread_create', 'pthread_join'..Use POSIX glue elements like: 'pthread_mutex'...EtcIf I am porting a big FreeRTOS project that is using POSIX to STM32: what I need to do? Is there a way of achieving it painlessly?Thanks,Carles
I am working with STM32 U5A5 series of STM32 controllers and currently facing one issue with ADC1, Getting timeout when we try to enable ADC(this issue we are getting only for ADC1 and ADC4 is working as expected).Below are the codehadc1.Instance = ADC1;hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1;hadc1.Init.Resolution = ADC_RESOLUTION_14B;hadc1.Init.GainCompensation = 0;hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE;hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV;hadc1.Init.LowPowerAutoWait = DISABLE;hadc1.Init.ContinuousConvMode = DISABLE;hadc1.Init.NbrOfConversion = 1;hadc1.Init.DiscontinuousConvMode = DISABLE;hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;hadc1.Init.DMAContinuousRequests = DISABLE;hadc1.Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE;HAL_PWREx_EnableVddA();RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADCDAC;Pe
Hi,The STM32Cube and Azure RTOS hands-on workshop MOOC is missing the example workshop material file. The MOOC link takes one to a single PDF with setup instructions which include a link for "STM32-AZURE-RTOS-WS-Material.exe". This required file is missing from the Google Drive location.Could you please make the workshop materials available?1. MOOC page:2. Google Drive link from above MOOC:3. Workshop setup PDF with link to materials which takes one back to step (2) above:Many thanks,Matthew.
Hello,I am trying to read from ADC with DMA using HAL_ADC_Start_DMA.Only with ADC I can read and printf the values. But once I configure DMA it seems that callback isn't working.I am attaching the main.c as well as the whole project zipped. Is there anything else needed or any other way to utilize DMA for ADC? Would there be a possiibility that the library for HAL_ADC_ConvCpltCallback() not be working?Please, any suggestions would be really appreciated. Thank you/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. *
Hello,I am configuring a project from scratch for a STM32 FreeRTOS based. From FreeRTOS documentation: https://www.freertos.org/Documentation/02-Kernel/02-Kernel-features/01-Tasks-and-co-routines/03-Task-priorities Low priority numbers denote low priority tasks. The idle task has priority zero (tskIDLE_PRIORITY). https://www.freertos.org/Documentation/0 2-Kernel/02-Kernel-features/01-Tasks-and-co-routines/15-Idle-task It is possible for application tasks to share the idle task priority (tskIDLE_PRIORITY). See the configIDLE_SHOULD_YIELD configuration parameter for information on how this behaviour can be configured. https://github.com/maniacbug/FreeRTOS/blob/master/task.h#L125 #define tskIDLE_PRIORITY ( ( unsigned portBASE_TYPE ) 0U ) This matches with what I can see from my project debugging: But, I don't understant why in STM32 code, in 'cmsis_os2.h', IDLE thread priority is '1' instea
Hi I have a NUCLEO-H743ZI2 circuit board. I want to use the network on it to perform TCP Cliant communication without running on RTOS. I have referred to many materials. Are there any examples? thanks
Hello,I am trying to use the HAL_UARTEx_ReceiveToIdle_DMA function() but the IDLE function don't work.I call the function here : /* Extern variables */ extern UART_HandleTypeDef huart4; extern osEventFlagsId_t comEventHandle; extern osMessageQueueId_t sensorQueueHandle; extern osEventFlagsId_t regEventHandle; extern DMA_HandleTypeDef hdma_uart4_rx; static void modbus_receive_DMA(void) { buf_rec = 0; // reset the counter of received bytes in the buffer /* Reset pin for receiving data */ HAL_GPIO_WritePin(RS485_SIEMENS_RE_GPIO_Port, RS485_SIEMENS_RE_Pin, GPIO_PIN_RESET); if (HAL_UARTEx_ReceiveToIdle_DMA(&huart4, nmbs.msg.buf, sizeof(nmbs.msg.buf)) != HAL_OK) { log_debug("HAL_UARTEx_ReceiveToIdle_DMA error"); } } void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) { if (huart == &huart4) { modbus_receive_DMA(); } } void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size) { if (huart == &huart4) { switch (HAL_UARTEx_GetRxEventTyp
Hi, I need few clarifications for reprogramming using internal DFU bootloader with Boot0 pin:1) Can I connect Boot0 pin to any other GPIO and that GPIO will drive Boot0 pin. Initially on power ON, GPIO pin shall be pulled up so that Boot0 is HIGH, and once application is loaded, will drive GPIO to LOW which inturn shall pull Boot0 pin to LOW.2) If Boot0 is HIGH on startup and there is no reprogramming request from Host, will the control jumps to application after any timeout or will it remain in Boot mode forever?3) Intention of Step1 above is to control Boot0 pin through application software. Please clarify above points.
Question about the above PWR_LPSLEEP example code.My test setup includes this:* STM32CubeIDE Version: 1.17.0, Build: 23558_20241125_2245 (UTC).* HAL library STM32Cube_FW_G0_V1.6.2.* NUCLEO-G0B1RE.The example code in main() reduces the clock frequency (lines 123-124):/* Reduce the System clock to below 2 MHz */SystemClock_Decrease(); What is the advantage of the reduced clock frequency, as the Cortex-M0+ CPU clock is already off in LP Sleep Mode? The Reference Manual RM0444 states on page 128that this has "no effect on other clocks or analog clock sources". Does the reduced system clock frequency save power by reducing the clock for all other clocks or analog clock sources?Thank you for your response.
Hello everyone,I’m working on writing a driver for the STM32F411RE microcontroller and have a question regarding the SYSCFG register map. I’ve been referring to the STM32F411 Reference Manual (RM0383)https://www.st.com/resource/en/reference_manual/rm0383-stm32f411xce-advanced-armbased-32bit-mcus-stmicroelectronics.pdf, specifically the SYSCFG section, and I’m a bit confused about the reserved spaces in the register map. typedef struct { volatile uint32_t MEMRMP; // 0x00 - Memory remap register volatile uint32_t PMC; // 0x04 - Peripheral mode configuration register volatile uint32_t EXTICR[4]; // 0x08 to 0x14 - External interrupt configuration registers // 8 bytes reserved? please reassure me stating a reason volatile uint32_t CMPCR; // 0x20 - Compensation cell control register } SYSCFG_RegDef_t; on Table 22. SYSCFG register map and reset values, it does not explicitly state that there are 8 bytes reserved? I’ve carefully reviewed the manual, but I
I am using two ihmo2a1 expansion boards with STM32-Nucleo-F401RE to control 4 stepper motors. When I stack one expansion board on another. The signal given to the first board is transmitted to the second board. I removed comments to define the second expansion board in "xnucleoihm02a1.h" file but it did not work out. What changes have to be made to use more than one expansion board? I would be grateful if you could help me out.
I am trying to use the PLL1 fractional PLL on a Nucleo-U545RE-Q board to fine-tune a frequency measurement. RM0456 rev 5 has the following procedure to adjust the fractional PLL:"If the application intends to tune the PLLx frequency on-the-fly, then:a) PLLxFRACEN must be set to 0 to update the PLLxFRACN value while keeping the PLL running.b) A new value can be uploaded into PLLxFRACN (FracValue(n).c) PLLxFRACEN must be set to 1 to activate the new programed value in PLLxFRACN that is taken into account by the PLL."When using the above algorithm, I found that often the actual fractional-adjusted frequency was wrong. Looking through the STM32CubeU5 code :/* FRACN1 on-the-fly value update */ if ((READ_BIT(RCC->PLL1FRACR, RCC_PLL1FRACR_PLL1FRACN) >> \ RCC_PLL1FRACR_PLL1FRACN_Pos) != (pRCC_OscInitStruct->PLL.PLLFRACN)) { assert_param(IS_RCC_PLL_FRACN_VALUE(pRCC_OscInitStruct->PLL.PLLFRACN)); /* Disable PLL1FRACN. */ __HAL_RCC_PLL_FRACN_DISABLE();
While working on a FLASH writing routing I got stumped with a bunch of flags being set in the SR register. It starts with CFGBSY. reading through the forums someone said they encountered this while accessing an uninitialized pointer. I found that I was doing the same. So my question is this, is there some type of exception or error that is being detected by this uninitialized access that I can see that would lead me faster to know I was using an uninitialized pointer? Thanks
I am using a nucleo-wl55jc1 and I've attempted to setup the example from this tutorial: https://youtu.be/OPrcpbKNSjU?si=mj6qIDGve6GwYWs6However, when I set the timebase source to anything other than SysTick to avoid the warning produced by the cubeIDE software, the example does not function as expected. The example does work if I set the timebase source back to SysTick.The specified LED (blue LED on PB15) never turns on, when I pause the program it shows that it is stuck in an infinite loop in the default handler in "startup_stm32wl55jcix.s", any idea what could be causing this?
Hello,The following code compiles, but doesn't give the me results I'm expecting: void syslog2(uint8_t pri, const char *fmt, ...) { va_list args; va_start(args, fmt); printf(fmt, args); va_end(args); } main() { printf("%s\r\n", _tx_version_id); syslog2(SYSLOG_INFO, "Azure RTOS - %s\r\n", "test" /*_tx_version_id*/); } this is the output:what am I missing?thanksMatthew
Hello,there is a race condition in the function SD_read() in the template file used by CubeMX when using FATFS with DMA template (sd_diskio_dma_template_bspv1.c).if(BSP_SD_ReadBlocks_DMA((uint32_t*)buff, (uint32_t) (sector), count) == MSD_OK) { ReadStatus = 0;The variable ReadStatus should be set to zero BEFORE the call to BSP_SD_ReadBlocks_DMA(), as it is already the case in the BSP V2 template (sd_diskio_dma_template_bspv2.c) and in the examples using FATFS and SD DMA (e.g. Projects\STM32F412G-Discovery\Applications\USB_Host\AUDIO_Standalone\Src\sd_diskio_dma.c).
Open On-Chip Debugger 0.12.0-00024-gc3ff39f8b (2023-06-26-16:51) [https://github.com/STMicroelectronics/OpenOCD]Licensed under GNU GPL v2For bug reports, readhttp://openocd.org/doc/doxygen/bugs.htmlInfo : Listening on port 6666 for tcl connectionsInfo : Listening on port 4444 for telnet connectionsInfo : STLINK V2J45S7 (API v2) VID:PID 0483:3748Info : Target voltage: 3.141085Error: init mode failed (unable to connect to the target) I am getting these error messages while I upload my code to the board. How to solve it? can anyone explain?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.