Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi,I want to partially configure GPIO's using HAL and CubeMX. In my simple case, I just want to enable/disable the pull-up resistors while running a program.At first I looked up, how the pins get initialized by CubeMX:There's this structure, which you have to fill using all parameters.typedef struct { uint32_t Pin; // Specifies the GPIO pins to be configured. uint32_t Mode; // Specifies the operating mode for the selected pins. uint32_t Pull; // Specifies the Pull-up or Pull-Down activation for the selected pins. uint32_t Speed; // Specifies the speed for the selected pins. uint32_t Alternate; // Peripheral to be connected to the selected pins }GPIO_InitTypeDef;=> I could use that, if I would be able to get the parameters I selected in CubeMX, but there's no such function as "void HAL_GPIO_Get_Config(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_InitTypeDef *GPIO_Init)"...The next thing I heard of is the LL (low level) driver (https://community.st.com/s/question/0D50X00009X
Help me in initialization.Here is the initialization i made/* SAI1 init function */void MX_SAI1_Init(void){ /* USER CODE BEGIN SAI1_Init 0 */ /* USER CODE END SAI1_Init 0 */ /* USER CODE BEGIN SAI1_Init 1 */ /* USER CODE END SAI1_Init 1 */ hsai_BlockA1.Instance = SAI1_Block_A; hsai_BlockA1.Init.AudioMode = SAI_MODEMASTER_TX; hsai_BlockA1.Init.Synchro = SAI_ASYNCHRONOUS; hsai_BlockA1.Init.OutputDrive = SAI_OUTPUTDRIVE_DISABLE; hsai_BlockA1.Init.NoDivider = SAI_MASTERDIVIDER_ENABLE; hsai_BlockA1.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_EMPTY; hsai_BlockA1.Init.ClockSource = SAI_CLKSOURCE_PLLSAI; hsai_BlockA1.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_8K; hsai_BlockA1.Init.SynchroExt = SAI_SYNCEXT_DISABLE; hsai_BlockA1.Init.MonoStereoMode = SAI_STEREOMODE; hsai_BlockA1.Init.CompandingMode = SAI_NOCOMPANDING; hsai_BlockA1.Init.TriState = SAI_OUTPUT_NOTRELEASED; if (HAL_SAI_InitProtocol(&hsai_BlockA1, SAI_
Hi there, I have a Nucleo-H755ZI-Q and want to get the CDC driver working with USB_FS on the M4 core. I'm having an issue where USB_CoreReset() HAL function times-out waiting for the USB core to reset. Here's the steps I take to create the issue:Download latest CubeMx and firmware packageStart a new project for Nucleo-H755ZI-Q with peripherals set as default. Enable USB_FS on the M4 core and the VCOM middle-ware. Configure clocks so that M7 is at 480MHz, M4 is at 240MHz, running from the 8MHz HSEConfigure USB clock to have 48MHz from PLL 1QGenerate code for CubeIDEThe M7 auto-generated project fails to build with "No rule to make target '../Drivers/STM32H7xx_HAL_Driver/stm32h7xx_hal_eth.c"! .. But I'll tackle that issue later..The M4 project builds and runs. The problem is in USB_CoreReset() at line 196 of stm32h7xx_ll_usb.c. Bit 0 of USBx->GRSTCTL never clears.There doesn't seem to be a CDC example for this Nucleo. I have tried the same process for a Nucleo-F4 I have lying around,
helloI use STM23CubeMX, but i have question.what is To Power???? why to connect system clock to to power??
Opening the blank new MDK-ARM project in Keil uVision 5, the CM4 cannot be flashed.I found that the error is on the Flash RAM address wich is equal for CM4 and CM7i solved going (into Keil uVision) to Project > Options for target xxxxx-CM4 > Debug > (continue under)on the top right ST-link Debugger selected click on Settings > Flash Download and in the RAM for Algorithm you must set:CM7 --> Start: 0x20000000 Size: 0x00001000CM4 --> Start: 0x10000000 Size: 0x00001000This is the configuration found on all the Examples, but is not the default generating the code from CubeMXOriginally, these value were the same for CM4 and CM7 target ( Start: 0x20000000 Size: 0x00001000), the big problem is that instead of reporting something like "bad address" the Keil IDE reports "missing .axf", i found digging and digging..Please correct in the CubeMX generator.Have a good day.
Also, I am Facing an issue with the proxy setting I am select No proxy and I see an error like this "Problem during server connection" How to resolve this? Please.
When there is an ADC analog watchdog on DAC1 channel 1 output, cube generates the string ADC_CHANNEL_DAC1CH1_ADC2 (which throws an error) instead of ADC_CHANNEL_DAC1CH1.No big problems but worth telling.
I start STM32CUBEMX as beginnger.so I refer to https://www.st.com/content/dam/kms/Contents/Reflibrary/STM32CubeMX_Quick_Guide.pdfbut it outdated. so i want get updated file. also i want to get STM32Programmer reference . ***Moderation Edit: please do not post your email address on this website***
I used STM32CubeMX to create the initial code for my STM32CubeIDE project. But looking over the generated code, I realize I need to make a change. How do I get back to STM32CubeMX from within STM32CubeIDE in order to modify and regenerate the code?
Rationale:I have several projects on the same MCU that evolve almost simultaneously. (However, the pinout is different). When adding new features, I have to enable some of them in GUI mode several times. `sort`ing the contents of *.ioc files alphabetically and `diff`/merging helps in part.Is it possible to fully automate the creation of a * .ioc file from a script (STM32CubeMX -q script.txt)?script.txt:swmgr install stm32cube_h7_1.9.0 accept load STM32H743VITx project name M7_MODBUS project toolchain SW4STM32 SetStructure Advanced SetCopyLibrary "copy only" project couplefilesbyip 1 # Working, ip "CORTEX_M7" available set ip parameters CORTEX_M7 CPU_ICache Enabled set ip parameters CORTEX_M7 CPU_DCache Enabled # Not working. How to click "Activated" checkbox (enable) on IWDG1 via this script? set ip parameters IWDG1 Reload 4000 set ip parameters IWDG1 Window 4000
I register MDMA call backs, for example XferBufferCpltCallback, XferBlockCpltCallback, etc. using the HAL_MDMA_RegisterCallback() function. But the callbacks never got hit. These callbacks are called from stm32h7xx_hal_mdma.c/HAL_MDMA_IRQHandler(). HAL_MDMA_IRQHandler() in turn is called from stm32h7xx_it.c/MDMA_IRQHandler(). However, in my source tree , both CM4 and CM7, DMA_IRQHandler() is not in stm32h7xx_it.c as generated from CubeMX 6.1.1. And MDMA ISR is not in the vector table in startup_stm32h745bitx.sI have looked at NVIC1, NVIC2, MDMA in CubeMX and can't find anything that would get MDMA_IRQHandler() to be generated. I would aprreciate it if someone let me know how to solve this problem.
Hello,I wonder if it's possible to use the CubeMX user parameters or generated constants within CubeMX itself.For example, the FMC configuration allows to calculate the origin and size of a given memory, let's say SDRAM. The LTDC configuration needs the address of the frame buffer(s). Now, it would be great if the FMC values can be used within the LTDC configuration to set the frame buffer to e.g. the beginning of the SDRAM.If it's not possible to use the values directly, can it be achieved by user constants? For example, defining a user constant in FMC which uses/collects the generated FMC values, and passing the user constant to the LTDC configuration?This would enable having some kind of automatic configuration between multiple peripherals - you only have to set the corresponding symbols instead of absolute values which might change between projects.Regards
Error message: Updater cannot rename Software folder.... There is no other process locking it (procmon has no LockFile on Software).
CubeMX ver 6.2.1 (and also 5.6.1). Start with a new project (STM32G474VE TQFP100 in the attached IOC file). Map pin PC10 to an EXTI function (in my case, falling edge with pull-up) and enable the NVIC EXTI15_10 interrupt. Make sure this pin is "pinned" (should be by default when EXTI function is selected). Then select pin PB10 and try to make it an EXTI function. CubeMX will do that and silently delete the PC10 information.Yes, I know the SYSCFG->EXTICRx registers restrict it so you can only have one Port A/B/C/D/E/etc. pin 10 enabled as an EXTI. But CubeMX should not delete any pin configuration without some kind of warning, or at least not a "pinned" pin. Ideally, it should issue a warning and give the user the choice to keep the existing EXTI config and ignore the new one, or delete the existing one and create the new EXTI config.
HiAfter updating to CubeMx 6.0.1 and my STM32H7 Pack to 1.8.0 I cannot create project code for Keil uVision 5.27.After pushing the create code button it brings up the progress bar, seems to be doing stuff and then brings up a dialog:---------------------------------------------------------------------------------------------------------------------------------------"The code is successfully generated under G:/LoranReceiver_002 but MDK-ARM V5.27 project generation have problem."---------------------------------------------------------------------------------------------------------------------------------------When I open uVision I get an error:--------------------------------------------------------------"Error: Device not found - Device: '??device??'Vendor 'STMicroelectronics'Please update your device selection."--------------------------------------------------------------The uVision file tree is empty of files and when you open the uVision config dialog no device is selected.I tried
And if I copy it manually, it is deleted on next code-generation
Hello,I updated the HAL libraries for STM32G072RB from 1.3.0 to 1.4.0 (using the CubeIDE and opening the .ioc file and confirming the Migration).However, I can't compile the project any more. Is there something I can do?make -j8 all arm-none-eabi-gcc "../Core/Src/system_stm32g0xx.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DSTM32G071xx -DUSE_HAL_DRIVER -DDEBUG -c -I/home/david/c/stm32/common -I../Drivers/CMSIS/Include -I../Core/Inc -I../Drivers/STM32G0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32G0xx/Include -I../Drivers/STM32G0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/system_stm32g0xx.d" -MT"Core/Src/system_stm32g0xx.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/system_stm32g0xx.o" ../Core/Src/system_stm32g0xx.c: In function 'SystemCoreClockUpdate': ../Core/Src/system_stm32g0xx.c:231:10: error: 'RCC_CFGR_SWS_HSE' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_Msk'? case RCC_CFGR_SWS
Hello. Do you have a sample code for mp3 decoder with stm32h743 and cubemxTanks
i'm have version 6.2.0i'm trying to install stm32cube MCU package for STM32F! version 1.8.3 or 1.8.0
..
Hello, There is an example to use printf with usart. However, I need to find a way to use scanf with usart. I am using STM32H7, STM32Cubemx, and Atollic Truestudio. Your help is much appreciated.
Hi Everyone,I previously made a project through STM32CubeMX based on the STM32L431CCT6 to generate the pinout and initialization template for Keil MDK-ARM IDE. We are planning on transitioning to the STM32L431CBT6 (without any changes to the code), and I was wondering if I can just use the current project on Keil-MDK ARM to program the STM32L431CBT6 without generating a new STM32CubeMX template and Keil project, and copying all the files used in the previous project into the new one.Are these are the steps below (performed on Keil MDK-ARM) sufficient to be able to port the project onto the new microcontroller:Going to Options for Target -> Device and changing the device to the STM32L431CBTx Going to Options for Target -> Target and change the Flash region since the size is smaller on the STM32L431CBT6, and verifying that the SRAM region is correct Verifying that the Linker is correct, which can be found under Options for Target -> Linker, and optionally, verifying th
In CubeIDE, when setting up ethernet, you can selectETH -> Mode -> RMIIorETH -> Mode -> RMII_PTP_SynchroIf I pick RMII, ethernet drivers get included as expected, and appear to work correctly.However, this application requires PTP, and if I change the selection to RMII_PTP_Synchro, the ethernet drivers disappear!Is this a bug in CubeIDE 1.6.0?How do I work around this?-Dan
Hello,CubeIDE is not generating the full code for ADC3, as it does for ADC1, more specifically it is missing the part that takes it out of deep power down and activates the voltage regulator.With the ioc in attach, you will see that for ADC1 it generatesstatic void MX_ADC1_Init(void) { /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ LL_ADC_InitTypeDef ADC_InitStruct = {0}; LL_ADC_REG_InitTypeDef ADC_REG_InitStruct = {0}; LL_ADC_CommonInitTypeDef ADC_CommonInitStruct = {0}; LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; /* Peripheral clock enable */ LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_ADC); LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOC); /**ADC1 GPIO Configuration PC0 ------> ADC1_IN1 */ GPIO_InitStruct.Pin = LL_GPIO_PIN_0; GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG; GPIO_InitStruct.Pull = LL_GPIO_PULL_NO; LL_GPIO_Init(GPIOC, &GPIO_InitStruct); /* USER CODE BEGIN ADC1_Init 1 */ /
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.