Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
My goal is to reserve a pin over CubeMX to remind me later to use that pin as an optional GPIO for example.I want some kind of marker that when I come back on the CubeMX configuration it catches my attention. I would prefer a color marker.I don't want to use the regular GPIO input assignation (shown in green on CubeMX) because it is lost among my 100 pins already configured (and also shown in green on CubeMX).Some clues of achieving my goal (but that appears not feasible at the moment on CubeMX v6.4.0):• Assign <Single mapped signals> on a simple GPIO output over CubeMX (pin becomes yellow);• Apply a label on an unused pin (pin stays grey but with option label on it);• Change pin color of a regular GPIO output.One other method without using the color marker could be to use a label marker tag like: <[OPTIONAL] My_Pin_Label>. But this is not a suitable solution for my post.Regards,Nadreoh
I develop on Ubuntu using STM32CubeIDE / MX (I also sometimes use VSCode and st-utils with cortex debug) for F4 and I'm looking to transition to L4 processors. The main aim is to get connected to AWS for streaming telemetry from devices in the field.After the disappointment of realising the P-L496G-CELL02 is essentially obsolete I thought I would ask some questions before trying to return it for a refund.
I have migrated to CubeMX 6.6.0 and now my code is generating stm32g4xx_ll_* files.Is there any explanation for this behaviour? - gb
I have a source of can messages connected to the SN65HVD232D CAN controller, which is then wired to a NUCLEO-G431KB via the FDCAN1 TX and RX pins. I confirmed with an oscilloscope/digital decoder that the transceiver does indeed output valid CAN messages, but the interrupt never triggers. This is the setup I use in an attempt to receive classic CAN messages using the hardware I have: These are the settings in STM32CubeMX: This is the code these settings generate in the form of an init function that is called in the init section for those who don't use the "wizard", but still use the STM32 HAL: hfdcan1.Instance = FDCAN1; hfdcan1.Init.ClockDivider = FDCAN_CLOCK_DIV24; hfdcan1.Init.FrameFormat = FDCAN_FRAME_CLASSIC; hfdcan1.Init.Mode = FDCAN_MODE_NORMAL; hfdcan1.Init.AutoRetransmission = DISABLE; hfdcan1.Init.TransmitPause = DISABLE; hfdcan1.Init.ProtocolException = DISABLE; hfdcan1.Init.NominalPrescaler = 1; hfdcan
I have two gpios enabled one as an output another as a interrupt input. PA11 and PI11 respectively. There are two pin defines generated by CUBEMX, for argument call them MYPINA_Pin and MYPINB_Pin respectively. For the interrupt handler CUBE generates code like this...void EXTI15_10_IRQHandler(void) { /* USER CODE BEGIN EXTI15_10_IRQn 0 */ /* USER CODE END EXTI15_10_IRQn 0 */ HAL_GPIO_EXTI_IRQHandler(MYPINA_Pin); }While this results in correct machine code because MYPINA_Pin == MYPINB_Pin, it is quite alarming and reduces my confidence in CUBEMX. Not to mention confusing. If I want to track down some code and I search for MYPINB_Pin I will not find the interrupt handler.Has anyone else seen this and/or reported it to ST?
I created a project for an STM32H753 MCU and have added FreeRTOS via CubeMX called from CubeIDE. CubeMX generates the following code in main.c: /* Init scheduler */ osKernelInitialize(); /* Call init function for freertos objects (in freertos.c) */ MX_FREERTOS_Init(); /* Start scheduler */ osKernelStart();Based on some research, I assume that my new thread declarations need to occur between those two sections like this: /* Init scheduler */ osKernelInitialize(); /* Call init function for freertos objects (in freertos.c) */ MX_FREERTOS_Init(); osThreadNew( &thread_mainLoop, NULL, NULL ); osThreadNew( &thread_debugPort, NULL, &thread1_attr ); /* Start scheduler */ osKernelStart();Unfortunately, every time I make a change via CubeMX, my declarations are deleted. I've tried wrapping my code with USER CODE BEGIN/END 2.5 and USER CODE BEGIN/END RTOS_THREADS (copied from a project created using TouchGFX Designer
The latest version of STM32CubeMx 6.6.1 organizes the parameters of the FDCAN differently from the previous version and shows useful information on Time Quantum, Time for one Bit and Baud Rate.But I think the displayed parameters are wrong, as shown in the attached image.In my case the micro used is STM32G473VBTx
In CubeMX 6.6.0 and also 6.6.1 there is a bug, in my opinion.Most likely this came with the latest Fix 34380 (Alternate functions in PA0, PA1, PC2 and PC3 are not available in PA0_C, PA1_C, PC2_C and PC3_C GPIOs)Selecting STM32H750XBH6 (TFBGA 240+25) in CubeMX then directly selecting alternate functions for PA0_C and PA0:Is selecting TIM2_CH1 for PA0_C, the alternate functions are not available anymore on PA0, which is correct. (The same thing if defining PA0 first)But if PA0 is defined as ADC-input the alternate functions are still available on PA0_C, which is not possible following the pin diagramsee pin diagram from Knowledge Base Default State of STM32H7 switches connecting Pxy_C and Pxy pads: This also happens if selecting the modules in a certain order:ADC1: IN16Debug: JTAG with Trace Synchro (4bits)TIM2: PWM CH1This results in non functioning generated code (in my opinion - did not test)May this be set as bug report?
Hi,I use STM32F722 on a custom board for UART communication with an external sensor.When using SYSCLK with the maximum clock of 216 MHz using HSI and PLL, UART data was lost 2~3 bytes when 250 bytes were transmitted at once during UART communication with an external sensor.It was the same even if I changed the UART CLK.However, when SYSCLK was set to 140 MHz or lower, data was not lost regardless of UART CLK.I tried the same using the NUCLEO-F722ZE board to use the proven hardware.When tested by adding UART in the CubeMX default setting (HSE, SYSCLK 216) of the NUCLEO-F722ZE board, No data was lost.And when HSI was set to divide PLL, CLK error was displayed.When I ignored the error and generated the code, the same phenomenon as the custom board occurred(No data loss occurs when SYSCLK is used below 140).Q1. What causes CLK error when setting SYSCLK using HSI and PLL in NUCLEO-F22ZE?Q2. What is the correlation between SYSCLK and UART data error?Thank you.
Hello Community,I would like to receive and transmit the data via FDCAN.However, I cannot find the real pin on the STM32h745/50 Discovery Board.The Microcontroller pin of FDCAN1_RX is PH14, PA11, PD0, PB8, and PI9.The Microcontroller pin of FDCAN1_TX is PB9, PA12, PD1, and PH13. However, the pins cannot be found on the STM32h745/50 Discovery Board.So, how could I use the FDCAN1,2 pin and function...?
Hello,I'm working on a project build on STM32F407VG. I'm using Atollic Studio 9.3.0 and CubeMX 6.2.1. I've build a project on CubeMX a while ago, since then I didn't generate anything because I added a lot of things by myself, like USB composite MSC+CDC. At the beginning I want to clarify that I'm sure that my code is working, and I think that there is a problem with linker or Atollic but I'm not sure how to find it.So I'm using a lot of libraries, here are my directories:I'm working normally on my project, then suddenly I make one little change, completly not relevant to using fatfs or anything (something like, set high state on pin which has a diode), and I get errors:I started to getting it like a week ago, got them a couple times now, every time when i did something really not that important. What helps me in this situations (sometimes) is to create an empty project from CubeMX, and then fill it with libraries and main.c etc. from my previous project, but it doesn't always work. I
I just went to recompile my project after a couple of days of no changes - I got this dialog...I hit migrate and the process completed with no error messages that I could see.However when I tried to re-compile I got a lot of errors and looking in my src folder, most of my files had gone. Fortunately my project is in git and I committed first so I was able to restore them.The first error I found was that STM32Cube had removed 'ffconf.h', 'user_io.h' and 'app_fatfs.h 'from the FATFS folders in the project (in addition to lots of my C source files in the src folder).I haven't had this problem before. Unfortunately, the FATS files weren't included in my git but fortunately I had zipped an earlier version of the project.What's going on?? Has the implementation of FATFS in STM32 changed? Or is there a bug in the migration?
When I repeat the above procedure on my offline desktop, I do not get the option to install 1.27.1, as 1.27.0 is the newest option that appears. I routinely install patches offline, but this is the first time I have encountered this issue. Any ideas?
Using STM32F765VG6TR, every time I power on the MCU, the two DACs are supposed to be set to constant output voltages of 2.4V and 0.8V. This happens inconsistently - sometimes it works, about 50/50 success rate. A few notes:If it isn't working, an MCU reset does not fix it.There seems to be a correlation between how long I wait after power-down and power up and the DACs enabling properly. Waiting not too long and not too short seems to be the sweet spot (about 1.5s)This would lead me to believe it's a power sequencing issue with VDDA/VDD, but can't seem to correlate a specific start-up waveform with bad DAC behaviorHave reproduced the issue on two separate processors with different PCBAsEither both DAC channels work, or both do not work. Haven't seen one work and not the other.It didn't work on this try (DAC voltage in yellow):It did work on this try (see DAC voltage rise in yellow):I have tried waiting 100ms in the code before trying to run the DAC, no luck - which kind of makes sense
I tried to communicate using I2C, but I failed...So, I would like to get help from those who are good at I2C communication.The board uses NUCLEO-L073RZ, and the device to communicate with is "SHT20 (Humidity_Sensors)" of Sensirion company.I tried to communicate using I2C function in STM CUBE MX, but the sensor seems to communicate with 13bit... MX only supports 10bit....Please help....
Fixed issue131250 source files got deleted after project migration Related threadsSTM32CubeIDE 1.10.0 Migration IssueHow to avoid project migration issue in STM32CubeMX v6.6.0 and STM32CubeIDE v 1.10.0
A regression was detected when a project is migrated to the latest STM32CubeMX v6.6.0. The following source files got removed from Core/Src folder after the migration.system_stm32xxxx.csysmem.csyscalls.cTo avoid this issue, please apply one of the following workaround:Delete .mxproject file before performing project migrationMove or copy the whole project in another location before project migrationWe are working on a patch release for MX and IDE in which the described issue will be fixed. The patch will be available soon. We apologize for the inconveniences.
Before that there was STM32CubeIDE ver1.4.0 STM32CubeMX ver6.0.0 everything was fine.Installed STM32CubeIDE ver1.5.1 and STM32CubeMX ver6.1.1, there was an error when connecting USB_DEVICE.Tried creating a project from scratch with nothing but USB_DEVICE. Gives an error message.What to do?
..
Hi, I am experiencing issues migrating projects from STM32CubeIDE 1.9.0 to 1.10.0. After performing the migration, a number of custom project .c/.h files are deleted from the project and filesystem, and some are completely replaced, deleting /*USER CODE*/ sections. After installing the new application (help->check for updates) and restarting Windows 10 system I perform the following:Open project (STM32F469 based)Build project to confirm fine. Open .ioc fileSelect "Migrate" to update to STM32CubeMX 6.6.0Save .ioc to force code regeneration.Code generation completes but:All .h files are deleted from the Core/Inc directory (custom headers and generated headers for the peripherals adc.h, dma.h etc) All the custom .c files are deleted from the Core/Src directoryIf I open the .ioc again and force another code generation, the peripheral .h are correctly regenerated (but as the files were previously deleted, all the /* USER CODE */ sections in these headers are gone).I have tried rolling ba
I've followed st video lab: https://www.youtube.com/watch?v=urHGtvLYctkDebugging the code, the calback (e.g. HAL_UART_RxCpltCallback) is not called (breakpoint is set). I tried with the "Register Callback" Enabled and Disabled, but none is working. It used to work seamlessly before the version update. What is different in current HAL version interrupts.N.B.(I've similar open question in different context when using touchgfx (https://community.st.com/s/question/0D53W00001eZLdvSAG/legacy-interrupt-handlers-in-cubemx-660)
Hi all,I am trying to program and control a Reaction Wheel Inverted Pendulum in real-time with a STM32-L476RG board and a SimpleFOCShield using Simulink. But first, I wanted to see whether I can read the incoming encoder values in Simulink through the STM32-L476RG. I have installed the STM32 Support Packages, but it doesn't really fulfill my needs. For example, I want to read the values of an encoder or generate PWM with STM32 in Simulink, there are no blocks for the Timer, which has the encoder mode function. And I can't upload/connect the configuration of the pins from STM32CubeMX for the board I am using. I am quite new to STM32, so I am wondering if there are solutions/alternatives/suggestions to this?Thank you very much.
hello to everyone, i am using stm32f429zi to generate a pulse for a triac . It all function without a lcd display.when i write the code to init the display(via I2C) ,,, the display works very fine but i have a problem ... the output of timer1 doesnt show a pulse but a 3.3V and it is not good for my application./* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2022 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ---------------------------------
Hi all, I am interested on how to see which pins are configured as a timer channel output without using STM32CubeMX? I am using a STM32L476RG board. Is it possible to see from the .c/.h files? If yes, how?Thanks.
I want to convert my project from using an STM32G491xE to an STM32G431xB.To my understanding, the only way to switch between microcontrollers is using the STM32CubeMx "List Pinout Compatibility" feature.The problem: this functionality does not work on the STM32CubeMx v6.5.0 release.Not only does it display those weird graphical glitches (see .avi), but it prevents me from doing any conversion (the convert button is never enabled).This problem has been reproduced with another computer with a fresh install of CubeMx v6.5.0.The problem has not been seen on CubeMx v6.4.0.--- In the meantime, what is the workaround for this?Is there a manual way to convert a CubeMx v6.5.0 project into a CubeMx v6.4.0 project?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.