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
Hello,I'm working on the STM32H735G-DK and try to change LTDC pixel format mode on the fly, but it doesn't work. I'm using the BSP example from example board pack in CubeMX for this board. After reset is possible setup the first time pixel format, but whatever I did after it never work. I tried even did full deinit with HAL_Deinit(), but it simply doesn't work. Pckage version is STM32Cube_FW_H7_V1.12.1For example this functionality (changing LTDC pixel format) working without any problem on the STM32U5G9J-DK2. The main() function where I tried doing this looks like:int main(void) { MPU_Config(); CPU_CACHE_Enable(); HAL_Init(); /* Configure the system clock to 520 MHz */ SystemClock_Config() HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1); BSP_LED_Init(LED1); /*##-1- Initialize the LCD #################################################*/ /* Initialize the LCD */ //BSP_LCD_Init(0, LCD_ORIENTATION_LANDSCAPE); BSP_LCD_InitEx(0, 1, LCD_PIXEL_FOR
Hello,I am using STM32U575RGT6 with CubeMX 6.17 and the bundled X-CUBE-FREERTOS v1.4.0. After enabling USE_TICKLESS_IDLE, I observed that the tick period becomes inaccurate.Specifically, the delay appears to be consistently shortened to about 0.875× of the expected value.void StartDefaultTask(void const *argument) { while (1) { HAL_GPIO_TogglePin(LED_RED_GPIO_Port, LED_RED_Pin); vTaskDelay(400); } }With USE_TICKLESS_IDLE disabled, the delay is approximately 400 ms as expected.After enabling it, the delay is reduced to about 350 ms.I have created a minimal project to reproduce the issue, and it shows the same behavior consistently. The project is attached.Could anyone help explain the cause or suggest a fix?Thank you.
Hi,I am working on a custom Battery Management System (BMS) using STM32L476RG as the MCU, interfacing with an external battery monitor AFE (BQ79656‑Q1).I first validated the MCU hardware and basic firmware by testing the on‑board LEDs and UART communication via test points using USART2. These tests were successful and confirmed that the STM32 configuration and standard UART peripheral are working as expected.After this initial validation, I started implementing the communication between the STM32 and the AFE. For this communication path, LPUART1 is used, while USART2 remains dedicated only for basic UART testing and debug output.As part of this implementation, I took a Single Device Read command frame from a reference software design document for a similar AFE and directly programmed the frame transmission in STM32CubeIDE using HAL UART APIs.While debugging the firmware in STM32CubeIDE, I consistently encounter a “Target not available” issue during execution, particularly when reaching
Hello,I have STM32F7 controller, using Free RTOS, trying to interface external NOR flash, S29GL128S10TFIV13.I have one source file say testCode.cpp, which I want to move completely in external NOR flash, but every time I ran then code it give Hardfault.MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K EXT_FLASH (rx) : ORIGIN = 0x64000000, LENGTH = 16M EXT_SRAM_HEAP (xrw) : ORIGIN = 0x60000000, LENGTH = 256K EXT_SRAM_STACK (rw) : ORIGIN = 0x60040000, LENGTH = 256K } SECTIONS { .isr_vector : { . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); } >FLASH .ext_flash_code : { . = ALIGN(4); _sextflash_run = .; *(.ext_flash_data*) *(.ext_flash_data*) . = ALIGN(4); _eextflash_run = .; } > EXT_FLASH /* 2. SECTION FOR MANUAL ATTRIBUTES (For Arrays) */ .ext_flash_data : { . = ALIGN(4); *(.ext_flash_data) /* Targets __attribute__((section(".ext_flash_data"))) */ *(.ext_flash_data*) . = ALIGN(4
Hello,I was trying to create two heap regions, sing internal RAM and external SRAM. So I tried below, but the code at some point crash and generate hardfault error. Just want to know does the procedure is correct or am I missing something?//in .ld file MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K EXT_SRAM (xrw) : ORIGIN = 0x60000000, LENGTH = 512K EXT_PSRAM(xrw) : ORIGIN = 0x6C000000, LENGTH = 8M } _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */ _Min_Heap_Size = 0x0; _Min_Stack_Size = 0x400; ._user_heap_stack (NOLOAD) : { . = ALIGN(8); PROVIDE ( end = . ); PROVIDE ( _end = . ); . = . + _Min_Heap_Size; . = . + _Min_Stack_Size; . = ALIGN(8); } >RAM .heap_internal (NOLOAD): { . = ALIGN(8); _heap_internal_start = .; . = . + 0x2000; /* 8 KB internal heap */ _heap_internal_end = .; . = ALIGN(8); } >RAM .heap_ext (NOLOAD) : { . = ALIGN(8); _heap_start = .; . = . + 0x40000; /* 256 KB for heap */
As is well known, the ADC sampling rate is on the order of microseconds, while the display task may only refresh once every 100 milliseconds. In an RTOS, how can the display task and ADC sampling values be synchronized? With such a long display refresh cycle, how are the numerous ADC sampling values handled—should they be discarded or stored in a buffer? If stored in a buffer, would it occupy substantial memory space? How do people handle this issue in actual applications?
I have a project that will be using the LIV4F chip. I downloaded and installed X-CUBE-GNSS1 but its description says it is for the LIV3F. Is it compatible with and will it function with the LIV4F chip? I will be using it on the STM32G474CEU6.Thanks!
I'm failing to enable that Interrupt using " LL_RTC_EnableIT_SSRU(RTC) " on STM32H33.Wakeup timer is set to interrupt every 24h (this is working).Alarm A is configured, but not enabled.Alarm B is not used.RTC is set to BCD mode only.Monitoring SSR register ( via "READ_REG(RTC->SSR)" ) I can see it's counting down from 0xFF ---> 0x00, periodically.Some Internet folks told me to enable TAMP Interrupt as well...and intercept TAMP IRQ handler instaead of RTC IRQ handler. It didn't work.Any help would be greatly appreciated.Thanks.
Hello everyone,here are my questions:1. Is there any roadmap or community effort to add NeoChrom/GPU2D support to Zephyr?2. Has anyone successfully integrated the STM32 HAL GPU2D driver alongside Zephyr?3. Would it be possible to:- Initialize GPU2D using HAL in the Zephyr application- Patch Zephyr's LVGL Kconfig to expose Nema GFX options- Use LVGL's existing lv_draw_nema_gfx_stm32_hal.c backend4. Are there any technical blockers (interrupt conflicts, clock management, memory mapping) that would prevent this hybrid approach?I'm willing to contribute if there's guidance on the proper implementation approach.Thank you for any insights.
Hello, all my tools are updated to last ones, and software packages too. I start an empty project using X Cube FreeRtos 1.5 (just a default task). Play the soft with debug, and after a few seconds, press "Suspend" button to break the running program. Then, there are a lot of calls to vPortSetupTimerInterrupt function (port.c) in the call stack. The tick is by default 1ms and cpu clock to 250Mhz. Not sure that is normal? thanks for your help Laurent
Hi all, There are a few options for mp3 decoding but none seem to be for the M33 core MCUs. Source code seems to be missing too: X-CUBE-AUDIO: the precompiled binaries only seems to support M4 and M7 cores.X-CUBE-AUDIO-KIT: this does not natively have an mp3 decoder.STM32-MP3NL/DEC: this looks like a precompiled spiritmp3dec file for M7. I've spend too many hours looking into this and I'm back to where I started. It looks like the best option would be to use X-CUBE-AUDIO-KIT and add an mp3 decoder to audiochain but how? it needs to support the M33 core and ideally have the source code available. I've also read that some people here have used minimp3. I prefer an option supported by ST and I'm not sure that is the case. Comments/suggestions welcome. Thanks.
Hi Team I am trying to do UART bootloader, using cli command. The MCU used is STM32F446RET6 and dev kit used is nucleo-f446re.I am using USART1, for printf and cli command with interrupt. CLI command is used to enter system memory /bootloader but as shared above the programmer is not giving timeout error. void jump_to_bootloader(void) { void (*SysMemBootJump)(void); //system address defined volatile uint32_t addr = 0x1FFF0000; // //introduce delay before switcing to bootloader after printf. // HAL_Delay(200); //disable all interrupt request and stop SysTick __disable_irq(); // SysTick->CTRL = 0; // SysTick->VAL = 0; // // __HAL_RCC_SYSCFG_CLK_ENABLE(); // SYSCFG->MEMRMP = 0x01; //Deinit HAL and all peripheral // HAL_UART_DeInit(&huart1); //reset uart pins and gpio // __HAL_RCC_USART1_FORCE_RESET(); // __HAL_RCC_USART1_RELEASE_RESET(); // HAL_GPIO_DeInit(GPIOA,GPIO_PIN_9 | GPIO_PIN_10); HAL_RCC_DeInit(); HAL_DeInit(); // D
Hello,I am trying to use the newest cmsis dsp library (v1.15) to implement a vector matrix implementation. I am running into a "first defined here error" when trying to build with the cmsis dsp library (v1.15). I created an empty project just to try out building a project with the library included. I am running into the same issue there.I am using STM32CubeIDE version 1.13.1 and an STM32H750 with an M7.If I understand correctly, CMSIS v 1.15 does not have a "lib" folder anymore like the older versions and only the Include, PrivateInclude and Source folders must be integrated. Therefore the instructions in Configuring DSP libraries on STM32CubeIDE - STMicroelectronics Community are not helpful to me.Here you can see the folders I included. Am I missing something? How can I use the newest CMSIS library? I couldn't find any helpful documentation on the internet.Thank you,Leonard
An issue has been encountered with the STM32G474: when the blanking source is selected for the comparator module output, the events of the HRTIM Hi,The complete code files are in the attachment. As shown in the picture above, for the HRTIM module of the G474, Event 4 uses COMP1 as the input source. When the output of the comparator flips due to blanking, the outputs of TA1 or TA2 of the HRTIM event do not change due to the flip of the comparator output.Thanks.
Hello Folks, sorry, I am quite desperate. I try to get my I3C code working, but the read consistently fails and returns a buffer with just 255s and a temperature of 350 degrees centigrade. The weird thing is that the checks I put in work, so it looks like the assignment of the address worked. If I run the code without the sensor shield connected, the checks halt program execution. This is the code I put together from two I3C examples - for the H503 Nucleo, there is no example for the IKS4A1 and the code at https://wiki.st.com/stm32mcu/wiki/Getting_started_with_I3C and in the AN is incomplete:
Hello, I am encountering a specific issue with the system bootloader (I2C interface) regarding the Get CRC command. When sending the Get CRC command sequence via the system bootloader, the STM32U575 ACKs all bytes (Command, Address+XOR, Length+XOR), but the returned CRC value is consistently 0x0000 regardless of the binary file loaded in it. When running HAL_Calculate_CRC() within the user application on the same STM32U575 units, we receive valid, non-zero CRC data. I have tested and confirmed this issue across 2x STM32U575 units using both the stm32flash open source tool and manual scripting via an Aardvark I2C host. To isolate the issue, we tested the exact same scripts and stm32flash commands on STM32G0 and STM32G4 targets and they worked perfectly, returning valid non-zero CRCs when both in application and bootloader mode. Any insight into why the U5 is returning zeros while its predecessors work fine would be greatly appreciated. stm32flash output in the G0: ./stm32
I'm trying to read ADC1 on channel 12 using ADC with DMA in a Zephyr OS environment, but I'm getting a BUS FAULT error when using the adc_read_async() API. This is my prj.conf file CONFIG_LOG=y CONFIG_MAIN_STACK_SIZE=4096 CONFIG_ADC=y CONFIG_ADC_ASYNC=y CONFIG_DMA=y CONFIG_ADC_STM32_DMA=y CONFIG_DMA_STM32=y CONFIG_DMA_STM32U5=n CONFIG_ARM_MPU=n CONFIG_DCACHE=n CONFIG_NO_OPTIMIZATIONS=y CONFIG_CACHE_MANAGEMENT=y CONFIG_NOCACHE_MEMORY=y CONFIG_FAULT_DUMP=2 CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_ISR_STACK_SIZE=2048 CONFIG_ADC_LOG_LEVEL_DBG=y CONFIG_DMA_LOG_LEVEL_DBG=y Overlay / { zephyr,user { io-channels = <&adc1 0>; }; aliases { adc1 = &adc1; }; }; &dma1 { status = "okay"; }; &dma2 { status = "okay"; }; &dmamux1 { status = "okay"; }; &adc1 { status = "okay"; compatible = "st,stm32-adc"; st,adc-clock-source = "SYNC"; st,adc-prescaler = <4>; // pinctrl-0 = <&adc1_in12_pc0>; // pinctrl-names = "default";
It is well-known that when configuring and starting a timer using HAL_TIM_Base_Init and HAL_TIM_Base_Start_IT, the interrupt and callback are triggered immediately. This is because configuring the reload-register & prescaler requires generating an update event (using EGR_UG) which then sets the interrupt flag.The function TIM_Base_SetConfig even contains an attempt to solve this by manually clearing the UIF flag./* Generate an update event to reload the Prescaler and the repetition counter (only for advanced timer) value immediately */ TIMx->EGR = TIM_EGR_UG; /* Check if the update flag is set after the Update Generation, if so clear the UIF flag */ if (HAL_IS_BIT_SET(TIMx->SR, TIM_FLAG_UPDATE)) { /* Clear the update flag */ CLEAR_BIT(TIMx->SR, TIM_FLAG_UPDATE); }However, this does not usually work, probably because the timer runs a little slower than the CPU, and the APB bus also needs a few cycles to transfer the access to EGR. Compiling without optimizatio
Hello, Based on my understanding, in this code /* Run inference by executing epoch blocks until done */ LL_ATON_RT_RetValues_t result; uint32_t total_run_ticks = 0u; uint32_t total_wfe_ticks = 0u; do { uint32_t run_start = tim2_get_count(); result = LL_ATON_RT_RunEpochBlock(&NN_Instance_audio_network); uint32_t run_end = tim2_get_count(); total_run_ticks += (uint32_t)(run_end - run_start); if (result == LL_ATON_RT_WFE) { uint32_t wfe_start = tim2_get_count(); LL_ATON_OSAL_WFE(); uint32_t wfe_end = tim2_get_count(); total_wfe_ticks += (uint32_t)(wfe_end - wfe_start); } } while (result != LL_ATON_RT_DONE); uint32_t npu_end = tim2_get_count(); uint32_t total_us = tim2_ticks_to_us((uint32_t)(npu_end - npu_start)); uint32_t run_us = tim2_ticks_to_us(total_run_ticks); uint32_t wfe_us = tim2_ticks_to_us(total_wfe_ticks); LOGI_I32("NPU inference (us): ", (unsigned long)total_us); LOGI("NPU epoch time (us): run=%u wfe=%u", run_us, wfe_us); calling LL_ATON_OSAL_WFE
Hi everyoneI've got a few questions about the views that show FreeRTOS Semaphores and Queues:1. My application creates a lot of Mutex and Queues, and only the first 63 (or 64 -- I may have lost count) of each type are visible. Is this a feature or a bug? And if I want to see the remainder... any thoughts on how to go about that?2. Here's a screenshot of the Semaphore view:2A: MutexSPI2 is created by CubeMX as a dynamically allocated Mutex using the CMSIS OS wrapper.2B: PS-Global Lock is created with mutex_init(&lock,"PS-Global Lock");whereint mutex_init(mutex_t *_m, const char* mutex_name) { SemaphoreHandle_t *m = (SemaphoreHandle_t *) _m; *m = xSemaphoreCreateMutex(); vQueueAddToRegistry((QueueHandle_t) m,mutex_name); return 0; }I'm guessing that since the 'mutex' is being defined as a Semaphore is why it's not showing up on the list as a MUTEX, but I don't understand why the "Size" and "Free" values are.2C: The remainder of the Semapho
Hello, I am currently working with the STM32G030C8TX microcontroller and I have encountered an issue while reading analog values through the ADC. When I attempt to read ADC values from the PB11 and PB12 pins, the measured values are incorrect or unstable. However, when I use other ADC-capable pins on the same microcontroller, the readings appear to be correct and stable. Because of this behavior, I am unsure whether: PB11 and PB12 pins support ADC functionality on this device/package There is a configuration issue on my side Or there might be a silicon/production-related issue with the chip I would appreciate it if you could clarify whether these pins are valid ADC inputs on the STM32G030C8TX and if there are any known limitations or special configurations required.
I'm confused by ST's seeming definition of what they think a QUAD word is....according to most of the planet a WORD is 16-bits, so a QUAD word is 64-Bits. However according to ST a quad word is 128 bits on the STM32U535.I enclose a section of my code - essentially I want to write 11520 values which are U32's and then read them again when I power it back up, bit its getting confused because I can't get my head around whether there's 64, or 128 bits in a QUAD WORD! xnLookup[][][] is the Parameter I want to write, and the read back which is a U32This is the WRITE: i=0;//Channel 0..3 j=0;//Temperature 0..180 (-50 to +130DegC) k=0;//Term X0, X1, X2, X3 etc n=1;//Counter for every 4th flash word MemCount=0;//Total memory locations //was 11520 for -50 to +130DegC. change to for(m=0;m<11520;m++)//Total number of parameters to write - //12160 { //Copy the polynomial term into the flash array flashdata32[n-1].l=xnlookup[k][i][j].l;//Put the polynomial term onto the fla
I am using an STM32 Nucleo-F767ZI with RMII Ethernet + LAN8742A PHY and an example project based on lwIP/TCP-IP. I noticed a strange behavior: if I comment out MX_USB_OTG_FS_PCD_Init(), Ethernet communication stops working. If I keep it enabled, Ethernet works correctly. The peripheral initialization order is: MX_GPIO_Init(); MX_USART3_UART_Init(); MX_LWIP_Init(); MX_TIM3_Init(); MX_SPI4_Init(); MX_CAN1_Init(); MX_UART5_Init(); MX_USB_OTG_FS_PCD_Init(); Additional observations: SystemClock_Config() does not change Replacing MX_USB_OTG_FS_PCD_Init() with HAL_Delay() does not fix it So it does not look like a timing issue It seems that HAL_PCD_Init() / HAL_PCD_MspInit() for USB is enabling or configuring something indirectly that Ethernet depends on My question is: What could USB FS initialization be configuring that would make Ethernet work, even though they should be unrelated? I am thinking about possibilities such as: GPIO clocks being enabled indirectly MSP/NVIC config
I have already set the MTU to 3000 on the PC side. On the STM32H743 side, I have set the RXBUFFLEN, MTU, PBUF_POOL_SIZE, and other related memory configurations to 3000. I have configured and enabled Jumbo Frame and disable Jabber disable and Watchdog disable with ETH->MACCR |= (ETH_MACCR_JE | ETH_MACCR_WD | ETH_MACCR_JD | ETH_MACCR_GPSLCE);However, when I ping the STM32 from the PC with 1472 bytes, it is successful, but pings larger than 1472 bytes fail. Why is this happening? What have I not configured correctly?
Hello, I am working on STM32 NUCLEO-G431RB using STM32CubeIDE and FreeRTOS (CMSIS-RTOS v2). I am trying to implement the following requirement: Requirement ADC1 → 1 Channel using Interrupt ADC2 → 7 Channels using DMA Both should run simultaneously with FreeRTOS ADC Configuration ADC1 (Interrupt) Single channel (PA0) Using HAL_ADC_Start_IT() Used for detecting external voltage Expected Behavior: When I connect external power supply to PA0 PA0 should show voltage value Remaining 7 channels should show 0 Example: PA0 = 2.5V (Interrupt)PA1 = 0PA6 = 0PA7 = 0PC0 = 0PC1 = 0PC2 = 0PC3 = 0 ADC2 (DMA) 7 Channels: PA1 PA6 PA7 PC0 PC1 PC2 PC3 Configuration: Scan conversion enabled Continuous conversion enabled DMA circular mode Using HAL_ADC_Start_DMA() Expected Behavior: If I connect external voltage to PA1 PA0 = 0PA1 = 2.5V (DMA)PA6 = 0PA7 = 0PC0 = 0PC1 = 0PC2 = 0PC3 = 0 &nb
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.