Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi everyone,I used STM32CubeMX (version 6.11.1) to generate the initialization code for an STM32G491RCT.The toolchain is configured as a Makefile project.At the end of the C_SOURCES definition, it specifies sysmem.c and syscalls.c.# C sources C_SOURCES = \ Core/Src/main.c \ ... Core/Src/sysmem.c \ Core/Src/syscalls.cHowever, those two files were not generated, resulting in the following error:make: *** No rule to make target 'build/sysmem.o', needed by 'build/firmware.elf'. Stop.Is this a bug in STM32CubeMX or am I supposed to implement the functions myself?
I have enable IN1, IN2 and IN5 as ADC inputs. IN1 is called TEMPERATURE. IN2 is called CURRENT and IN5 is called POTENTIOMETER. The DMA is enabled with normal mode and it's called by the Complete Conversion Callback function every time the TIM1 is updated. So, there are also 3 elements in my DMA array. The first element in the DMA array is IN1 and the middle is IN2 and the last one is IN5. In my current situation, IN2 is always zero because there is no voltage at CURRENT (PA1). But sometimes IN1 and IN2 switch position when ADC is sampling data....or DMA switch their place. I don't know. I can see that this occurs sometimes and IN1 gets a zero and IN2 get the same value as IN1 had just before. Thi will occurs once every 15 seconds.Data:Processor: STM32F051R8T6STM32CubeIDE: 1.16.1Firmware: STM32_Cube_FW_F0 V1.11.5Question:How can I take control over the ADC sampling for each element for the DMA? I want to make sure that the ADC scanning the inputs in the correct order and not
Hello,Configuring the I2S on CubeMX on STM32G431, for which I've connected a microphone in PDM, I want a sampling frequency of 48KHz@16bit.Typically, this requires a PDM frequency of 3.072MHz and a decimation of 64.I wonder why I need to tell CubeMX the sampling frequency, since the decimation factor is configured externally to CubeMX (in PDMTOPCM lib).To have a PDM clock of 3.072MHz, I actually have to select a value of 192KHz for "selected audio frequency" in CubeMX, and not 48KHz.I'm a bit confused...
hello,I am working on a design using MB1684 with STM32C011 as target. I configured UART2 as half duplex, TX only, so that I could use it for debugging, and I discovered that CubMX generates code which causes the board to hang, because it waits for both TX and RX sides to be ready. It is necessary to manually correct the generated code to have a working board.Below is the generated code and the correction: static void MX_USART2_UART_Init(void) { /* USER CODE BEGIN USART2_Init 0 */ /* USER CODE END USART2_Init 0 */ LL_USART_InitTypeDef USART_InitStruct = {0}; LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; /* Peripheral clock enable */ LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_USART2); LL_IOP_GRP1_EnableClock(LL_IOP_GRP1_PERIPH_GPIOA); /**USART2 GPIO Configuration PA2 ------> USART2_TX */ GPIO_InitStruct.Pin = DBG_UART_Pin; GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.OutputType = LL_GPIO_OU
I used CubeMX 6.12 to generate code and DAC output works as intended.I cloned that project, migrated to CubeMX 6.13 and generated code. DAC output doesn't work. Migration to 6.13 also used FW H5 1.4 instead of 1.3.Comparing stm32h5xx_hal_msp.c I see the 6.13 generated code lacksRCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; if(hdac->Instance==DAC1) { /* USER CODE BEGIN DAC1_MspInit 0 */ /* USER CODE END DAC1_MspInit 0 */ /** Initializes the peripherals clock */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_DAC; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { Error_Handler(); } }in HAL_DAC_MspInit(). When I add the above code to stm32h5xx_hal_msp.c in the migrated project, DAC output works as expected.No significant differences between the IOC files.Is there a problem with CubeMX 6.13?Attaching STM32H563VIT6_2.ioc (original, CubeMX 6.12, DAC works) and NGC_HW_Verification_Clone.ioc (cloned, CubeMX 6.13, DAC does
Hi,I am trying to "generate code" using an existing .ioc file. When I click on "generate code" , it is stuck. I am not able to close the window. I had to restart my laptop. I uninstalled and installed again. Tried the same process. But it didn't work. Need help.
Hi, I'm using the last version of STM32cubeMX. When trying to generate a makefile project for the STM32L073RZ microcontroller. The resulting makefile is wrong. Build target are nonsense: ########################################################################################################################## # File automatically-generated by tool: [projectgenerator] version: [4.5.0-RC5] date: [Mon Feb 24 12:20:46 CET 2025] ########################################################################################################################## # ------------------------------------------------ # Generic Makefile (based on gcc) # # ChangeLog : # 2017-02-10 - Several enhancements + project update mode # 2015-07-22 - first version # ------------------------------------------------ ###################################### # target ###################################### ###################################### # building variables ###################################### # debug bu
If I activate the calibration output 1 of the RTC, CubeMx lags and afterwards marks the options red with "unkown conflict". GPIO does not get assigned or gets cleared if done manually before. Same behavior for 1Hz and 512Hz output. OUT2 works. restarted application and PC, still the sameuC: STM32H7R7L8H6HCubeMX V6.13.0FW versions see below Thanks and regards
I'm experiencing complete failure in generation of new projects. Using either CubeMX or CubeIDE it is the same behavior.Generate a new project like I've done for 10+ years, only to find the folder structure missing almost everything required to build a project.Standard structure:This is selecting STM32CubeIDE as the Toolchain / IDE 2025-02-16 22:15:09,802 [INFO] ProjectBuilder:3289 - Time for Copy HAL[1] : 24mS. 2025-02-16 22:15:09,807 [INFO] ProjectBuilder:4876 - Project Generator version: 4.5.0-RC5 [Fatal Error] :-1:-1: Premature end of file. 2025-02-16 22:15:09,868 [ERROR] AbstractXmlFileManage:141 - Premature end of file. 2025-02-16 22:15:09,900 [INFO] ConfigFileManager:1579 - The Die is : DIE482 2025-02-16 22:15:09,905 [INFO] ApiDbMcu:508 - Load IP Config File for FILEX 2025-02-16 22:15:09,909 [INFO] ApiDbMcu:508 - Load IP Config File for LEVELX 2025-02-16 22:15:09,916 [INFO] ApiDbMcu:508 - Load IP Config File for NETXDUO 2025-02-16 22:15:09,919 [INFO] ApiDbMcu:508 - Lo
I am using an stm32F103 and have configured PB4 as a output pin and this works correctly. However when the chip is reset, this pin is automatically pulled high. It appears that this behavior exists because of the pin's dual use as NJTRST. Is there a way I can reconfigure the chip so that this pin will no longer be pulled high when the NRST pin is pulled low?Thanks.
As far as I can tell from the datasheet for the STM32H753VIH, as well as the part selector in CubeMX, the device should have an OctoSPI peripheral.However, when I create a project with the device and go to the connectivity tab, I don't see the OctoSPI peripheral listed like I do in other parts.Is this an issue with CubeMX or does this part not actually have an OctoSPI peripheral in this package?The package is the 100 pin TFBGA with 0.8 mm pitch.Thanks
The only HCLK frequency possible is 40MHz (ofcourse i need higher freq)Please help me resolve this.
Good day,after troubleshooting some issues related to a bootloader, I have figured out that the address of the interrupt vector table (SCB->VTOR) is defined in a hard-coded, non linker aware way as "SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET". This means, if the FLASH region is relocated to make space for a bootloader, it requires manual changes to "VECT_TAB_OFFSET".Is there any reason, why we don't use the address of "g_pfnVectors" (the actual vector table) instead? This would always point to the vector table as defined in the startup code.Of course, I can simply add "SCB->VTOR = (uint32_t)&g_pfnVectors;" to the start of the main(), but I'm trying to understand, why the default value is hard-coded instead of using the actual table location.Can someone explain that to me? CubeMX Version: 6.12.0Controller: STM32C031K6TxAlso on STM32G431 with an older CubeMX version
In STM32CubeMX 6.13.0 - Application Structure is Basic and gray.I solved it by editing the ioc file, it remains gray, but at least "Advanced" is selected and the code is generated accordingly.I changedProjectManager.MainLocation=SrctoProjectManager.MainLocation=Core/Src Is it intended to work like this?
Good Morning All,I have good experience on stm32 microcontrollers and cubemx, but I am new when it comes to LwIP.I followed some basic setups to generate the code using CubeMX tool.1.Selected the board as Nucleo-F207ZG,configured clock on 120Mhz.2.Enabled Ethernet module in RMII mode,configured UART3 just for debugging.3.Enabled LwIP stack and I didn't change any settings for this.I followed what by default settings were there.I have some info on LwIP so I new we need to call MX_LWIP_Process() function in while loop.I made such code that until the board gets IP address it stays in while loop and movement it gets the IP address it breaks that loop and jumps to next while loop in which only MX_LWIP_Process() function is running.Key Option Settings I am here because I am able to ping the board from my laptop,but not able to connect to the software Hercules(TCP Server).I have attached my code zip and also pasted the main.c code.
Good Morning All,I have good experience on stm32 microcontrollers and cubemx, but I am new when it comes to LwIP.I followed some basic setups to generate the code using CubeMX tool.1.Selected the board as Nucleo-H753ZI and set clock to 120MHZ.2.Enabled Ethernet module in RMII mode,configured UART2 just for debugging.3.Enabled LwIP .my goal is to setup the TCP server on STM32.But im unable to do so.when i generate the code and start running the program m facing the issue in command prompt like connection issue or host unreachable or request timed out . firstly im not conformed about configuration setting i need to do so that it works according to my requirement.some people say to change the stack size and RAM size but im unable to deal with them and confused regarding the out.coming to physical connection,i connected my nucleo board with PC and ethernet cable from PC to the board.can anyone help me in this regard and let me know what configuration i can make in cubeMX so that i can
Hello everyoneI changed my PC to one with Win11 and I cannot install the CubeMX.After I downloaded and started the setup, the extracting windows appears and after the splash screen remains opened for few second and then close.Nothing else, I have a project to finish at my job and I do not have success with any of the trick in the forum.Please help me Leonardo Orazi
Hi!I have created a few projects to practice working with the STM32H series. Then, I selected SPI or I2C and used GPDMA linked-list. According to many tutorials, I should have gone to the utilities folder to configure GPDMA, but such a folder did not exist. I performed this on two PCs. CubeMX is up to date. Janusz
I enabled this option to activate the virtual COM port for debug reasons: It is a CMake Project to be opened in VS-CodeEnabling the Virtual Com Port in CubeMX results in this error in VS Code:Crawling in the files, I found that the stm32h5xx_nucleo_conf.h the USE_BSP_COM_FEATURE is not enabled.Enabling this manually will result in many more errors:Generating the code again will reset the USE_BSP_COM_FEATURE to 0.Did I forget or overlook something?
Hi, I am using the STM32G0B1CBTx on the STM32CubeMX and setting the I2C1 for SMBus-two-wire-Interface. I want to disable the timeouts but I noticed that when I do so, the clock timeout enable (bit 15 of I2C_TIMEOUTR register) is still high. Looking at the generated timeout value to be written in the register (0x0000830D), it shows that indeed, the STM32CubeMX is enabling the timeout even though I selected Disable. Below is a screenshoot showing this. Is this a bug in MX ?
Hello,I am using STM32H730ZBT6 with STM32 CubeMX V6.12.1 (I am not using the newest version because of the problem related in topic Downgrade STM32CubeProgrammer in STM32CubeIDE. I dont' know exactly if CubeMX would reproduce the problem, but for the case...) and I have detected 2 problems in code generation:1. Eventhough I am using peripheral SDMMC2 the code generated in file "fx_stm32_sd_driver_glue.c" is prepared for SDMMC1. Here a code portion as example: extern SD_HandleTypeDef hsd1; #if (FX_STM32_SD_INIT == 1) extern void MX_SDMMC1_SD_Init(void); #endif 2. If the option "Generate peripheral initialization as a pair of '.c/.h' files per peripheral", some erros ocur because "fx_stm32_sd_driver_glue.c" file doen't know where to find functions and instances, and is necesary to include "sdmmc.h" file. A part of those twoo problems, in functions "void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)" and "void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd)" hsd is not used, so
Moved from MPUs forum; STM32F072 is an MCU - not an MPU.Hi,I've just started a new project for a STM32F072 chip using STM32CubeIDE 1.17.0.When adding FreeRTOS support to my project, the program hangs soon after osKernelStart() is called.I had hard time finding the culprit.The problem is that the SysTick_Handler() present in cmsis_os2.c is not used (It is surrounded with #if defined(SysTick) / #endif).Because os this, the default handler is called (infinite while loop).I've worked around this problem by copying the SysTick_Handler() function in my code. But this problem should be fixed in the STM32CubeIDE code generator.Best regards,Nicolas
I get this error in downloading files in side stm32cubemx:error downloading the following files: crdb_full.zip
The new CMake generation is great! It's very tastefully done (toochain file, presets, simple CMakeLists.txt, etc).My request: I want to add some additional compiler flags (like `-Wconversion`) to my project.In the top CMakeLists.txt I did:```cmaketarget_compile_options(${CMAKE_PROJECT_NAME} PRIVATE"-Wconversion")```The problem is that it applies to the HAL as well, generating an endless stream of errors.I could create a new cmake target for my own functions, but I wish the generated CMake template would support this out of the box. Regards,Gabriel
Hi,We are working on a board with the STM32H7S7Z8J6 in a BG144 package. We use cubemx to create the correct pinout for this part, but we see the datasheet has different pinout then the CubeMX tool. Is this a bug in CubeMX?
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.