Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
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
Dear all,I have been modifying the VENC_SDCard_ThreadX example and wanted to start some activity based on the user button, triggered by interrupt using the usual HAL + BSP helpers to init the gpio, and registering a handler function for falling flanks.So I tried BSP_PB_Init(BUTTON_USER1, BUTTON_MODE_EXTI);and implemented BSP_PB_Callback(). Symptom: Hitting the button turned the program to be stuck in some unrelated irqhandler (debugger name-clash -- the defaulthandler triggered), the callback has not been triggered.I had a look at the BSP implementationn and retried the same with HAL functions, same effect, this code in BSP_PB_Init() sparked my interest: (void)HAL_EXTI_GetHandle(&hpb_exti[Button], BUTTON_EXTI_LINE[Button]); (void)HAL_EXTI_RegisterCallback(&hpb_exti[Button], HAL_EXTI_COMMON_CB_ID, ButtonCallback[Button]);which registers a callback, and further down the line in stm32n6xx-hal-driver-exti.c there is an HAL_EXTI_IRQHandler implementation which
Hello world!I want to move a motor with serial commands. I use the stm32g051 PWM and a DC motor. And for the sake of lower consumption of energy and cpu I use a dma in circular mode. And of course I want to change the pwm from time to time. But somehow, there is always a delay of more than 10 seconds between the calling of the function and the change in the motor behaviour. mid_error_t tim_forward_buffers(void) { for (uint16_t i=0; i<PWM_BUF_LEN; i++){ pwm_ch1[i] = (uint32_t)(param.speed * (htim2.Init.Period-2))/ MAX_SPEED; //pwm_ch1[i] = 0; // htim2.Init.Period; pwm_ch2[i] = 0; } __HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_1, pwm_ch1[0]); __HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_2, pwm_ch2[0]); return MID_ERROR_OK; }You may guess that the PWM_BUF_LEN is too big... There is just one element in pwm_ch1 and pwm_ch2. What may cause this problem? I use the __HAL_TIM_SET_COMPARE to change the pwm faster and the pwm_ch1 pwm_ch2 just contain one elem
Using STM32CQubeCLT 1.20's libnano:I am trying to print an uint64_t using inttypes.h via an vsnprintf(line, sizeof(line), fmt, ap) wrapper and the sending the line via UART to a Terminal.However, using print_wrapped("%" PRIu64"\n", (uint64_t)1) gives only an output of "lu\n".I know that for floating point support I need to add -u _printf_float to the linker options. Is there something similar for 64bit integers? Or do I have to compile my own version of libnano?
Hi ST Community,I create LBPAM application which continuously convert ADC4 data channel 22 (PC4) of STM32U575 VGTX.I add HAL_DBGMCU_EnableDBGStopMode(); so I can debug in stop mode. I run LPTIM1 and ADC4 before going to STOP mode. I also move VoltageData buffer to SRAM4 uint16_t VoltageData[32] __attribute__((section(".sram4")));LPBAM configuration contains one queue in Circular mode and only one node for ADC4 conversion.After enter stop mode 2, no adc4 trigger, and VoltageData always is 0.I attach my configuration so you guy can check it.Thank you.
Hi all,I'm planning to get STM32H573I-DK to evaluate X-CUBE-AUDIO-KIT Livetune because there are project examples for specific boards and this is one of them. I'll be using an STM32U5A9 MCU eventually and both have an M33 core. This should make it easier to port from one to the other. I see that there are two versions of STM32H573I-DK: MB1677-H573I-D01 Board schematic has a WM8904 audio codec and MB1677-H573I-C02 Board schematic has a CS42L51 audio codec. This last one is marked as "Discontinued Product" by the manufacturer.Do the examples for STM32H573I-DK work for either version of the board without any modification or does it require a specific version/codec?Thanks.
hello,I encountered a problem while developing for stm32u585.I change the iwdg reload value by HAL_IWDG_Init(), and then HAL_PWR_EnterSTANDBYMode(), but the new reload value does not take effect: hiwdg.Instance = IWDG; hiwdg.Init.Prescaler = IWDG_PRESCALER_64; hiwdg.Init.Window = 4095; hiwdg.Init.Reload = 3600; hiwdg.Init.EWI = 0; HAL_IWDG_Init(&hiwdg); HAL_IWDG_Refresh(&hiwdg); HAL_Delay(300); //more than one downcount HAL_PWR_EnterSTANDBYMode();if delay before refresh, it seems work hiwdg.Instance = IWDG; hiwdg.Init.Prescaler = IWDG_PRESCALER_64; hiwdg.Init.Window = 4095; hiwdg.Init.Reload = 3600; hiwdg.Init.EWI = 0; HAL_IWDG_Init(&hiwdg); HAL_Delay(300); //more than one downcount HAL_IWDG_Refresh(&hiwdg); HAL_PWR_EnterSTANDBYMode();Is this the correct process ? If I want to ensure the modification is successful, what should I pay attention to
Title edited to clarify that this is about accessing a file located on a Host PC hello ST Community, I'm trying to open a binary file with the fopen function for a STM32L5 microcontroller, but it always gives me a null value. The code is like this: char filepath[256]; sprintf(filepath,"%s","C:\\fileBIN.bin"); FILE *file; file = fopen(filepath,"rb"); if(file == NULL) { printf("Error occurred opening file. \r\n"); } else { printf("File opened successfully. \r\n"); } It always gives me a null value but the path exists and is correct. What's wrong? Thanks for supports
Greetings! There's an errata for the STM32F6/STM32F5 chips that goes like this: 2.4.1 Extra data written in the FIFO at the end of a read transferDescriptionWhen all the conditions listed below are gathered:• QUADSPI is used in indirect mode.• QUADSPI clock is AHB/2 (PRESCALER = 0x01 in the QUADSPI_CR).• QUADSPI is in quad mode (DMODE = 0b11 in the QUADSPI_CCR).• QUADSPI is in DDR mode (DDRM = 0b1 in the QUADSPI_CCR).• A data is read in the instant when the FIFO buffer gets full at the end of a read transfer, an extra data is unduly written in the FIFO buffer.WorkaroundsApply one of the following measures:• Read out the extra data until the BUSY flag goes low, then discard the extra data.• After reading out all the expected received data, set the ABORT bit of the QUADSPI_CR register to flush FIFO and keep the BUSY flag low. The last register configuration is kept. I believe this is also present on the STM32F769NI chip. I have done extensive research on this.
I am looking for a software solution for this race condition:* The power button is connected to both the On/Off pin PD3 and the wakeup pin PB5. See the partial schematic.* The issue is that the STM32G0 enters shutdown mode, but immediately wakes up. Please see my function below.What is missing? Thank you! void Enter_Shutdown_Mode(void) { sprintf(msgString, "Enter_Shutdown_Mode...\r\n"); Debug_Print( msgString ); HAL_Delay(50); /* Enable the Power Controller (PWR) APB clock */ __HAL_RCC_PWR_CLK_ENABLE(); /* Wait for the pin to be HIGH after the button release. If the power button is currently pressed (LOW), entering shutdown with "LOW" polarity will cause an instant restart. */ while (HAL_GPIO_ReadPin(WAKEUP_GPIO_Port, WAKEUP_Pin) == GPIO_PIN_RESET) { // Wait for user to release the button HAL_Delay(10); } // Debounce the button press HAL_Delay(50); /* Clear the Wakeup Flag. If a flag is set from a previous wakeup, the MCU will fail to enter Shutdown and
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.