Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
STM32CubeIDE Version: 1.9.0With the STM32CubeMX : Version: 6.5.0-RC4 and a project for STM32U585in the "project manager/advanced settings" tab, a line is missing to activate the "register callback" for the OCTOSPI interface best regards
CubeMx 6.4.0 fail to generate STM32H750 HRTIM LL code. There are java exception in generated file hrtim.c.CubeMx project is enclosed.
Hi community,I am trying to use I2C on the STM32L010RBTX,during configuration in MX, i realized that when PB8 and PB9 is configured as I2C, the GPIO mode field shows n/a.And the I2C won't work as well.However, when i configure to PA9/PA10,GPIO mode shows alternate function,which, I2C works perfectly fine under the same code.I am just using HAL_I2C_IsDeviceReady to check whether it is sending out anything.Any idea how to make it work on PB8 and PB9?Much thanks!
I am using the latest version 6.4.0. I used a user label for some IO configuration, but when the code is generated, the code is not using the user label; For ex PC4 I used LED_1 as a label and the code is still using the label GPIO_PIN_4. How can Igenarte the code with user-defined labels?Thanks
Trying to design a custom board, and the OctoSPI pins are spread around the chip, but the data sheet puts some pretty stringent requirements for length matching on the DQ/DQS pins: 25 mils for RWDS to DQ[x] - and RWDS really ought to be in the middle of the DQ range as well. In STM32CubeMX, I can set the pins "creatively" for OCTOSPI1, using a combination of ports 1 and 2, thus:... which at least puts the DQ/CLK lines close together although DQS is still relatively out in the boonies, and NCS is geographically remote (though it has a length-match of 1.5" from CLK) ... The question is, is this a valid configuration ? I'd assume so (otherwise I'd hope MX wouldn't let me do it) and the entire purpose of OCTOSPIM would seem to be to facilitate this, but before I actually pay for a board to be made, I thought I'd check...Any help gratefully appreciated :)
Is there a way to "heal" or tidy up the layout of main.c? A tool or button that can rearrange User code and while code sections? Recently every save of the project's .ioc file results in a closing brace "}" getting deleted in the main.c file. Has the "User Code begin while/end while" to be outside of the while loop or inside? And begin user code 3/end user code 3 outside of the main.c body or inside?
could a channel of TIM1 be configurated not only input mode but also output mode, so that it can capture a wave and generate PWM at the same time.
Hi,I'm trying to configure a new project for STM32H747 (dual-core) in CubeMX. As you know, the max clock for the cores are 480 MHz for the M7 and 240 MHz for the M4. However, CubeMx won't allow any input beyond 400 or 200 for M7 and M4 respectively.Any ideas?Zaher
I thought this was a manifestation of the previously reported bug Multiple definition error after STM32CubeIDE 1.9.0 update, but adding -fcommon to my compiler flags didn't fix it.The error message is:multiple definition of `SystemCoreClock'multiple definition of `AHBPrescTable'The root problem appears that two copies of system_stm32g4xx.c are being included in the build:Core/Src/system_stm32g4xx.cDrivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/system_stm32g4xx.cHere's an example of the full error message:c:\st\stm32cubeide_1.9.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\tools\arm-none-eabi\bin\ld.exe: ./Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/system_stm32g4xx.o:C:/Users/r/Projects/mulib-examples/test_stdbsp/nucleo_g431rb/Debug/../Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/system_stm32g4xx.c:152: multiple definition of `SystemCoreClock'; ./Core/Src/system_stm32g4xx.o:C:/Users/r/Projects/mu
I have a custom board. There I have an issue with the FMC SDRAM after the HAL_SDRAM_Init call when calling it a subsequent(!!!) time. It works when doing the call the first time. I then deinit the SDRAM because of some current consumption tasks. When calling it again, the reads and writes on the SDRAM cause issues.My SetupSTM32F756NG MCUAS4C4M32S SDRam for LCD Frame Buffers (2 Frame Buffers, called Doublebuffer) and other GUI BuffersCubeMX version 6.6.1 generated codebaseMPU setup posted belowFreeRTOS and of course other hardware and middlewares which do not seem to be of relevance.Problem descriptionOn startup I initialize the FMC SDRAM like in the example of the CubeMX. (See code below.) After that I do the Initialize sequence like the datasheet of the used SDRAM requires. And it just works. I can write and read just fine. The LTDC is set up to use the frame buffers. The application works, the display does as well. Debugging is also working fine. After some timeouts without any user
Please tell me why the wakeup pin numbers are shifted up by one in the HAL PWR lib?See.. https://community.st.com/s/question/0D53W00001DKQdnSAH/wake-from-standby-not-working-stm32h753iit6?t=1637613024141If there is a legitimate reason for this mapping, then why is it not documented anywhere? I had to infer the mapping and test it by trial and error.
I am using Keil MDK to setup a project for STM32 devices. STM32cubemx is integrated into Keil and can be used to generate a skeleton for the project (main.c, stm32XX.c, .h files and stm32CubeMX.ioc, etc).This is helpful but some of the generated code contain duplicates of some handlers, like "void PendSV_Handler(void)". How do I stop STM32CubeMX from generating these defines?
I swear i was able to do this in the past but then ...... then i updated from 6.3.0 to cubeMX 6.6.1.Maybe thats the reason, maybe not . Im using a stm32f105RBT6When i flash the chip and remove the stlink both PA13 and PA14 are stuck into some idle 1,3V floating state instead of toggle each second like PA10I am not sure where should i look to be sure pin SW functions are not on.Setting up pins as GPIOs in cubeMX Code inside main, simple GPIO toggleint main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX
If I want to make custom code structure or if I want to maintain 2 applications which have 2 different folders but can use same STM code, Is it possible? Can I change directory structure from cube MX or from any other tool? Like 2 applications which have different .project file, but using same STM resources like RTOS. Want to add new folders as well
I tried to change the user label for multiple pins in Cube 6.6.1 running on a mac without luck. On the rare occasion where it takes the label, it ends up on the pin in the table reversed and you can't change it. For instance, I entered "TIM3" and it resolved in the table to 3MIT.Thanks
I'm new in embeded programming. and now I'm trying to test UART with NUCLEO-F103RB. I installed STM32CubeMX 6.6.1 and TrueSTUDIO 9.3.0. I created using CubeMx and compiled with TrueStudio, but failed.. there are many undeclared(first use in this function) and unkown type.Is there any bug in TrueSTUDIO 9.3.0 or CubeMX 6.6.1? How can I remove these errors?
Hi All,I am currently building a project with USER-DEFINED FATFS (since my SD card mount on SPI instead of SDIO). I notice two weird include statement, FFCONG.h LINE 25 and 26,"#include "main.h"#include "stm32f4xx_hal.h""which are unnecessary because there are only few #define statement in the file. And what worse if we use main.h in ffcong.h, we cannot declare any function in main.h file with any FATFS variable or function. If we do so, the compiler will show "UNDEFINE FIL...".I just wonder the purpose of those two statement? Is there any benefit to include main.h in ffcong.h? Thank you.
I noticed that CubeMx (version 6.6.1 and earlier) when generating the code, may place the MX_DMA_Init() function after other ***_init functions that configure DMA registers. The problem is that those registers cannot be accessed 'before' enabling the DMA clock. For example here is a snippet of erroneous code: MX_ADC1_Init(); MX_ADC3_Init(); MX_I2C2_Init(); MX_I2C3_Init(); MX_SPI1_Init(); MX_SPI2_Init(); MX_DMA_Init();In the example above the ADC1 and ADC3 peripheral use the DMA mode, but the DMA is not initialized yet. In attachment there is the whole main.c file containing the above snippet.A possible workaround could be to impose the clock initialization before any other initialization: /* USER CODE BEGIN SysInit */ /* Workaround for a CubeMx bug */ __HAL_RCC_DMA2_CLK_ENABLE(); /* USER CODE END SysInit */
I can't download STM32CubeMX from website.It always show this message: "SORRY, PAGE NOT FOUND"How can I fix it ?Thanks!
Hello,I know that has been asked a lot of times but i cannot get i2c work on my original stm32f103c6t6 mcu on a blue pill board.I tried to read a lot on internet but anything let me come out.I modified HAL_I2C_MspInit() as i read that i2c clk enable needed to be before the gpio clk enable, added also the reset.void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c) { GPIO_InitTypeDef GPIO_InitStruct = {0}; if(hi2c->Instance==I2C1) { /* USER CODE BEGIN I2C1_MspInit 0 */ __HAL_RCC_I2C1_CLK_ENABLE(); //ADDED BEFORE GPIO CLK __HAL_RCC_I2C1_FORCE_RESET(); //RESET __HAL_RCC_I2C1_RELEASE_RESET(); //RESET /* USER CODE END I2C1_MspInit 0 */ __HAL_RCC_GPIOB_CLK_ENABLE(); /**I2C1 GPIO Configuration PB6 ------> I2C1_SCL PB7 ------> I2C1_SDA */ GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); /* Peripheral clock enable */ //__HAL_RCC_I2C1_CLK_ENABLE(
Hi there,i start to use aSTM32G031 Nucleo with some W2812b . I configure timer1 PWM output but when i try to generate the PWM i just say a lot of noise. I use one library i wrote for another microcontroller and i'm sure work. I share my configuration and i hope someone can help me . and the codeuint8_t led[led_number][3]; HAL_TIM_PWM_Init(&htim1); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { for(uint8_t cont=0; cont<255;cont++){ for(uint8_t nLed=0; nLed<led_number;nLed++){ led[nLed][0]=cont; led[nLed][1]=0; led[nLed][2]=0; } ws2812sendData(led); HAL_Delay(30); } for(uint8_t cont=255; cont>0;cont--){ for(uint8_t nLed=0; nLed<led_number;nLed++){ led[nLed][0]=cont; led[nLed][1]=0; led[nLed][2]=0; } ws2812sendData(led); HAL_Delay(30); } /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ }WS2812B.C#include "WS2812.h" #include "stm32g0xx_hal
According to the "known issues" post, importing an existing .ioc file from STMCubeMX is currently unsupported.I'm starting a new project and would like to use the IDE for this - but my engineer designed the product using CubeMX.Is there any kind of workaround for this?As I see it, my options are:1) manually recreate his work2) keep using the "old" tools (CubeMX & Keil compiler)Not sure which would be "better".Thanks.
I think it's related to my previous question:https://community.st.com/s/question/0D53W00001sGksoSAC/is-it-possible-rtc-on-stm32h7-loses-1-second-on-each-power-cycleI applied a workaround by practically removing all MX_RTC_Init().It seems to work, however today my device showed 33:55 at 10:55. Why? It seems like after 23:59 the clock set to 24:00. To 25:00 one hour later.Is this behavior related to initialization? I'm tempted to just check the TR for values over 23 and subtract 23 when initializing. It would obviously fix the issue, but it seems a little silly ;)
..
I have STM32CubeIDE installed on a lab machine where internet connectivity is restricted. I need to install v1.27.1. I was able to go to the st.com site and download the en.stm32cubef4_v1-27-0.zip file, transfer it to my lab machine, then using Help->Manage Embedded Software Packages to point at the local ZIP file and install the 1.27.0 main version. However, when I try to install the 1.27.1 patch (en.patch_cubef4_v1-27-1.zip) to upgrade to 1.27.1, the Manage Embedded Software Packages option claims that the zip file is not compatible.It appears that the only way to get the 1.27.1 upgrade is to use the Help->Check for Embedded Software Packages Updates option. But, that requires an internet connection. There does not appear to be a local file selection option. So, now I'm stuck because of the lab's internet restriction.Isn't there a way to get the incremental updates without having to use the internet?
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.