Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I was able to start a project in CubeMX from a NUCLEO board selection, GENERATE CODE and build and debug it in CubeIDE or TrueSTUDIO (depending on which app a .CPROJECT file is associated with in Windows).Now I'm trying to import 'STM32CubeExpansion_NFC5_V2.0.0' somehow. Importing at the root dir with 'Open Projects from File System' opens several apps: Applications_PollingTagDetect_EWARMPollTagDetectSTM32CubeExpansion_NFC5_V2.0.0STM32L476RG_NUCLEO_PollingTagDetectNdefI don't pretend to understand their individual functions/uses and none of them can I get to build without errors. Usually it's issues with make reporting having no rule for this or that. Errors like these: make clean make: *** No rule to make target 'clean'. Stop."make clean" terminated with exit code 2. Build might be incomplete.make all Error: Cannot find the specified linker script. Check the linker settings in the build configuration.make: *** [makefile:112: fail-specified-linker-script-missing] Error 2
..
1) When changing HPRE prescaler only CubeMX unexpectedly changes timer clock limits.I think those limits should depend on VOS voltage which, in turn, depends on SYSCLK, rather than on post-HPRE clock. As a result, lowering timers' clock lowers the max limits - see the screenshots. This does not seem to make sense.2) Interestingly, AHB1, AHB2, APB1, APB2 and AHB4 clocks do not get the warning.3) Setting DFSDM1&2 clocks higher than the max allowed 140MHz does not cause any warnings. It is a bit unclear what max DFSDM clock is. In Table 23 on p. 84 DS13195 specifies 140MHz while in Table 107 on p. 162 it states max fDFSDMCLK is fSYSCLK.4) Watch out! Generated SystemClock_Config() contains this line:HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY);CubeMX 6.2.1 now by default wants to use SMPS power supply. It seems this is a deviation from the previous version.5) It is not a CubeMX issue but RM0455 33.4.4 (pp. 1161, 1164, 1165) incorrectly states that Manchester clock time
Hi,I am running into some problems with generating new code for my MCU (STM32G474RBT6).I have installed STM32CubeIDE v1.6.0 and FW pack v1.4.0.I have created my entire pinout with a correct setup (my friend checked it and he is working with these MCUs on profesional level)Problem is that code does not contain parts for USB CDC.Everything is generated correctly but there are no:usb_device.cusbd_cdc_if.cetc.Looking forward for any help.With regard,Martin V.
STM32H723 has startup/default GPIOs configuration as "Analog mode". If i select EXTI at PE11 (and probably many other pins), CubeMX generate code which does not change pin mode from "analog" to "input" (and thus EXTI doesnt work). Tested on CubeMX v6.10 and observed also on v6.20. Code generated for GPIO LL drivers.
The Ethernet on STM3220G-EVAL is not linking. PHY never links with demonstration firmware 1.3.0 or my own STMCubeMX generated code. The LEDs doesn't even blink. I investigated BSR and the state shows "Not linked" but also "Remote fault". The BCR is 0x3100 after reset. What's weird is, that the board works with Demonstration Firmware 1.2.0. However I wasn't able to find a source code for that particular version.
Using STM32CubeIDE 1.6.1 with a project based on Version 1.6.0 of the STM32H7 firmware package the code generator will not generate a void SysTick_Handler (void) { method as long as according to the recommendation a non-systick-timer is configured as timebase source.The missing of the Systick_Handler definition makes the MCU run the default handler (endless loop) on the first timer interrupt. This is hard to debug because the debugger cannot determine which signal triggered the default handler and points to the WWDG (even if it is disabled).Adding an emptyvoid SysTick_Handler (void) {}definition or selecting the systick timer as timebase source both hide the bug.
For example:#define IO_Pin GPIO_PIN_5 #define IO_Port GPIOAIn stm32fxxx_hal_gpio.h:#define GPIO_PIN_5 ((uint16_t)0x0020) /* Pin 5 selected */Why do that? Setting an absolute number instead defining the pin number itself (5), which could be later converted using bit shifting (1<<5 = 0x20).This makes much harder to make automated code.So, if I quickly wanted to change IO_Pin to input or output, I can't simply make a quick mask operation into MODER register. The only way is to hardcode the number.// Change IO_pin to OUTPUT mode. IO_Port->MODER = (IO_Port->MODER & ~(uint32_t)(MODE_ANALOG<<10)) | (uint32_t)(MODE_OUTPUT<<10); // Change IO_pin to INPUT mode. IO_Port->MODER = (IO_Port->MODER & ~(uint32_t)(MODE_ANALOG<<10)) | (uint32_t)(MODE_INPUT<<10); // Change IO_pin to AF mode. IO_Port->MODER = (IO_Port->MODER & ~(uint32_t)(MODE_ANALOG<<10)) | (uint32_t)(MODE_AF<<10); This makes an issue for allowi
I have a Stm32F407 discovery card. I am trying to control a step motor with the gui I made in C # platform. I communicated using the usb_cdc library and I am using a stepper motor with my stm card. I count the pulse of the pwm signal using timer interrupt while controlling the stepper motor. I am configuring stm using cube mx. My problem is that after enabling USB global interrupt and TIM2 global interrupt in cube mx USB communication is not working or timer interrupt is not working. I configured the interrupt priority, but no solution found. An 8MHz crystal is used as a source. Do you have a suggestion?
mcu: STM32H743IITxhardware: USB_HS1 + usb3300 physoftware: usb host mode with all classesAll code are generated by cubemx 6.1.1, and I trace the usb data on wire with usb data analyzer.if OTG's internal DMA disabled, full speed usb device works ok, but high speed device can not transfer setup command while enumeration.if OTG's internal DMA enabled, all full and high speed devices can not enumertaion.Are there some success cases?
I am trying to set up DFSDM clock for STM32H7A3VITx and external 10MHz Manchester-encoding modulator using CubeMX.Since Manchester requires DFSDM clock at least 6x higher than modulator clock, minimum clock frequency is 60MHz.The only two *active* clock source options are PCLK2 and SYSCLK. PCLK2 cannot be faster than 44MHz (otherwise CubeMX protests) so that leaves me with just one option: SYSCLK.However, maximum allowed DFSDM clock, depending on Vcore, is 140MHz (DS13195, Table 23, p.84) so I would have to lower SYSCLK.It seems that clock faster than allowed may cause filter glitches.Please advise.Btw, CubeMX does not object to DFSDM clocks higher that 140 MHz while it probably should.
In CubeMX I am trying to put together DFSDM setup described in STM32L4 workshop: 4.6 New peripherals - DFSDM - App example 2 (PT100 thermometer) but for STM32H7A3VITx. Objective: fill the filter buffer with N samples every 1s. Screenshots below.I got it working in continuous mode using "regular channel" but not with timer and "injected channel required" - "regular channel" cannot be triggered by internal timer, only "injected" can.Before starting the 1s timer (HAL_TIM_Base_Start()) I call HAL_DFSDM_FilterInjectedMsbStart_DMA().Neither DFSDM1_FLT2_IRQHandler() nor DMA1_Stream2_IRQHandler() is being called.What am I missing? I have tried both Circular and Normal DMA modes.I have searched all over the Internet for a working example of such setup but I found none.Please advise.Timer 7 setup:
Hello,Here I have a nearly advanced problem in my view, maybe as easy as ABC on your side. I have been able to work with STM32f429IGT6+STM32cubemx+lwip+httpd+freertos.But there is a problem. Unlike the USB-CDC module which can enumerate and identify the connection in the middle of runtime, the LWIP framework with the default configuration of stm32cube code generator can't enumerates and identify if the cable is connected in the middle of runtime. But it can detect and work completely if it has been connected before reset.How should I change my code to achieve this goal? So far I had read that someone had the same problem and solved it, but couldn't find that question again on the web.
Some months i use check update in my testing IDE 1.5.1 instalation and it reports NO UPDATE. Now in software packages arrive TouchGFX 16.1 and is marked as not compatible with IDE. Why this simple think dont work? Next part is internal IDE MX plugin and external main CubeMX CHAOS... Im diss...
Java console output excerpt. 2021-03-31 17:06:02,953 [INFO] CodeEngine:229 - oldGeneratedFile, C:\Projekte\ST_IDE_15\eifel\Core\Src\spi.c_save2021-03-31 17:06:03,015 [ERROR] runtime:60 - Error executing FreeMarker templateFreeMarker template error:The following has evaluated to null or missing:==> varName [in template "ip_c.ftl" at line 419, column 78]----Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??--------FTL stack trace ("~" means nesting-related): - Failed at: #assign indicator = varName + "." + a... [in template "ip_c.ftl" in macro "generateConfigModelCode" at line 419, column 57] - Reached
Hello!I have project created with CubeMX. I coded a lot there and then I wanted to add a USB CDC device with CubeMX. After code generation I compiled the project and I got an error message:../Inc/usb_device.h:61:22: fatal error: usbd_def.h: No such file or directoryI did some research and some had the problem that the path name hat spaces in it. That was not the case with my path. I thought my path was too long maybe, so I changed the name of the folder created by CubeMX "STM32_USB_Device_Library" to "STM32_USB". Then this error message disapeared but another one appeared. ../Inc/usbd_audio_if.h:59:68: fatal error: ../Middlewares/ST/STM32_USB/Class/AUDIO/Inc/usbd_audio.h: No such file or directoryI don´t know what to do anymore and why is this audio.h file needed anyway for a CDC USB device? Any help is welcome
Hello everyone!I am trying to call my access point (main) outside the STCube projects, I already created a project that contains the STCube project, but the assembly code doesn't recognize the external project to find the access point, is there any quite tutorial about it?Thanks in advanceAlan
In CubeMX version 6.20, board Nucleo-H743ZI2: I want to find alternatives for SPI1_MOSI. Default is PD7 but all examples use PA7.So I ctrl/click on PD7 and expect that CubeMX will show me PA7. But it does not.Well maybe it finds it, but does not show it in any useful way.Tried left , right, middle click, left or right control.Same with PA7: if selected as SPI1_MOSI, ctrl/click will not show PD7.--pa
All I want to do is make a change to the code and then compile and run on the target without the debugger, ideally with a simple keyboard shortcut.Simple example using the ST NUCLEO-F030R8 board and a Keil project auto-generated using ST's STM32CubeMX tool.while (1) { HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin); HAL_Delay(200); }Let's say I edit the delay and want to quickly experiment with values without running the debugger. I just want to compile, load and run in one step every time I make a change.I tried setting this option:Options for Target > Debug > ST-Link Debugger Settings > Flash Download > Reset and RunAn odd thing happens. When I hit F8 to load, it loads and then it looks like it holds the processor in reset; in other words, it never runs. The odd part is that if I don't touch anything and return to that dialog, the instant I click on the "Settings" button for the ST-Link Debugger the target start running. This is very weird and I won
In CubeMX the name for the Automatic Retransmission of CAN-Messages is named: "NO-AUTOMATIC Retransmission"and is set to "DISABLE"When reading this I interpreted it as: Automatic Retransmission is done if set to DISABLEIn the generated code however the corresponding setting is:hcan1.Init.AutoRetransmission = DISABLE;Which leads to "no Automatic retransmission" and therefore to missing messages in case of high busload !!!Please correct the wording in STMCubeMX so other users are not falling into the same problem.BR GS
it generates the following init using the default parameters:static void MX_CAN1_Init(void) { /* USER CODE BEGIN CAN1_Init 0 */ /* USER CODE END CAN1_Init 0 */ /* USER CODE BEGIN CAN1_Init 1 */ /* USER CODE END CAN1_Init 1 */ hcan1.Instance = CAN1; hcan1.Init.Prescaler = 16; hcan1.Init.Mode = CAN_MODE_NORMAL; hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ; hcan1.Init.TimeSeg1 = CAN_BS1_1TQ; hcan1.Init.TimeSeg2 = CAN_BS2_1TQ; hcan1.Init.TimeTriggeredMode = DISABLE; hcan1.Init.AutoBusOff = DISABLE; hcan1.Init.AutoWakeUp = DISABLE; hcan1.Init.AutoRetransmission = DISABLE; hcan1.Init.ReceiveFifoLocked = DISABLE; hcan1.Init.TransmitFifoPriority = DISABLE; if (HAL_CAN_Init(&hcan1) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN CAN1_Init 2 */ /* USER CODE END CAN1_Init 2 */ }And it falls immediately into the Error_Handler();What do I need to do to fix it? My second question is:My system needs to have a CAN Baud rate of 1,000,000
Hello, I am an engineer working at Desird Arge Design. I had a problem with the STM32G031F6P6 processor. I think there is an error while selecting the timer channels in the STM32 Cubemx application. According to the datasheet description, TIM1; It includes 4 channels and 3 reverseers. When I check the list, I can confirm the information. However, when I use the STM32 Cubemx program for pin selection, the pins cannot be selected, the channel and inverting channels in the alternative pins conflict. Photos are attached. Would you help me with this topic?
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.