Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello I am using stm32h750vb. I want to use an interrupt to read the adc value, but in the interrupt and dam mode the adc unit does not work. In polling mode, it shows the correct value only once after the microcontroller reset and then a constant value. Only displays the correct value if I use the following function to read the adc value. Using this method causes the microcontroller to heat up in a short time.uint16_t adc_read_value(void){ static uint16_t Value = 0; HAL_ADC_Init(&hadc1); HAL_ADC_ConfigChannel(&hadc1, &sConfig); HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED); HAL_ADC_Start(&hadc1); HAL_ADC_PollForConversion(&hadc1, 100); Value = HAL_ADC_GetValue(&hadc1); HAL_ADC_DeInit(&hadc1); return Value; } I have used the adc unit several times in the stm32f1 and stm32l1 series but have not encountered such a problem. I used adc1 and adc2 and several bases but the problem was not solved.using stm32cubemx 6.
"A regression was detected in the previous STM32CubeMX version 6.3.0 (STM32CubeIDE Version: 1.7.0 ) generating a wrong order of initialization functions.This issue was fixed in the latest STM32CubeMX version 6.4.0. Thus, newly created project with this version will generate the correct initialization functions order."https://community.st.com/s/question/0D53W00001EzCmCSAV/mxdmainit-order-in-the-mainc-file-generated-by-stm32cubemx-how-to-fix?t=1653614837707"And then called these initialization functions manually in the following user code segment, and now it looks like this"https://stackoverflow.com/questions/70558087/stm32-spi-ll-dma-transmit"I couldn't solve it without solving the same problem. But this solution really works. I can't understand why CubeMX is generating wrong code."https://community.st.com/s/question/0D50X0000AxEm8USQS/solved-spi-dma-doesnt-transmit-anything-is-my-configuration-wrong
Hello!I want to make a basic remote control with the SPSGRF-915 module, but as far as I can understand I need the X-CUBE-SUBG1 extensión software to control it.I have already downloaded the software from ST (en.x-cube-subg1_firmware) and on the STMicroelectronics tab from the Embedded Software Package Manager in CubeMX, I can´t find the extensión package, so I tried to upload from the local .zip previusly downloaded but the following error appears:The following file is not recognized as being valid ...Thanks for your attention
When I migrate my Project to CubeMX 6.5.0 LwIP gets disabled and cannot longer be enabled as long as mbedTLS is enabled. FreeRTOS is enabled and this configuration worked fine with CubeMX 6.4.0.I tried to cycle all relevant settings, switched cores but haven't found a way to get both mbedTLS and LwIP to be enabled.How can I fix this?
With this configuration :nbr of conversion : 2scan conversion mode : EnableContinious Conversion Mode : cannot set to Enable !!!Discontinious Conversion Mode : ucannot set to Disable !!!Unless I am mistaken, I see no indication in the STM32U5 reference manual that does not allow this configuration (Scan conversion and Continuous Conversion).I guess a cubeMX bug?STM32CubeIDE 1.9.0, STM32CubeMX : 6.5.0-RC4,STM32U5 package version 1.1.0.
When trying to use the "List pinout compatible MCUs" feature to move an existing CubeMX project to a different MCU I get incorrect clock calculations in the clock configuration tab.For example, starting with a project for STM32L451RETx and then using "List pinout compatible MCUs" to switch to an STM32L451RCTx I lose the existing clock configuration and have to redo it manually.In the original project it looked like this:after switching MCU and reconfiguring I get this: I'm fairly sure that 16 MHz / 1 * 10 / 2 should be 80 MHz and not 40.The same problem exists in CubeMX 6.1.0. I couldn't test in CubeMX 6.5.0 because the list of pinout compatible MCUs never stops loading in that version.
Dear all, I used STM323H742VGT in one of my cards and I would like to configure it with ST Cube MX V6.5.0. According to the reference manual ADC clock source and pre-scaler can be set using ADCx_CCR register.I would like to use asynchronous clock source which is adc_ker_ck_input. However, I couldn't find any setting in ADC section of CubeMX. There aren’t any settings also for pre-scaler. I am familiar with STM32F7 and I could select pre-scaler over Cube MX.On the other hand, ADC_Clock is not enabled in Clock Configuration page in Cube MX. I don't know why. Normally, if I set a peripheral, related clock is enabled and I can change parameters in Clock configuration page. I added some screen shuts and if you can help me, it would be great. If I cannot set in ST cube MX, I need to write driver for it. I prefer ST Cube MX should do it for me. I may miss one thing to set and spend days to figure out.Best Regards
I have problems porting a H743Zi2 code to a H753. When using the .ioc file editor with the ADC the option to set the ADC clock prescalar is not present for the H753. It is there for the H743. The coeersponding line in the main.c code is not present either. Not surprisingly, a simple test program that was a polled ADC read did not work. Copying the setup code for the ADC and placing it after /* USER CODE BEGIN ADC1_Init 2 */ and then manually edting in:hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4; // <-- Missing lineafter the line:hadc1.Instance = ADC1;was a workaround that worked.Is there a was to automatically add in such corrections? I need to for my pulse spectroscopy application to poke about quite a bit with the hardware configuration. So it takes a lot of time.
Dear All,I would like to report an issue in Cube MX V6.5.0. I have an .ioc file which is built with previous version of Cube MX. It was migrated to the latest version and I realized IWDG Timer Block is not seen in Clock configuration page. I thought it is about migration because I know that Cube MX V6.5.0 has some bugs and they were reported already. I re-built a project from scratch with V6.5.0 and IWDG timer block connected to LSI. I saved the new project and closed it. However when I re-opened the project, it disappered again. Please fix the issue. It is not about migration because I created a new project and it was ok. However when I saved and closed the project and re-opened it disappered.Regards
How to reproduce:Create new project in CubeMX 6.2 (in CubeIDE 1.7) with STM32L010F4P6 MCU.Select TIM2 or TIM21 properties, set clock source as ETR2.Set generation of RCC and TIM code with LL library (in Project Manager tab).In function SystemClock_Config(void) exists "while(LL_RCC_LSE_IsReady() != 1)" pattern, but LSE not used.L051K8T6 is OK.
LSE osilator source wrong seems. I set 32.768kHz but that it seems 0.032768kHz
I am using CubeIDE Version: 1.6.0 Build: 9614_20210223_1703 (UTC) to initialise the MPU as it is done for the TCP_Echoserver, however the LL resulting code does not set the LL_MPU_TEX_LEVEL1 bit for the second regionGenerated code:/* MPU Configuration */ void MPU_Config(void) { /* Disables the MPU */ LL_MPU_Disable(); /** Initializes and configures the Region and the memory to be protected */ LL_MPU_ConfigRegion(LL_MPU_REGION_NUMBER0, 0x0, 0x30000000, LL_MPU_REGION_SIZE_256B|LL_MPU_REGION_FULL_ACCESS|LL_MPU_INSTRUCTION_ACCESS_ENABLE|LL_MPU_ACCESS_NOT_SHAREABLE|LL_MPU_ACCESS_NOT_CACHEABLE|LL_MPU_ACCESS_BUFFERABLE); LL_MPU_EnableRegion(LL_MPU_REGION_NUMBER0); /** Initializes and configures the Region and the memory to be protected */ LL_MPU_ConfigRegion(LL_MPU_REGION_NUMBER1, 0x0, 0x30004000, LL_MPU_REGION_SIZE_16KB|LL_MPU_REGION_FULL_ACCESS|LL_MPU_INSTRUCTION_ACCESS_ENABLE|LL_MPU_ACCESS_SHAREABLE|LL_MPU_ACCESS_NOT_CACHEABLE|LL_MPU_ACCESS_NOT_BUFFERABLE); LL_MPU_E
The latest versions of the STM32CubeL4 drivers (1.17.1) and CubeMX (6.5.0) introduce two bugs related to the OSPI and Delay Block Bypass.In stm32l4xx_hal_ospi.c line 383, the MODIFY_REG macro no long clears the DLYBYP bit. It also fails to set it according to the CubeMX configuration. I don't understand why these were removed.The CubeMX setting is using inverse logic. The setting is labeled Delay Block Bypass. Thus, Enable should indicate the bypass is enabled (HAL_OSPI_DELAY_BLOCK_BYPASSED), whereas Disable should mean disabling the bypass (HAL_OSPI_DELAY_BLOCK_USED). However, CubeMX reverses these values.
I was able to resolve by adding to SPI2_Init /* USER CODE BEGIN SPI2_Init 1 */ hspi2.Init.CLKPolarity = SPI_POLARITY_HIGH; hspi2.Init.CLKPhase = SPI_PHASE_2EDGE;But STM32CubeIDE 1.8.0 with same version FW_L1 V1.10.3 does have the options as below This is concerning, as upgrading to 1.9.0 then regenerating the project would change the auto generated SPI2_Init back to the default CPOL and CPHA Alec Davis
We teach using the STM32L476G Discovery kit Board. We have been using STMCubeMX 5.6.0 and Libraries 15.1. We want to migrate to current versions (6.5.0 and 17.2) but all of out programs that use the stm32l476g_discovery_glass_lcd.c library fail. We can use the new version of STMCubeMX fine if we do not migrate the project. We have also tried writing the same simple program from scratch using the old tools and the new ones. The old tools work fine, the new ones fail.Any known bugs? Any idea where to look next?
I've done a simple board with a STM32G431, the idea is to be a remote control that drives an infrared led. It has 8 buttons and the MCU should sleep until a button is pressed, then transmit the code and sleep again.Right now I'm just trying to make the led blink. I've set a default project with Cube IDE and I set up the main loop to toggle the led.It works fine when I'm debugging, but when I disconnect the cable and power it externally the led just stays on. Here is the code of the main:/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2022 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file exc
I tried DMA_SetConfig after __HAL_DMA_DISABLE and clearly it is not enough.Incidentally my intention is not change the size of the DMA allocated area - rather the size of this region accessed by a peripheral
..
HelloFor a project that I am working on I need a simple scheduler, a full RTOS is more complex than I need. My first idea was to build one myself but I noticed that when using STM32Cube to generate code to for example run bluetooth a scheduler is included. I can however not find any documentation regardning this scheduler.Does anyone have any information detailing how this scheduler works?Is this scheduler built for demonstration purposes only or have anyone built a project around it?Greatful for any help
The first time I generate code, it works.But by the second time I clicked the GENERATE CODE, the progress bar is not moving anymore after 'generating user source code'.I have tried to remove the file '.mxproject' , but it didn't work. The Application STM32CubeMX's version is 6.5.0 in macOS Monterey 12.4 ;My Java SE version is 18.0.1.1;They are the newest I could find in the Internet.Please give me some advise to solve the problem.
I have used output compare to send data at two pins simultaneously. the data is variable. however, I need only 8 clk pulses and on each rising and falling pulse edge data transfer to the output pin.I am unable to stop pulses and data at only 8 edges or pulses. it remains continuous however if I used interrupt to count the counter and stop the output compare. still, pulses generated are more than 8 pulses.i just need 8 pulses of both clk and output.
Hello, I am using an STM32F103C8T module (blue pill). I am using it to control a servo, which consists of a 20ms window, with a short pulse (1.0ms to 2.0ms). Like this:I configured timer 3 like this in CubeMX:I am using "HAL_TIM_PeriodElapsedCallback", and here is the code that is driving the servo:Everything works for the most part, but the problem is the servo has a slight twitch to it. It twitches fairly consistently about 2 times per second. I connected the oscilliscope to watch the pulse. I can see that the pulse width is not consistant - it has some variance to it:https://photos.app.goo.gl/2zXpNaN92md5mdMA6And here I zoomed in on the end of the pulse - you can see it much more clearly:https://photos.app.goo.gl/2r8uzPqeje9sbSNZ7Because of the inconsistent width of the pulse, it causes the servo to twitch - basically following the pulse exactly. Here is a video of that:https://photos.app.goo.gl/eS6NtWFbSuUNP6SJADoes anyone know what the problem is? My servo driver code is extremely
I'm using the STM32H757i Eval board. In STMCube repository for H7 v1.10.0, there is not a project folder for the STM32H757i eval board. I'd like to use the BSP LED/Touch drivers from the STM32H747i-EVAL project found in the cubeMX repository and potentially any others in the future. From what I could understand from UM2525, the eval boards are the same except for the actual micro-controllers.Can I start a project with the STM32H757 project and link to the folder with the STM32H747 eval files? Or, can I start a project in CubeMX for the STM32H747 and upload it to the STM32H757 allowing me to use any driver code written for the STM32H747i eval board.
I have STM32CubeIDE 1.9.0 and I am editing the .ioc. In the Pinout & Configuration Tab I right click and select List Pinout Compatible MCUsIt starts runningand running and running. Last night I let it run all night and it said it was 8% and there was a red message Running Low Memory. I rebooted the computer and reran it. After 4 hours it is at 50% and I got the Running Low Memory and it appears to have stopped. See attached screen shot. Error1.pngMy computer has 32 GB RAM and nothing else was running. The Task manager says 1,559.6 MB of memory is being used. I put the process priority from normal to above normal, and that did not make a difference. It says I am using a total of 7.2 of 31.8 GB (23%) of memory. I want to change the processor in my code from a STM32G031K6T to a STM32G051K8T and I was careful to use only three timers that were in both chips. Everything else was compatible. UM1718 Chapter 15 told me how to do it. I have to keep it in the same directory for git.
MCU:stm32h743vih6 rev.vSTM32CubeMX Ver:6.4.0Configuration: HSE 16MHz, 480MHz cpu core frequency, system clock mux=pllclk(480MHz), HPRE Prescaler=4. Project manager -> Advance Settings -> Driver Selector -> GPIO/RCC/CORTEX_M7 all set to LL.Bug: mcu will runaway in SystemClock_Config() -> line 145: LL_RCC_SetAHBPrescaler(LL_RCC_AHB_DIV_2);Also, I have attached the .ioc filePlease help to confirm, thanks!
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.