Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
CubeMX Version: 1.8.0Build: 11526_20211125_0815 (UTC)When selecting ThreadX from the software pack, CubeMX creates a [projectName]/ThreadX path but no ThreadX directory in the project tree or in the project folder matching the name in the Project Properties Path thus causing a warning. Since it is only a warning it is easily corrected by deleting the path, however it is a little annoying to have to clear out the path everytime you regen the code. To the best of my searching I am unable to locate a control in CubeMX to stop it from generating the Path in Properties.Anyway to permanently fix this?
Hi everyone.I am using STM32G431F4P MCU. I am using Timer3-Channel3 PWM output. PWM frequency is 20 kHz. ADC1 is DMA mode and i want to trigger ADC1 using Timer3-Channel1 (PWM generation no output). Timer3 and ADC1 settings are as follows;This is code;HAL_TIM_PWM_Start(&htim3,TIM_CHANNEL_3); TIM3->CCR1 = TIM3->CCR3 = 1000; HAL_Delay(100); HAL_ADC_Start_DMA (&hadc1, (uint32_t*)&ADC1_value, 2);But ADC1 is not triggered. It is only working one time (as soon as i start the ADC1). What is the problem?Have a nice work.
I select tim1 for sys source in STM32CubeMX and generate code.I use STM32CubeMX V6.4.0.I added a stripped example of the code that crashes. HAL_NVIC_EnableIRQ crashes.
I want to generate a PWM at ~76K Hz using the TIMER1 on an STM32F401 microcontroller.To my understanding, because the timer 1 is clocked at 84 MHz, I need to configure the ARR to 1099. See the screenshot to see my detailed configuration.## The problem: I observed a ~14.5 kHz on my logic analyzer.I don't understand where this calling comes from. Do you have any idea? ## Config details Here you can see which bus is connected to timer1Here you can see my clock tree configurationHere you can see my PWM configuration ## Software versionCubeMx 6.4.0
When creating a project with several different hardwares I like the posibility that the CubeMX created definitions for the GPIOs in the main.h header file which can be used in the project and by just changing the project-file one can use a totally different hardware. I would like to see this also for the peripheral handles (like hadc, hspi, ..).Currently I manually add those defines to the adc.h/spi.h/.. manually like:#define DISPLAY_SPI hspi1Instead of adding a further define a "user defined" handle name would also be an option.Regards Pascal
When creating ADC with DMA the call to MX_Adc_Init() is created before MX_DMA_Init() which in this case means that RCC clocks of DMA are not enabled during MX_ADC_Init(), which is odd. To fix this: Init code should enable RCC_DMA clock in ADC_Init() or ensure correct init-order
The generated code has wrong order for MX_DMA_Init() that doesn't work: MX_GPIO_Init(); MX_ADC1_Init(); MX_DMA_Init();...Correct code is: MX_GPIO_Init(); MX_DMA_Init(); MX_ADC1_Init();...note: STM32CubeIDE Version: 1.7.0 Build: 10852_20210715_0634 (UTC)
I am configuring SPI1 on the STM32H743. At first, I used the default configuration where the peripheral is clocked off of PLL1Q as shown below: However, with this configuration, the HAL peripheral driver would time out waiting for EOT flag to be set. Probing the pins directly, there was no clock or data coming out of the pins, so it seemed clear that the peripheral was not receiving any clock internally. I switched to running the peripheral off the PER_CK clock source as shown below: With this configuration, everything works fine. So I am all set to move forward with the project, but for my own education (and possibly to help other that come across this question), I would like to understand why running off the PLL source did not work. Any ideas? Thanks,Jamie
"Error downloading files: stm32cube_fw_14_v1170.zip (cannot unzipped) and stm32cube_fw_14_v1171.zip (Dependency no loaded). I also tried to update my Firmware using the Help updates links:Check for Embedded package software updates...but i receive the exact same error as i cited above.Can you please tell me what the problem is and how to fix it ?Thanks Dr Barry H
There is external crystal on my PCB Mfr part: X1E0003410273 I am working on STM32 Cube IDE. At first whenever I enabled external crystal my program did not run at all. Even In low frequencies. Then I enabled Clock Secure System (CSS) Now my program is running with external crystal with 48MHz HCLK but when I try to increase it more than 48Mhz program stops running again. I am beginner in stm32 and only working with Cube IDE. Is there problem with external crystal I choose or something else?Here is my Clock configuration
..
When using STM32CubeIDE, it is easy to inadvertantly make changes to source files that are up on the screen, often as a result of the focus being on the wrong window when one types. (This can easily happen when debugging, e.g. I have the focus on a terminal window, and the code hits a breakpoint, which shifts the focus to a source code window--sometimes when I'm in the middle of typing into the terminal window).That is not the problem though (although it might be nice to address it, perhaps by offering a code "read-only" mode controlled by a button in the toolbar).The big problem is that if there are unsaved changes to source files, and one launches the integrated MX, makes changes to the configuration and saves, one is asked whether to generate source code. If one selects "yes", *then* one gets a dialog saying that there are unsaved source code changes, do you want to save them or discard them. I don't want to do either!!!! I want to cancel code generation and go back to the IDE and s
Hi,I'm building a project using Cube MX (LL drivers) for the STM32U575ZITxQ processor (has SMPS) and I would like to get the processor into LL_PWR_REGU_VOLTAGE_SCALE4. Setting the MSIS to 16MHz achieves this but when I add in the 4 bit SDMMC interface in Cube MX the auto generated code only sets the regulator voltage to LL_PWR_REGU_VOLTAGE_SCALE3. This results in higher power consumption.I am aware of the clock limitations of the SDMMC vs AHB bus and have adjusted PLL1P (sources SDMMC clock) to 16 MHz.If I manually change the code to set it to SCALE 4 every thing seems to work ok but I would rather not deviate from the auto generated Cube MX code. Is it possible to achieve voltage scale 4 with SDMMC?Many thanksBen
Environment:tool: STM32CubeMX6.4.0 cpu: STM32H755XIRepos: STM32Cube_FW_H7_V1.9.1I configured pins as GPIO input/output by STM32CubeMX GUI. MAX_GPIO_Init() is auto-generated and all pins are configured inside. However it is not called by any function. Usually it will be called in main().Below is the auto-gernerated main() function code. MAX_GPIO_Init() is missed. Is it a abnormal case? My ioc file for this case is also attached.Thanks.int main(void){ /* USER CODE BEGIN 1 */ /* USER CODE END 1 *//* USER CODE BEGIN Boot_Mode_Sequence_0 */ int32_t timeout;/* USER CODE END Boot_Mode_Sequence_0 */ /* Enable I-Cache---------------------------------------------------------*/ SCB_EnableICache(); /* Enable D-Cache---------------------------------------------------------*/ SCB_EnableDCache();/* USER CODE BEGIN Boot_Mode_Sequence_1 */ /* Wait until CPU2 boots and enters in stop mode or timeout*/ timeout = 0xFFFF; while((__HAL_RCC_GET_FLAG
Assume for a moment that the target user is a regular person, not someone who knows that applications are stored in /Applications, you have to fire up Terminal, and cd into an app and navigate down to where the the actual programs are kept, and sudo to execute them.The issue is when Cube decides that you need to be an administrator, that isn't a thing where you can just right click on the app and choose Run as an Administrator (darn you microsoft, I'm already an administrator, why do I need to do the right click dance???) . There is no "needs to be an Administrator", that translates into "needs to wave magic chickens and recite cryptic chants".So, to update from 6.3 to 6.4 you have to be an administrator, fine, you just put up a big roadblock to updating. Now you have to drop down to command line, cd into a nearly random directory, execute something that is very hidden, prepended by the world's most dangerous command. And you need to just know this because there are no explicit instruc
I have to take an existing CubeMX project and change the micro (F03 -> G03) which should be quite simple, however my CubeIDE refuses to load the project.I can add the project, and it loads all the source files etc. but it will not build (the menu option is greyed out), it will not index sources (F3 to see definition doesn't work) and if I try to open the .ioc (CubeMX config) file it just hangs with a blank white window.From the .ioc file:MxCube.Version=4.22.1 MxDb.Version=DB.4.0.221Can I migrate this project somehow?
Clock doesn't allow adjustments. Normally it shouldn't give a warning.
I am trying to create a STM32 connectivity expansion pack for the purpose of integrating with a Infineon wifi module. There already exists a STM32 connectivity expansion pack for STM32H7.I need the PDSC files for STM32F429ZI (NEB1DX-02_NEBULA SIFI BLE CYW434W IOT KIT) & also for STM32U5 device. I am hoping that, if I add this (requested packs) while CubeMX project creation, then, I will get the desired project created. Please let me know if I can create the project this way, if so, please share the PDSC files.Thanks,
I am facing an issue with GPIOA initialization upon power reset it's LCKR register is set. so I am unable to initialize some of the port pins mode as output.Can any one help me on what would cause it to stay in this state?GPIOA port pins are chosen for TIM2 PWM mode,TIM3 pwm mode ,UART1,FDCAN1, four pins in output mode.I also configure GPIOB and GPIOC which work fine.I have configured the pins using STM32cubeMX for STM32G491xx microcontroller.Appreciate for your helpThanks,BV
I've asked a question about using I2C with DMA. https://community.st.com/s/question/0D53W00001LUuCuSAL/is-there-a-guide-on-how-to-use-i2c-with-dmaI've had answers, but these were mostly advices to use an example. As I explained, in short: "learning directly from an example would be an exercise in cargo cult programming".MX is a very useful tool to configure the µCU for beginners. (that is people who know programming but are not familiar with µCU, or are used to work on Arduino) but still require some knowledge.I think an article that would offer an abstract overview of the process (that is, in this example, I2C using DMA),then a walkthrough the configuration (with explanations of the different setting possibilities, their with pros and cons, ...),and a description of functionsand exampleswould help users learn rather than copy code from an example and hope for the best.It's also an opportunity for users to have a preview of surrounding topics they can dive deeper into if they want to.I
When I open a project generated on my machine it opens the ioc file just fine but not with the project I downloaded
The simple proj is attached to show the wrong code generation for ADC-DMA peripheral.To fix this issue two lines must be changed as below. /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_ADC1_Init(); // ERROR!!! RCC CLK NOT YET ENABLED! MX_DMA_Init(); // MOVE THIS LINE BEFORE MX_ADC1_Init();Are you can suggest other fix?
I have a recently started new project (STM32F446RETx), which was generated without problems 3 days ago using 5.3.0 and Keil 5.27.0. Now I thought it would be a good idea to proceed with this project on the latest release of CubeMS V. 5.4.0. Now I can not generate code for the Keil compiler any more :pouting_face: "The Code is sussessfully generated under ... but MDK-ARM V5.27project generation have a problem." I updated Keil to 5.28.0. Same issue.The path has no special characters. So this won't be the reason.I tried to generate a plain new project with the same processor, activate 2 pins as output. Same problem. When trying to open this new project file in Keil, the compiler complains: Device not found "??device??" Vendor STMicroelectronics. I checked the with the Pack Installer :STM32F446RETx was installed and "Up to date".Conclusion:The various experiences updating Cube releases are a desaster! I am really scared to update Cube to a new release! I always hope that the new release wo
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.