Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I’ve written a stm32 C program on the Stm32CubeMX environment, and it builds with zero errors and warnings. However when I debug, it gives me an error. (See attached photo) Any help to fix it would be amazing!
STM32H743. Attached ioc file. I have wwdg enabled but when I generate code the call to MX_WWDG1_Init(); in main.c is removed. Has anyone seen something similar?
Hello Everyone,I am using STM32G474RE and the STM32CubeMX version is 6.5.0.When ADC5 enables temperature sensor�?Vref and Vbat channel, STM32CubeMX will generate code in MX_ADC5_Init function(LL library):/** Configure Regular Channel */ LL_ADC_REG_SetSequencerRanks(ADC5, LL_ADC_REG_RANK_1, LL_ADC_CHANNEL_VREFINT); LL_ADC_SetChannelSamplingTime(ADC5, LL_ADC_CHANNEL_VREFINT, LL_ADC_SAMPLINGTIME_2CYCLES_5); LL_ADC_SetChannelSingleDiff(ADC5, LL_ADC_CHANNEL_VREFINT, LL_ADC_SINGLE_ENDED); LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC5), LL_ADC_PATH_INTERNAL_VREFINT); /** Configure Regular Channel */ LL_ADC_REG_SetSequencerRanks(ADC5, LL_ADC_REG_RANK_2, LL_ADC_CHANNEL_TEMPSENSOR_ADC5); LL_ADC_SetChannelSamplingTime(ADC5, LL_ADC_CHANNEL_TEMPSENSOR_ADC5, LL_ADC_SAMPLINGTIME_2CYCLES_5); LL_ADC_SetChannelSingleDiff(ADC5, LL_ADC_CHANNEL_TEMPSENSOR_ADC5, LL_ADC_SINGLE_ENDED); /** Configure Regular Channel */ LL_ADC_REG_SetSequencerRanks(ADC5, LL_ADC_REG_RANK_3, LL_ADC_CH
..
Just like what I did in G4, I was able to add PDM2PCM in F3 namely F334 and F302.https://community.st.com/s/question/0D53W00001TGJ2wSAH/why-is-pdm2pcm-not-enabled-for-stm32g4-in-cubemxPls add PDM2PCM in F3 as well.
Why do some documents use Cube-MX instead of the MX inside of Cube-IDE? I can open an IOC with Cube-IDE and do everything Cube-MX does and more so why are so many examples using just Cube-MX? I downloaded the current version of Cube-MX but it is very slow, like watching paint dry compared to Cube-IDE
I am using STM32CubeMX for projects. Due to the configuration of our system. I set the firmware location to an alternate directory using the Project Manager tab. Everything generates fine. However, if I save the project, close it and reopen it, the firmware location setting is not saved.What is going on?
Hello,I think there is a room for improvement in the cube when we create a project with LwIP and FreeRTOS. With the recent HAL update 1.10.0, whole ethernet driver changed and with it also the addresses where the buffers can be saved. With this our ethernet stop working, but we managed to fix it. I know there is an example in \STM32Cube\Repository\STM32Cube_FW_H7_V1.10.0\Projects\NUCLEO-H723ZG\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS and I used it for the correct settings of the linker sections and MPU settings. However, in the generated ethernetif.c file there is missing this code:#if defined ( __ICCARM__ ) /*!< IAR Compiler */ #pragma location = 0x30000400 extern u8_t memp_memory_RX_POOL_base[]; #elif defined ( __CC_ARM ) /* MDK ARM Compiler */ __attribute__((section(".Rx_PoolSection"))) extern u8_t memp_memory_RX_POOL_base[]; #elif defined ( __GNUC__ ) /* GNU Compiler */ __attribute__((section(".Rx_PoolSection"))) extern u8_t memp_memory_RX_POOL_base[];
Hi ST,In CubeMX (5.6.0), when I want to use FreeRTOS - it would be fine when the functions like prvSetupTimerInterruptwere WEAK because usually is needed this functon edit by user, and there is no good idea to change it always after regeneration project by CubeMX.Thank you :).Jan.
Please. In STM32CubeMX I want to set the same priority for RTOS timers and for tasks - what is equivalent of osPriorityNormal... what Number should I set for timer priority?Thank you. Jan.
Hi,I have previously been using the CubeIDE for STM32 developement. Recently I switched to using VScode with makefiles. This has been a very positive upgrade in my opinion, but today I met a problem. I tried to include the CMSIS DSP library to my project. I use the cubeMX software to generate the makefiles for me. In my makefile I defined the following LDFLAGS:####################################### # LDFLAGS ####################################### # link script LDSCRIPT = STM32H750VBTx_FLASH.ld # libraries LIBS = -lc -lm -lnosys -larm_cortexM7lfsp_math LIBDIR = -Ldsp/lib LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections -static While trying to compile I get the following error:Drivers/CMSIS/Include/cmsis_gcc.h:1852:57: error: conflicting types for '__QSUB' 1852 | __attribute__((always_inline)) __STATIC_INLINE int32_t __QSUB( int32_t op1,
All input fields in the RTC section for dates and times suggest that I'm entering a decimal value. But the generated code interprets my input as Hex.I.e. if I enter 10 in the field for the RTC alarm seconds, the code sets "sAlarm.AlarmTime.Seconds = 0x10;"This confusion arises because the value check of these fields can only be "Decimal" or "No Check". When I check "Hexadecimal", the selection stays at the last selected choice.STM32CubeIDE 1.8.0Selected MCU in CubeMX: STM32L422RBIx
Iam using STM32L452RC. I want my controller to go in sleep mode when received an interrupt from USB CDC. While exploring I got these two lines from data sheet The Normal Sleep mode stops the processor clock, but all peripherals keep on running. On the STM32 clock tree, that means:■ FCLK (Cortex Clock) stops■ All the other activated clocks runThis says FCLK (Cortex Clock) stops. Will this affect the timers. I use TIM2 for my project which is a general purpose timer.
HI,I have a custom board with FMC NOR memory S29GL512S11 controlled by STM32H7A3. I created one external loader to flash the NOR memory and works wells. When I try to use the same configurations with the SYSCLK 280MHz and FMC clock 140MHz I can't have any access to the memory.I try to find one way to calculate the right timings for both devices to configure the FMC module, but with the memory datasheet and RM0455 I don't understand how I can make the right configuration.At the moment I have this configuration: hnor.Instance = FMC_NORSRAM_DEVICE; hnor.Extended = FMC_NORSRAM_EXTENDED_DEVICE; hnor.Init.NSBank = FMC_NORSRAM_BANK1; //HAL_NOR_MspInit(&hnor); //HAL_NOR_DeInit(&hnor); NOR_Timing.AddressSetupTime = 7; NOR_Timing.AddressHoldTime = 15; NOR_Timing.DataSetupTime = 2; NOR_Timing.BusTurnAroundDuration = 3; NOR_Timing.CLKDivision = 16; NOR_Timing.DataLatency = 17; NOR_Timing.AccessMode = FMC_ACCESS_MODE_B; hnor.Init.NSBank = FMC_NORSRAM_BANK1; hnor
SDMMC: I can't select DMA for SDMMC in STM32CubeFMC/LCD: Is there a BSP-library for easier lcd-interaction planed?
Configuring the NUCLEO-L452RE via HAL using nothing but the default values for the board in STM32CUBEIDE and setting PA8 as the master clock output to monitor HSI16, the clock frequency at PA8 is 16MHz. When configuration is done via LL (Project Manager -> Advanced Settings), the clock frequency at PA8 is 14.7MHz. The ICSCR register has these values:HAL: HSITRIM 0x0 HSICAL 0x9bLL: HSITRIM 0X10 HSICAL 0X6bThe Reference manual shows that the HSICAL value is read only, so I assume it should be loaded at reset by the hardware, and not under software control. I need to set the HSICAL to the correct value while using LL. How can I do this? Note that by setting the HSITRIM to its maximum value only brings the HSI16 up to 15.4MHz while the HSICAL value is 0x6b.
I'm using STM32G070KBT6 controller. I'm trying to use external RTC and External RTC were ( DS1341). i2c based RTC.Here is my code/* Private user code ---------------------------------------------------------*//* USER CODE BEGIN 0 */// Convert normal decimal numbers to binary coded decimaluint8_t decToBcd(int val){ return (uint8_t)( (val/10*16) + (val%10) );}// Convert binary coded decimal to normal decimal numbersint bcdToDec(uint8_t val){ return (int)( (val/16*10) + (val%16) );}typedef struct { uint8_t seconds; uint8_t minutes; uint8_t hour; uint8_t dayofweek; uint8_t dayofmonth; uint8_t month; uint8_t year;} TIME;TIME time;// function to set timevoid Set_Time (uint8_t sec, uint8_t min, uint8_t hour, uint8_t dow, uint8_t dom, uint8_t month, uint8_t year){ uint8_t set_time[7]; set_time[0] = decToBcd(sec); set_time[1] = decToBcd(min); set_time[2] = decToBcd(hour); set_time[3] = decToBcd(dow); set_time[4] = decToBcd(dom); set_time[5] = decToBcd(month); set_time[6] = decToBcd(ye
Hi, anybody,I am using STM32F407ZG/STM32F429IG to build two similar control board. The main function issome host send amount of data, about 1M bytes (STM32F407 with FSMC/SRAM) or 32M bytes (STM32F429 with FMC/SDRAM)to STM32 and stored in memory. Then after some control command, the STM32 MCU control GPIOsto drive another board. The problem is: both STM32F4 MCU claim that they have up to 100M bpstransmit speed, but I only got about 100 kbps.The base code is generated with STM32CubeMX, enabled FreeRTOS with CMSIS_v2 API, LwIP (2.1.2) and mbedTLS (used for&
The Clock Configuration tab in CubeMX is not happy and I cannot figure out what the problem is exactly. I only want to use HSE a 25MHz external clock source in BYPASS. And I do not intend to use the PLL. Is this a bug in the tool? How can I satisfy this clock configurator?
I have the M4 sysclk set to 200MHz, in the Clock Configration. HAL_RCC_GetSysClockFreq() on the M4 core returns 64MHz. This is being run on the STM32H757I-EVAL board. Any ideas on what I may have set wrong? The M7's sysclk is set to 400MHz and HAL_RCC_GetSysClockFreq() returns 400MHz, as expected.
Hello,We just purchased the STM32H753I-EVAL2 board and have a problem with initializing the SD card device.With CubeMX, we create a default project:- new project/board selector/STM32H753I-EVAL2- "Initialize all devices with their Default Mode" --> YesWhen we test the generated firmware, we get an error when calling the MX_SDMMC1_SD_Init function. The HAL_SD_Init function will generate a timeout.The SD card sold with the product is correctly installed.We use SDMMC1.We try with/or not with external transceiver.We try with/or not with MDMA "SDMMC1 data end".Why do we have this issue when using the default settings ?Best regards,
In CubeMX 6.5.0. I detected a missing clock specification for OctoSPI: void PeriphCommonClock_Config(void){ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; /** Initializes the peripherals clock */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_ADC|RCC_PERIPHCLK_SPI3 |RCC_PERIPHCLK_SPI2|RCC_PERIPHCLK_SPI1 |RCC_PERIPHCLK_UART8|RCC_PERIPHCLK_FDCAN |RCC_PERIPHCLK_USART6|RCC_PERIPHCLK_UART7  
I have configured ethernet and LWIP using stm32cube ide. But ethernet connection is not established.
The impact of log4j vulnerabilities CVE-2021-44228 and CVE-2021-45046 for STM32Cube tools has been assessed by the development team, and the tools can be used without risk.STM32CubeMX,STM32CubeIDE,ST-MCU-FINDER-PC The log4j version used is not impacted by CVE-2021-44228No risk of remote code execution using CVE-2021-44228STM32CubeMonitor-RF, STM32CubeMonitor-UCPD, STM32CubeMonitor-PWR The log4j version is impacted by the CVE-2021-44228 (log4j version 2.8.1)There is no internet and no remote access for this tools, so attacker would have to be logged on the computer and need to have access to tool GUI to inject data in log4j. No risk of remote code execution using CVE-2021-44228STM32CubeProgrammer,STM32CubeMonitor :log4j is not used for this toolsNo risk of remote code execution using CVE-2021-44228
i had used used cubemx 5.5 and in 'System Core' => 'SYS' configurated the 'Time Source' as TIM7 and enabled the option 'Enable Full Assert'On running the project a had an assert that fails over the Preempt Priority value for the timer (TIM7)The PreemptPriority value for the HAL_NVIC_SetPriority variate from 0-15, but when the HAL_RCC_ClockConfig function is called is this value 16. (max 4 bits long) .The reason comes from the File STM32F4xx_hal.c where uwTickPrio is defined as follow:uint32_t uwTickPrio = (1UL << __NVIC_PRIO_BITS); /* Invalid PRIO */In main.c with the function HAL_Init() is the PreemptPrioity value correct but with the SystemClock_Config() function is the PreemptPrioity value overridden by the uwTickPrio value.The issue comes from the WEAK function HAL_InitTick in the weak function is the uwTickPrio initialized, but the HAL_InitTick is overridden in the stm32f4xx_hal_timebase_tim.cSo the only possible solution i had found is to
ST Community highlights – April to June 2026
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.