Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
HiI find these issues with the system_stm32f4xx.c file which CubeMX "generates":(a) CubeMX has Bank1, Bank2 enabled. Code generated is only for Bank1.(b) CubeMX setting of pins (e.g/ AFR, MODER) does not match CubeMX Pinout.IOC attached.It seems that the system_ file may be a generic file (I have seen this around for years with the same flaws) and not generated based on CubeMX settings. This seems wrong. Once known the workaround is easy (i.e. write your own for each project, modifying the code as you need). If not you may (will) get Failure to Launch if your stack / heap is in the SDRAM.RegardsMark
Hi,I have some problem with STM32CubeIDE, since when I start a new project everything works well as long as I delete the file: "home/STMCubeIDE/workspace_1-13.1/.metadata/.plugins/.org.eclipse.e4.workbench/workbench.xmi".However, when I exit the project, closing STM32CubeIDE, and I reopen it, recalling integrated MX, either a blank page or the MCU only is shown. I'm not allowed to do anything.STM32CubeMX standalone works correctly, without problems.I tried to find some solution online, nothing works but deleting the file indicated above and restart the project Here's my system informations: Computer HP HP 250 G5 Notebook PCSSD 500 GiBMemory 8.0 GiBProcessor Intel® Celeron(R) CPU N3060 @ 1.60GHz × 2Graphics card Mesa Intel® HD Graphics 400 (BSW)O.S. Ubuntu 22.04.1 LTS 6.2.0-31-generic #31~22.04.1-UbuntuGNOME version 42.9Graphics system Wayland Java version:openjdk version "17.0.8.1" 2023-08-24OpenJDK Runtime Environment (build 17.0.8.1+1-Ubuntu-0ubuntu122.04)OpenJDK
When will STM32CubeU5 have an example OTG_HS CDC_Standalone application? I've use the example CDC_Standalone app from the many other STM32Cubes, but the M33 core appears to have a few significant differences. Banging my head on the wall.That is, STM32CubeU5\Projects\STM32U5x9J-DK\Applications\USB_Device\CDC_Standalone
Anyone have a guide or how to setup a Arduino Giga R1 board in CubeMX with the intention to use with Matlab/Simulink? I found this online: https://github.com/szabo-tamas/GigaR1InitI have attempted to remove functionality for a more simplistic attempt (only gpio and FREERTOS). However, I am still having trouble defining the init functions as global, I was directed to make a new header and set the inits to be extern, but I am unable to build in Simulink at this moment. Reference to older question: https://community.st.com/t5/stm32cubemx-mcu/how-to-change-init-functions-to-global/m-p/53187any help or guidance would be appreciated. thanks!
making new project for H563 cpu has problems:1. output as makefile is greyed out - why ?2. output for stm32cubeIDE is possible, but output shows problem:what can i do now ?
Hi, I am using the Nucleo-F767ZI, when I am asigning a function to a pin (PD2) this make unselect the pin PG2, when I reassign the pin PG2 this makes the PD2 is deselected, the same when I try with the PF2, what is wrong? this using the graphic interface to configure automatically
Hi, I am working on a project on the STM32H730, using UART5 to receive midi. I have an interrupt configured for when a new midi byte is received to pass it to my midi library to handle the data. However, in testing I am finding the interrupt never gets called. I have used this method on the STM32L152 before and it has worked perfectly, I can't tell what is different in .IOC configuration that the UART interrupt is not working now. I see the midi signal on the pin in my scope, and the UART5->RDR register changing when a new byte is received. I've attached my .ioc configuration for UART5 and for NVIC interrupts, is there anything here that points to the problem? Please let me know if there's any additional information I can share to make this easier to diagnose.
Hello,I am trying to connect PEMicro Cyclone Fx to STM32U535RB and I get below Error in IAR. Though, debugger hits the breakpoint and starts the debug session successfully, I would like to understand what that error means. Can anyone help me understand this error?Thanks!
if i normolly send is "cake 50 %" to arduino receive "cake 50 %" after 10 times arduino receive "cake 50 BBBB" then all receive all "BBBC" but the usart1 vcp is sending normally this is a way to solve it?
HiWhen I Generate Code i find that HAL_Tick code is not generated and I am required to manually add code to get any MX code to work (given many _Init functions rely on HAL_Tick). I add the code, below, to a USER_CODE area but I don't see why I should have to.Regards uint32_t HAL_GetTick (void) { static uint32_t ticks = 0U; uint32_t i; if (osKernelGetState () == osKernelRunning) { return ((uint32_t)osKernelGetTickCount ()); } /* If Kernel is not running wait approximately 1 ms then increment and return auxiliary tick counter value */ for (i = (SystemCoreClock >> 14U); i > 0U; i--) { __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); } return ++ticks; }
I'm attempting to debug some code using Vscode and the STM32CubeCLT tools. I've Vector Table has been relocated to 0x8008200. Using the STM32CubeIDE, I have no problem debugging the software once I set the location of the Vector Table. However, if I attempt to debug the software using Vscode it immediately crashes after setting the stack pointer.If I debug a project in Vscode that doesn't have the Vector Table relocated everything works correctly. Am I missing a step here? Does GDB have to be informed that the Vector Table has been moved?
Hi everyone,I am trying to generate a Makefile for the B-U585I-IOT02A board on the STM32CubeMX 6.5.0 for Linux and the Makefile option under:Project Manager -> Project Settings -> Toolchain / IDE,and that option is greyed out.Why is it disabled? Is this feature missing?Thanks in advance.
Hi, I write to report a possible bug in generating a project by selecting an STM32G0B1CB MCU.I created the basic project using STM32CubeMX (6.9.0).In the autogenerated file "stm32g0b1xx.h" (in Drivers/CMSIS/Device/ST/STM32G0xx/Include) there is the following define:#define FLASH_DBANK_SUPPORTHowever, the chip in question should have only one bank of 128kB.Is this a bug or am I missing something?
I am generating code with CubeMX for STM32F030R8TxWhen building this code as is , I get tons of problems:45 Error(s), 152 Warning(s)Can someone please help me to get this working? Perhaps this is a compatibilty issue between the CubeMX version and the Keil uVision?It appears that this file is located in a completely different path on this PC compare to the other 'h files than where it is looking. There are 45 of the same missing file error :Error Example:C:/Users/Admin/AppData/Local/Arm/Packs/Keil/STM32F0xx_DFP/2.0.0/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc_ex.c(50): warning: In file included from...C:/Users/Admin/AppData/Local/Arm/Packs/Keil/STM32F0xx_DFP/2.0.0/Drivers/STM32F0xx_HAL_Driver/Inc\stm32f0xx_hal.h(46): warning: In file included from..../RTE/Device/STM32F030R8Tx/STCubeGenerated/Inc\stm32f0xx_hal_conf.h(201): error: 'stm32f0xx_hal_exti.h' file not found#include "stm32f0xx_hal_exti.h" 2) There are 145 warnings: Most relating to comments and UTF8 iss
hi all,Why does the system crash when registering an initialized display driver using lv_disp_drv_register() within “In Register” section? how to replace lv_hal_disp.c for freertos.1lv_memset_00(disp, sizeof(lv_disp_t))After executing the lv_memset_00(disp, sizeof(lv_disp_t)) statement, set the free BlockSize in the BlockLink_t structure to 0 (zero).then Insert the new block into the list of free blocks (prvInsertBlockIntoFreeList( ( pxNewBlockLink ) )) Due to sufficient space (as subtracting any number from 0 results in a negative number, i.e., a large number), it enters an infinite loop.2.Create a refresh timerlv_timer_create(_lv_disp_refr_timer, LV_DISP_DEF_REFR_PERIOD, disp);why it Add a new head to a linked list to create timer task ?FreeRTOS Kernel V10.3.1, use heap_4.cLVGL V8.0.0board stm32h743add pvPortRealloc() at heap_4.c```c void *pvPortRealloc(void *mem, size_t newsize) { if (newsize == 0) { vPortFree(mem); return NULL; } void *p; p = pvPortMalloc(newsize); if
It seems that STM32CubeMX does not properly handle tx/rx swap when UART is set to half duplex mode.Steps to reproduce-start a project with a MCU with pin swappable uart, like STM32F030x-enable UART in half duplex mode-enable pinswappingThe incorrect behavior can be seen on CubeMX GUI as the wrong CPU pin is highlighted as well as in generated code where the GPIO config in xxxx_hal_msp.c is done for the TX pin instead of RX.
HiSee attached IOC. When I import this to a clean (just created in CubeMX, version shown in attached) project the FMC is, incorrectly, flagged as having errors. I do not know if other aspects are imported correctly or not.Method:start CubeMXFile > New ProjectSelect STM32F429NIH6Import Project (select attached project)Complains that the FMC settings (Mode) is all wrong (which I don't believe it to be and which works when I change these manually).sometimes FMC pins show in yellow, sometimes, green after the importClock Configuration has not been imported correctlyincorrectly says the "only" imported aspect is RCC when, clearly, other aspects have been importedCorrecting the FMC and Clock import errors seems to be correct and flags no warnings (ie it seems the original settings were fine which I have proved by generating and running code on target)Regards
HiI start a New Project in MDK. I launch Device -> CubeMX. I get a blank IOC. I cannot Import (my design) into this IOC: Why not?Regards
HiI have found that I have to "mess with" the Sys -> Timebase setting to get Generate Code to create the file stmf4xx_hal_timebase_tim.c. I have no other timers enabled, just the Sys -> Timebase setting which is set to TIM3.When I say "mess with" I mean this:Generate Code does not generate the htim3 code nor the _timebase_tim.c file when Sys -> Timebase is, first, set to TIM3I need to switch between timebase timers and generate code repeatedly, probably with multiple CubeMX restarts and even a PC restartSomehow, I do not know why, it eventually works but I get the C file with htim3 declaredOnce it has worked I find that regenerating code works every time. It is just that getting it to generate code correctly the first time is a problem.It should work first time. It does not. I am generating code for MDK V5.Regards
Hello,I followed the ST training example to get an HID host working to interface a USB keyboard. Keys are correctly decoded on the USBH_HID_EventCallback() function. But, when having a main loop that lasts more than the milliseconds specified on the USB keyboard endpoint descriptor boot mode (i.e. bInterval = 8 or 10 ms), MX_USB_HOST_Process() is not called enough often and the class HID state machine stucks in HID_GET_DATA.(see post https://community.st.com/s/question/0D53W00000qvJqOSAU/whats-the-problem-with-usb-host-hid)So, how to call periodically MX_USB_HOST_Process() if the main loop needs let's say 30ms to run? Should I call MX_USB_HOST_Process() manually on different parts of the code being executed on the loop? That wouldn't be the desired solution... If this is the case, is there any restriction about how often can I call it? I tried to call MX_USB_HOST_Process() using a background 3ms timer 2 interrupt, but if the HAL library calls USBH_Delay() function, the program gets han
HiWhen I create a new project (STM32F429NIH) and use an old file which I migrate to the latest IOC format I find that I must go in and edit it: ProjectManager.MainLocation=SrcProjectManager.ProjectStructure=ProjectManager.ProjectFileName=STCubeGenerated.iocProjectManager.ProjectName=STCubeGeneratedIf I do not edit then the Structure is Advanced and there is no way to set it to Basic.Regards
While enabling Timers in CubeMX, I accidentally clicked on TIM6 which is already on by default and used by the Core I believe. I re-enabled it by clicking on it again and of course the default settings got erased. And now whenever I try to run my code, it is giving me this error:Target is not responding, retrying... Question: How can I restore the TIM6 to its default settings so that I can solve this problem? I compared the TIM6 settings with other working projects and couldn't find the difference. Other projects run on the board. Board: STM32H745XI
Hi, I want to discuss this problem in UART DMA on STM32F4 boardsI am sorry to upload picture rather than code.Moreover, my English is not proficient and please understand.I tested my code under nucleo-f429zi.-------------------------------------------First of all, I configured UART3 with DMA option on board.The below figure is the code I testedI thought that if I called UART_Receive_DMA function in the code, the data only receive DMA method.The reason is that UART_Start_Receive_DMA() called by HAL_UART_Receive_DMA() make receiver state (RxState) HAL_UART_STATE_BUSY_RX in line 3259 of second picture.So when I called HAL_UART_Recevie() which does not use DMA method, HAL_UART_Recevie() cannot receive any data if HAL_UART_Receive_DMA() is already called before HAL_UART_Recevie().This is because HAL_UART_Recevie() can receive data when receiver state is free (RxState == HAL_UART_STATE_READY) (below figure 1271 line) So I thought that if user makes the RxState HAL_UART_STATE_R
Hello,I'm in Cube MX and trying to activate the LSE option of my NUCLEO-H723ZG but the option is not available. I see many others which are notavailable.Why? I see that the external low frequency oscillator is correctly installed into the board...Cheers.Filippo
Hello, I have a problem trying to create a project in STM32CubeMX with a custom board using STM32L476RGT6 with crystal oscillator of 32MHz. In the interface configuration, when I selected HSE and set the value of 32MHz, it failed to initialize the peripherals because it got caught in a loop error by the clock configuration of the system. I have also verified the crystal signal and it corresponds to the frequency and if i select other options like HSI, everything works fine.Looking for your advice to solve this problem, Best regards,
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.