Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
@STTwo-32, I also noticed issues in the EXTI.Sample:stm32h7s7xx.h, &(EXTI->PR1) == 0x58000088STM32H7S.svd, &(EXTI->PR1) == 0x58000020When should we expect the upcoming release (in 2 month?)?Also, are there public script which validate that stm32*.h and .SVD do match?
The problem only happens when a constant stream of data is being send to the UART. When I update my firmware sometimes DMA won't work. It is hard to debug when it only happens when updating and not every time. This post is exactly the same issue as mine: DMA issue post In the first image below are the registers when DMA won't work. The second image are the registers when DMA is working correctly.I looked at every register and tried manually resetting and staring the DMA, but still sometimes after an update DMA won't work. I can;t find the source of why this happens and why it won't work even when I hardware reset the controller. I looked at the HAL datasheet and validated the steps needed for DMA. I'm really out of option. If someone has an idea on what to check or knows a solution (maybe don't use DMA but interrupt?).problem no problem UART/DMA init hdma_uart5_rx.Instance = DMA1_Stream0; hdma_uart5_rx.Init.Channel = DMA_CHANNEL_4; hdma_uart5_rx.Init.Dir
Hi I am trying to run freeRTOS on STM32f407 so I want to know at what frequency my clock will run let me share you my clocking diagram too. another doubt how to enable SysTick_Handler. other external interrupt I have enabled like this NVIC_SetPriority(TIM2_IRQn, 0x00); NVIC_EnableIRQ(TIM2_IRQn); NVIC_SetVector(TIM2_IRQn, (uint32_t)&TIM2_IRQ_Handler); Note : #define configSYSTICK_CLOCK_HZ ( configCPU_CLOCK_HZ ) #define configCPU_CLOCK_HZ ( ( unsigned long ) 16000000 ) is it correct B.R Ashish
Hi, I am having some problems with my stm32H755. I tried to make a http server without FREERTOS.The problem is that my project doesn't build because fsdata.c is not found. I'm a bit lost because CubeMx generates the middleware file outside the M7 project I'm working on.In Cube MX I just enable ethernet and LWIP on the M7 core. With httpd enabled in LWIP config.
HLOI am using STOP2 Mode in my controller is stm32l496 series it entering the stop2 mode but it's not coming out for waking up i use external interrupt .interrupt is generating before entering stop2 mode but it not generated after the stop2 mode.what is the problem. HAL_SuspendTick(); // Optional: clear EXTI pending bit __HAL_GPIO_EXTI_CLEAR_IT(GPIO_PIN_0); // Replace with your EXTI pin // Go to STOP2 HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); // Restore clocks SystemClock_Config(); // Re-initialize GPIOs including EXTI pin SystemReInit(); // or reconfigure the EXTI pin here manually HAL_GPIO_WritePin(LED_RED_GPIO_Port, LED_RED_Pin, SET); // Debug HAL_ResumeTick(); void EXTI0_IRQHandler(void) { /* USER CODE BEGIN EXTI0_IRQn 0 */ /* USER CODE END EXTI0_IRQn 0 */ HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0); /* USER CODE BEGIN EXTI0_IRQn 1 */ /* USER CODE END EXTI0_IRQn 1 */ }Code formatting applied - please see How to insert source code for future reference.
Greetings, I’m working on a project with the [NUCLEO-H563ZIT6].My setup includes Azure RTOS and STM32CubeIDE.I started with the Nx_TCP_Echo_Client example (from STM32H573I-DK V1.3.0) as a foundation.I’ve tailored the project so the board sends a TCP frame to a server running on a PC (python script), connected via an RJ-45 wire.Since I’ve set a static IP for the NUCLEO as below: I turned off DHCP, as it’s not required.However, when I ping the board using its assigned IP, it doesn’t respond, and during debugging, the nx_tcp_client_socket_connect API returns a 0x38 error. Can anyone suggest what might be causing this issue? Appreciate any help! Thanks in advance.
I try run on 431CB and have issues. EE_Init return error. Work this X-Cube-EEPROM realy on CB or only on RB ??? Howto correct ?
Hello,i am trying to implement Openamp to in a project with touchgfx. In the beginning i started with openamp and it worked. M7 was the master, M4 the slave and i had a working implementation. It turned out that encoders etc are better handleled on the M7 near touchgfx so alot of the project was rewritten. What i added is 8 AD converter with 200kHz sampling frequency which is handled by DMA. 32kB of the D2 Ram where reserved and protected by the MPU. Since i want to calculate a fft, the ad samples get copied to the dtcmram which is i also added in the linker file. Since the M4 now only handles the network communication, it seemed better suited as the master for openamp. It can initiallice OPENAMP while touchgfx is busy setting up everything else and then starts a task to join as slave. I couldnt get it to work. I always got hard faults. I changed it back to the same configuration as it was before but i cant get it to work. There is a hardf fault every time the M4 try to init th MX_OPEN
When initialising a UART using CubeMX generated code, either the receiver or transmitter or both are enabled. Typically that means that before receiving data with the UART for the first time, the RDR register should be cleared (or the RXFRQ function used), to clear out any junk that got read during boot. But if using DMA RX mode I've discovered an extra consideration - if an error is received before calling HAL_UART_Receive_DMA() for the first time, the error handler will be called. The default HAL_UART_IRQHandler() (at least in stm32u5xx_hal_uart.c) aborts the DMA RX on error (regardless of the DDRE setting). So the user is required to restart if necessary. This leads to an awkward situation where the error handler (which has to restart DMA RX) can be called before HAL_UART_Receive_DMA() is called for the first time. Rather that handling that strange edge case, it seems prudent to eliminate the undesirable order of operations. Specifically, is there a sens
In the first version of I2C module, as used in 'F1 through 'F4, in I2C_CR2 register, there is an enable bit for the event interrupt.Throughout the narrative in the I2C chapter (including the I2C interrupts subchapter and the table and figure therein), this flag is consistently called ITEVFEN.In the register's description (and in the CMSIS-mandated device headers), this flag is called ITEVTEN.Unify, please.JW
I connected a external button on my PCB board and am trying to use it to toggle another GPIO Pin (PA8) with HAL_GPIO_EXTI_Callback()I connected the button to PC4 on my NUCLEO board and is configured as follow: /*Configure GPIO pin : PC4 */ GPIO_InitStruct.Pin = GPIO_PIN_4; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; GPIO_InitStruct.Pull = GPIO_PULLDOWN; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); In the User Code 4 Section: void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if(GPIO_Pin == GPIO_PIN_4){ HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_8); } } In stm32g0xx_it.c: void EXTI4_15_IRQHandler(void) { /* USER CODE BEGIN EXTI4_15_IRQn 0 */ /* USER CODE END EXTI4_15_IRQn 0 */ HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); // PC4 HAL_GPIO_EXTI_IRQHandler(B1_Pin); /* USER CODE BEGIN EXTI4_15_IRQn 1 */ /* USER CODE END EXTI4_15_IRQn 1 */ }What I dont understand is when I push the button using this configuration it works:In main while-loop: if(triggerDetected==1) { if((HAL_GetTick()-trigge
There is a new Digital Power software expansion pack for STM32Cube, X-CUBE-DPOWER.https://www.st.com/en/embedded-software/x-cube-dpower.html.Does anyone know if the default code generated will immediately work on STEVAL-ISA172V2?https://www.st.com/en/evaluation-tools/steval-isa172v2.html
Hello, this is my equipment: 1) MCU STM32G0B1RETx (LQFP64 packaging) on a custom board.2) STM32CubeIDE Version: 1.17.0.3) STM32CubeMX Version 6.13.0.For visual indicators (LEDs flashing) we use the TIM4 CH1 in OC Toggle mode (no output). The timer configuration was created with the MX software.TIM4 CH1 generates a periodic signal with a frequency of 2 Hz, which requires a CCR1 value of 5000:CCR1 value = f_TIM4_CNT_CLK / (2 * f_TIM4_CH1) = 10000 Hz/(2 * 1 Hz) = 5000The relevant source code is listed below. It is loosely based on the ST HAL example 'TIM_OCToggle': Our solution includes two main steps:* The function TIM4_sequence_start() initiates the timer OC toggle sequence, while* the function HAL_TIM_OC_DelayElapsedCallback() counts the interrupts and stops the OC toggle sequence after the specified number of interrupts, that is, 2 x LED flashes.Problem description:Our solution partially works. The timer OC toggle sequence does not start every time the function TIM4_sequence_star
I have a simple project set up for the stm32h573II-DK that has USART1 set up and I can print to serial out over the same USB connector that uses ST-LINK with HAL_UART_Transmit(&hcom_uart[COM1], MSG, sizeof(MSG), 100);. I can not use HAL_Delay(1000); to print every ~1 second. When entering the HAL_Delay function, I can see with a debugger that uwTick is never incremented and with breakpoints I can see that the systick handler is never called. I made a project that doesn't have TrustZone set up and it can print every one second. I do not think this is an ISR priority issue, as I am calling HAL_Delay() from main(). All of the code was generated with cubemx and the only edits I've made were to add the print. What could I be doing wrong to prevent the systick interrupt from being handled correctly?
First suggestion after internet inquiry:// Initialization procedure: RCC->APB1ENR = 0b00000000000000000000000000000010; TIM4->PSC = 15; TIM4->ARR = 65534; TIM4->CR1 = (1<<0); // Function: void delay_US(uint32_t us) { uint32_t i; for( i = 0; i <= us; i++ ) { /* Clear the count */ TIM4->CNT = 0; /* Wait UIF to be set */ while((TIM4->SR & TIM_SR_UIF) == 0); /* ?!?!? */ /* Reset UIF */ TIM4->SR &= ~TIM_SR_UIF; } } I need a short common µs-delay - any ideas for the marked µc?
Hi, see above. I am using a custom G030F6 breakout board with the intent to install FreeRTOS and use this small device as a learning exercise as I usually use larger MCUs and super loops. My first hurdle is my RAM usage with a blank, generated projected. I get the following error when I configure FreeRTOS using STM32CubeIDE (I also get the same error if i import freertos manually and use the same memory allocations) and then compile a brand new project:section `._user_heap_stack' will not fit in region `RAM'I understand this to mean that my memory allocations are too large to fit within the available RAM. My chosen device has RAM of 8KB. My config is as follows: #ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H /*----------------------------------------------------------- * Application specific definitions. * * These definitions should be adjusted for your particular hardware and * application requirements. * * These parameters and more are described within the 'configura
Hi, I wrote a standard (DFT)Discreate fourier transform code (code is not the issue), in NUCLEO-F207 board using zephyr RTOS. I build the same program for NUCLEO-F767 board and flashed. The time taken to execute DFT code in NUCLEO-F207 was 8700 micro seconds. The time taken to execute the same code in NUCLEO-F767 is 65000 micro seconds. FPU(Floating point unit) is enabled for NUCELO-F767 board Hardware and softwares are completely same for both the boards How is it happening what is the potential cause ?
I am trying to implement the HTTP server and two TCP servers on Port 5000 and 5001 using FreeRTOS, but what I notice is if I try to connect all these three simultaneously it is failing, only gets to connect if other two are not connected.Controller used: stm32f407vgt6FreeRTOS API: CMSIS v2Clock configuration: 168Mhz with source HSII am using Hercules to check the connection over TCP.While debugging I am not getting any hardfault errors too. I tried increasing the size, and also by changing priorities. But I am not able to work this out.My tcpserver2.c is exactly same as tcpserver1.c except for the port address. tcpserver1.c#include "lwip/opt.h" #include "lwip/api.h" #include "lwip/sys.h" #include "tcpserver.h" #include "string.h" static struct netconn *conn, *newconn; static struct netbuf *buf; static ip_addr_t *addr; static unsigned short port; char msg[100]; char smsg[200]; /**** Send RESPONSE every time the client sends some data ******/ static void tcp_thread1(void *ar
Hi,I am disappointed that in the STM32CubeIDE BSP packages for Azure RTOS (ThreadX/FileX/LevelX, X-CUBE-AZRTOS-L4.2.0.0), there is an OSPI NOR Flash memory OctoSPI option (Macronix MX25LM51245G Octo- SPI NOR Flash memory), but NO Quad-SPI NOR Flash memory option!Please add a QSPI NOR Flash memory option (e.g. Macronix MX25L25645G) ASAP, to allow those of us that are using ThreadX/FileX/LevelX with the OSPI interface (e.g. on the STM32L4P5 processor), to connect with QSPI memories, without having to "roll our own".FWIW, there are three QSPI flash chips in the "Board Part STM32Cube-BSP-Components" section, however none of these can work with the L4's OSPI interface, they all require a QSPI interface, which is unavailable/unable to be added when using L4P5.There is little to no guidance on how to set any of this up, and it seems to be a common need. The OSPI interface is easily configured for QSPI operation, so this LevelX QSPI-memory-over-STM32-OSPI-peripheral addition should be readily
I'm trying to use the Azure FileX with the LevelX NOR OSPI driver to access a QSPI memory. I'm using an STM32H723 processor an OctoSPI peripheral to try to interface to a Winbond W25Q128JV QSPI NOR memory. Part of my struggle is there are examples of H7 processors with QSPI peripherals interfacing to QSPI memories. And H7 processors with OSPI peripherals accessing OSPI memories. But nothing with the OSPI to QSPI memory combination.I'm currently using a Nucleo-144 H723 board interfaced to a custom IO board that has the QSPI memory on it. I originally started with an F7 nucleo board (with QSPI) but couldn't get the Azure USBX to work with the F7 so changed to the H723 and the OSPI came as a "bonus".I'm early in the process of trying figure out what I need to do with getting the software configured into my configuration. CubeMX will generate lx_stm32_qspi_driver_glue.c and lx_stm32_ospi_driver.c code. There is also an option to include an OSPI Macronix memory
Hi, I am triyng to develop custom bootloader. My application address is 0x08180000 and bootloader address is 0x08000000. I can start with the bootloader and jump to the application successfully. while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ HAL_UART_Transmit(&huart1, (uint8_t *)"HELLO", strlen("HELLO"), HAL_MAX_DELAY); HAL_Delay(1000); }The application send "HELLO" message over UART. but when I set MPU configurations I cant see the message coming from application. Here is my MPU configuration.void MPU_Config(void) { MPU_Region_InitTypeDef MPU_InitStruct = {0}; /* Disables the MPU */ HAL_MPU_Disable(); /** Initializes and configures the Region and the memory to be protected */ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.Number = MPU_REGION_NUMBER0; MPU_InitStruct.BaseAddress = 0x08000000; MPU_InitStruct.Size = MPU_REGION_SIZE_1MB; MPU_InitStruct.SubRegionDisable = 0x0; MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0; MPU_
Dear all, I am developing a project using the STEVAL-DPSG474 board. I want to use a COMP module to trigger event on HRTIM output and I want to know the state of this COMP. To highlight the strange behaviour, I am using COMP 2 (and 3) connected to external event 1 (and 5). External event 1 is then selected as SET and RESET sources for an HRTIM output E1. External event 5 remain unused. I feed both COMP with same signal. My observation is that reading the COMP state using HAL_COMP_GetOutputLevel (or reading directly the CSR register) return always 0 for COMP 2 and the expected state for COMP3. HRTIM output also works as expected and toggle everytime the internal level is crossed. Therefore, COMP2 is working correctly but its status is unknown. Is this an expected behaviour of the COMP module? Is there any way of knowing the state of the COMP module when it is used as a SET/RESET source for HRTIM? Thanks and Best
The compiler is correctly warning about an int to char conversion for the following code from syscalls.c:extern int __io_getchar(void) __attribute__((weak)); ... __attribute__((weak)) int _read(int file, char *ptr, int len) { (void)file; int DataIdx; for (DataIdx = 0; DataIdx < len; DataIdx++) { *ptr++ = __io_getchar(); // Warning here } return len; }Whilst the behaviour here is as intended (assuming EOF is not expected), the warning is a pain for any projects using -Wconversion.Could this please be fixed by adding a cast?*ptr++ = ( char )__io_getchar();This is for an STM32G484CEUx device, if that's important.
Hey I have a Custom Board with a STM32H743IIT6 (Rev V) (My IOC is attached) i have a clock source with 25 MHZ, and the SDCARD is connected over 4 Bits, and Clock Divider 5.My code runs on main function in to the Error_Handler with Reason "HAL_SD_ERROR_UNSUPPORTED_FEATURE" when no SD-Card is inserted. When i insert a SD-Card befor i powered up, the code runs and the LED is blinking in 1 sec.is this a bug? why must i inserted a sdcard for the boot sequence?main.c:int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MPU Configuration--------------------------------------------------------*/ MPU_Config(); /* Enable the CPU Cache */ /* Enable I-Cache---------------------------------------------------------*/ SCB_EnableICache(); /* Enable D-Cache---------------------------------------------------------*/ SCB_EnableDCache(); /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash int
I'm trying to teach myself digital signal processing on an STM32F407-based Discovery board, and I'm hitting a wall with audio glitches. I'm hoping someone with more experience can find what I cannot.My goal is to synthesize audio (initially sine/triangle waves) in real-time and output it through the on-board CS43L22 DAC. I’m using STM32CubeIDE for programming, including its CubeMX module for device setup.The problem is that I'm getting persistent audio artifacts - clicks, pops, or buzzing - that I can't seem to eliminate. The nature of the artifacts has changed as I've tried different fixes, but root the cause remains mysterious.What I've Tried:Basic Blocking I2S: Started with the simplest approach: HAL_I2S_Transmit() in the main loop. Got lots of clicking and buzzing. Learned this was a bad idea because it blocks the CPU.DMA with Circular Buffer: Switched to HAL_I2S_Transmit_DMA() with a circular buffer. This is supposed to be the right way to d
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.