Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi,I am in the stage of porting an existing STM32F4 design to STM32CubeMX and in the future upgrade to a pin compatible STM32F7. STM32CubeMX seems to be a great tool with lot of potential but I have an issue when changing to a "Full Compatible" MCU using "List Pin Compatible MCUs". A lot of settings are lost in the process.One example is the SPI data size. It seems that the configuration is not saved in the ioc file unless it is changed from the default value. If the new MCU has a different default value, the resulting setting will be incorrect.As a workaround I must change all settings from their default and then back again to show up in the ioc or go through each setting after the MCU change and manually correct it.Also, the clock configuration is completely lost. I know the clock tree is not always identical, but it is lost even if changing to a MCU in the same series with just different amount of flash.In the Project Manager tab a lot of settings are lost too, e.g. toolchain, linke
We are using the NUCLEO-F091RC and need help establishing a working demo of a USART-Rx interrupt. We have put much effort into this with no success, here is the process we are at: Demo Attempt Process:Open CubeMX->Board Selector->NUCLEO-F091RCDefault?: YesPin/Config->USART2->NVIC->Enabled?: Yes [#3F38]Transmit & delay in main ('HAL_UART_Transmit()')Enable interrupts in main ('__enable_irq()')Place a counter increment in IRQ Handler ('rx_ct++') [#DCD5] Source Code: (GitHub)https://github.com/justinmreina/STMDev_USART2RxThis is not working for Rx, what is missing here?
Generated code is the following:void MX_TIM6_Init(void){ LL_TIM_InitTypeDef TIM_InitStruct = {0}; /* Peripheral clock enable */ LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM6); /* TIM6 interrupt Init */ NVIC_SetPriority(TIM6_DAC_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),5, 0)); NVIC_EnableIRQ(TIM6_DAC_IRQn); TIM_InitStruct.Prescaler = 48000; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_InitStruct.Autoreload = LL_TIM_IC_FILTER_F IVLL_TIM_IC_FILTER_FDIV1_N26_N5-LL_TIM_IC_FILTER_FDIV1_N2; LL_TIM_Init(TIM6, &TIM_InitStruct); LL_TIM_DisableARRPreload(TIM6); LL_TIM_SetTriggerOutput(TIM6, LL_TIM_TRGO_RESET); LL_TIM_DisableMasterSlaveMode(TIM6);}and the error is here:TIM_InitStruct.Autoreload = LL_TIM_IC_FILTER_FDIVLL_TIM_IC_FILTER_FDIV1_N26_N5-LL_TIM_IC_FILTER_FDIV1_N2;..\Core\Src\tim.c:135:31: error: 'LL_TIM_IC_FILTER_FDIVLL_TIM_IC_FILTER_FDIV1_N26_N5' undeclared (first use in this function) &n
i had intialized can1 and can2 of my stm board but after writtingthe whole code only transmission of messages is happening on both the boards but not the receiving.but when iused one board for transmission and one for reception its working properly.so what should i do
In stm32f3xx_hal_cortex.c defined systick interrupt:void HAL_SYSTICK_IRQHandler(void) { HAL_SYSTICK_Callback(); }but in stm32f3xx_it.c the systick interrupt defined too:void SysTick_Handler(void) { /* USER CODE BEGIN SysTick_IRQn 0 */ /* USER CODE END SysTick_IRQn 0 */ HAL_IncTick(); /* USER CODE BEGIN SysTick_IRQn 1 */ /* USER CODE END SysTick_IRQn 1 */ }Of course in interrupt table (startup_stm32f373xc.s) can be used only one :) g_pfnVectors: .word _estack .word Reset_Handler ... .word SysTick_HandlerAnd HAL_SYSTICK_IRQHandler is never called. And with it is not called user defined HAL_SYSTICK_Callback :(
It gives a dialog that says some path is missing in the registry or the JRE is corrupt. I tried removing and reinstalling JRE, then reinstalled CubeMX. Nothing seems to help. There were some entries in the registry under JavaSoft. Seems like CubeMX needs to add some entries to the registry, but is isn't. Has me stumped. Any suggestions appreciated. BTW it works fine on my other systems.
Hi,I am using Nucloe144 H743 board, Cube Mx and true studio. I want to incorporate codes given in cubeH7 example for EVal boads. How i can do this? For example how i can use FatFs application Code for EVAL boards in Nucleo or Other Custom boards.... Any link or help or tutoriol available?
Hi,I have a program generated with the help of CubeMX running on STM32F767VG. Now I have changed the controller from STM32F767VG to STM32F767VI. The only difference between the two boards is that STM32F767VG has 1 MB flash and STM32F767VI has 2 MB flash.Device from STM32F767VG to STM32F767VICubeMX Version: 4.25.0STM32Cube Version: 1.0IDE: IAR Embedded WorkbenchSince there is not much of a difference between the two boards, I have tried changing the controller from the Options... > General Options > Device and programmed it. The program worked as expected but there was an issue: the board would not go into standby mode with a current consumption of 30µA (which is achieved by the board with STM32F767VG.I tried making a new CubeMX project for STM32F767VI but that too didn't yield the desired stand-by current. I assume I'm not taking the right way in porting the code from one device to another using CubeMX.What is the most efficient way to port code from one device to another wi
I've generated RTC code with LL for STM32L433RB and it's missing "Day" parameter from RTC_DateStruct. It gives immendiately assertation failed.
The vertical scroll bar in the GPIO Settings window used in various peripheral does not appear.Left-click on a timer (for example), in the central window you can see the "Configuration -> Parameter Settings" with the vertical scrol bar, this is OK. It's possible to scrol the window:Instead selecting "GPIO Settings" and clicking on a line of a GPIO to check the settings, we get:The vertical scroll bar is missing, and the upper part overlaps with the lettering and does not allow you to read the settings. There is no way to scroll the window.Obviously this happens with small monitors (15 "). With large monitors (22") this does not happen because seeing all the lines of the parameters it is not necessary to scroll the window.Are you already aware of this defect?RegardsAndrea
I want to work on ethernet using MII mode. At times i am getting struck in clock configuration also. In lwip.c file, the link is getting up but while pinging the board from pc am getting destination host unreachable. Please help to resolve the problem.
I connected the BH1750FVI light sensor through I2C, and how to set the Fast Mode Duty Cycle in STM32CUBEMX. How to set it up with the data sheet of the BH1750FVI.
Suppose you configure a timer, then decide you don't want that one.How is one supposed to remove it?I've tried delete key, all views, finally edited the IOC file.Really now! This user interface would get us canned if we delivered it to a customer...Thanks,Best Regards, DavePS: I tried Help, but it doesn't work!
Hi all, I am trying to program a Sine PWM using STM32F407VG, but i only got the complementary PWM instead. Can some kind person tell what can i amend or add? attached is my code. I am using ac6 system workbench for coding. Thanks.
Helloo,Problem occured after updating STM32CubeMX from ver 4.x to ver 5.0.1. It was running perfectly before. But now, when I try to start it, nothing happens acceps my mouse icon turn into spinnnig icon for few seconds.I did try to uninstall STM32CubeMX too. Bu STM32CubeMX software is not displayed in the programs list too. I tried using the uninstaller uninstaller.jar, but does not work too, does the same spinning mouse icon for few second but nothing else. Please see the attached files.I need an urgent help since I use STM32CubeMX actively....Thanks a lot in advance.
STM32 USB HID HOST Reads the gamepad. When enumerated, it finds that the handle has a custom device interface type(InterfaceClass) of 0xFF and HID of 0x03. The code is generated using STM32cubemx (5.0.1). Usbh_core.c:If(phost->pClass[idx]->ClassCode == phost->device.CfgDesc.Itf_Desc[0].bInterfaceClass)The former is 0x03 and the latter is 0xFF.
When selecting "Makefile" for Toolchain/IDE with the STM32F4 Family of MCU's, a Linker Script is generated with a license that does not allow the code to be used with anything other than "System Workbench". ** (c)Copyright Ac6. ** You may use this file as-is or modify it according to the needs of your ** project. Distribution of this file (unmodified or modified) is not ** permitted. Ac6 permit registered System Workbench for MCU users the ** rights to distribute the assembled, compiled & linked contents of this ** file as part of an application binary file, provided that it is built ** using the System Workbench for MCU toolchain.
Hi everyoneI am new in ST ARM area in I am working on one design.Using STM32Cube tool I managed to locate all my resources, but I am not sure if it is OK and I need confirmation.I have some amber exclamation signs (no red), I suppose that my design is OK yet and I can continue. I understand that only some resources in this case are not available.Can someone confirm my expectation in order to continue with schematic.
I have created a project for STM32F303REtx.1° BUG: TIM20 is missing from the list of available timers. Instead in the "reference manual" and in the internal registers visible in debugging the TIM20 timer is present. See attached picture: 2° BUG: In the clock settings, for the TIM2 timer I have selected PLLCLK*2 in order to have 144 MHz (as is the case for TIM3/4 visible in the image). At the time of setting, the correct indication (144MHz) occurs in the rectangle next to the word "TIM2". After saving the project, closing the project and opening the same project again, going to see in the clock configuration I always find "72MHz". In truth, the true clock at TIM2 is 144MHz, so it's just a data display problem, in fact the generated code is right.Regards,Andrea
Hi,Examples projects for STM32F4 are great by there is not the CubeMX projects associated.I am looking the CubeMX project of the TIM_OnePulse example for STM32F411RE-Nucleo.Is somebody has that ?ThanksLionel
I've used USB via RTX on various other STM32 processors quite happily. I have a new project using the STM32F373, and I can't seem to find a way of setting up the Run-time Environment without running into "configuration via STM32CubeMX", which I actively don't want to use. What am I missing?(I have tried biting the bullet and using Cube, but I just wind up with a project which won't build as soon as I include USB...)Steve
Hello,Using CubeMX, I have created USB CDC device for FS and started using the CDC.By modifying CDC_Receive_FS() I am able to receive all data sent form the PC over USB and put the data in my bufferAlso (while the USB cable is connected and PC terminal is opened, I am able to send rarely data to the PC using CDC_Transmit_FS().The next stage is sending many data via USB (e.g., my trace messages).For this purpose I need to know when the USB cable is connected or disconnected and when PC is ready to accept my data (at least the PC port is opened) . So I will be able stop and resume my data sendingFor USB connection/disconnection I use USER code sections of HAL_PCD_ResumeCallback() and HAL_PCD_SuspendCallback(). Is it OK? (HAL_PCD_DisconnectCallback has no USER CODE section)My main questions are:How I can know (via what user modifiable callback) that The PC port was opened - closed)When I send data via CDC_Transmit_FS(), what modifiable callback/s inform about the status of the t
I have a project on CubeMX v5.0.1 - stm32 f103c8 that uses the RTC. I want an alarm interrupt on EXTI_17. In Cubemx under RTC I check Activatet he clock source, Select RTC output On Tamper Pin, and under NVIC, select RTC alarm interrupt through EXTI line 17".When I generate and compile the code, nowhere can I find an EXTI 17 interrupt being enabled. When I run it and examine the EXTI registers, EXTI 17 is not enabled.I've done the same thing with an F446 and there EXTI 17 does get enabled as promised by CubeMX.Has CubeMX left something out for the F103???Dave Sidlauskas
When USART's "Overrun" is set as Enabled (the default):Cube generates a call to LL_USART_DisableOverrunDetect for STM32L0Cube doesn't generate any code concerning the overrun for STM32L4When I set "Overrun" as Disabled:Cube generates a call to LL_USART_EnableOverrunDetect for both STM32L0 and STM32L4.I see two issues here - the reversed logic, and a bug (difference between L0 and L4).
Hi, I'm using stm32f401RE and making a code with cubeMX.So I set i2c3 and I was going to get some numbers from LSM303DLHC whic is accelo/gyro sensor.Here's the codes what I set.#define Slave_addr (0x1E<<1)#define X_high 0x03#define X_low 0x04uint8_t x;uint16_t x_full;and below are the codes in the while loop.while(1){HAL_I2C_Mem_Read(&hi2c3,Slave_addr,X_high,I2C_MEMADD_SIZE_8BIT,&x,1,500); x_full=x<<8; HAL_I2C_Mem_Read(&hi2c3,Slave_addr,X_low,I2C_MEMADD_SIZE_8BIT,&x,1,500); x_full= x_full | x; message[0]=x_full/10000+ 0x30; message[1]=x_full%10000/1000 +0x30; message[2]=x_full%1000/100 + 0x30; message[3]=x_full%100/10 + 0x30; message[4]=x_full%10 + 0x30; HAL_UART_Transmit(&huart2, message, 7, 100); HAL_Delay(2000); }I wanted to check x value through UART.However I only get "00155" from sensor and doesn't change
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.