Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello,I'm using CubeMX 5.2 to initialize the RTC of my STM3210C card.I activated HSE as a source for the RTC:and on cubeMX I have enabled the Auto predivider calculation:The generated code is:The value of AsynchPrescaler is at 0xffffffff...then, on cubeMX I disabled the Auto predivider calculation:The generated code is:Now, in both cases the Synchronous predivider value is not set and it is not possible to have the 1Hz correct frequency at the RTC counter.Is there anyone who can tell me what I forgot?
https://community.st.com/s/question/0D50X00009bMQGiSAO/stm32cubemx-mac-updater-does-not-workI am asking this question again because there was never any resolution in the question linked above. I am using Cube v5.1.0 and trying to update to v5.2.1. I download the zipped update through the application and then fully quit out of it. When I re-open, the small rectangular STM32CubeMX blue splash screen shows up for a moment and then pops up with a dialog shown in the attachment. Clicking retry just quits the application, and subsequent restarting shows the same dialog. Clicking cancel opens the application, but it hasn't updated, and is still v5.1.0.I've tried opening the application using sudo open -a /Applications/STMicroelectronics/STM32CubeMX.app, but the same dialog box pops up when launching Cube.ls -ll on my Users/..../STM32Cube folder shows drwxr-xr-x. Anyone from ST please help? My macOS version is 10.14.5
I using hte RTOS middlewares within CubeMX but I have an ISR routine that can't be interrupted by the RTOS how can I do this?Many Thanks,Glenn
Board: STM32F3discoveryIDE: AC6 system workbench for stm32I used to be able to light dels and make interrupts but now I can't even do simple things.actions:open STM32CUBEMXNew projectselect my board (f3discovery)Initialize all periphs with their default mode? Yesgo to projet managergive my project a name and a locationselect "STM32CubeIDE" as toolchain/IDE because it opens the project on ac6 this waygenerate codeopen projectIn main.c, at line 49, "PCD_HandleTypeDef hpcd_USB_FS;" there is a redish point (or whatever this looks like), i drag my mouse on this object and it says "Type 'PCD_HandleTypeDef' could not be resolved"There is about 30 of this error in the main.c as in line "RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};"In the Src folder, only "stm32f3xx_it.c" file doesn't have this king of errorsAnother exemple of this error is in the file "system32f3xx.c" line "#define HSI_VALUE ((uint32_t)8000000)", it says "Type 'HSI_VALUE' could not be resolved"When I try to build,
Dear all, Sorry for this old questions ( & and seems not fixed). I use STM32CubeMX w/ vs code to build a program in STM32F103RE. And the I2C master seems not working. It always raise AF error. Maybe this is due the salve device problem. But once I probe the SCL pin with my DSO, nothing is found! And once I try to run the code step by step via debugger, the program will sometime freezed due to busy flag! I googled it and find there are many bug reports on this topic. But none of the solution can solve the problem. Can anyone please give me any tips? Attached please find my project
Why has the __func__ and __line__ been removed as argument from error_handler in CubeMX V5.0 generated code?(tested for STM32L4R9 microcontroller)By just calling Error_Handler() instead of the former _error_handler(__func__,__line__), tracing the error is much harder as the corresponding function is not directly visible.If space consumption is an issue, introduce a macro which enables or disables the feature!With the default setting of maximum optimization, it is sometimes almost impossible to trace back by just setting a break point in the error handler.
simple project is just a completly CubeMX generated file.IDE : TrueSTUDIOpackage : STM32Cube FW_F7 V1.15.0build fails with \Src/main.c:357: undefined reference to `HAL_RS485Ex_Init'package : STM32Cube_FW_F7_V1.14.0 & STM32Cube_FW_F7_V1.12.0 & STM32Cube_FW_F7_V1.9.0build fails with ../Inc/stm32f7xx_hal_conf.h:251:34: fatal error: stm32f7xx_hal_exti.h: No such file or directoryDid I miss something or is there a issue in the package.I already used those function with a STM32F4.
I am trying to set up a test project with cubeMX for stm32f746G disco with a file system.i have two issues:I want to understand what is the meaning of "user defined" in the Mode section of the FATFS Mode and Configuration in the CubeMX.Is there no possibility to run the FATFS on the internal flash of the stm32f7? must we use an external drive?thanks alot in advance... :)
I am using STM32F103VCT controller to test SPI communication. I am generating the code by Cube MX.I want to use SPI2 as Slave and SPI3 as Master. I want to transfer data from Master SPI3 to Slave SPI2.I want to use the SS pin in both the case.Please guide me if any document or video available for the same.
Hello to everybody, some years ago a community member pointed out that there were not so many code examples in CubeMX for beginners: https://community.st.com/s/question/0D50X00009XkfAvSAJ/stm32cubemx-github-examples-and-code-sharingand I agree, I am struggling too to find them. I downloaded STM32CubeF4 examples but they seemed too few. I googled around for examples and I found this:https://www.hackster.io/ashish205/stm32f0-push-button-to-switch-on-led-bc9958the main.c file in the post is an original ST Microelectronics code. Where can I found such detailed official examples, for STM32F4 microcontrollers (Nucleo or Discovery)? Regards,Adriano
I am using the board STM32F030R8, and I am trying to measure the voltage of two different ADC channels, one at a time. The fuction SendByte is for a multiplexer, then I have to measure some voltage, the two channels are measuring different parts of the circuit. Sometimes I get a value and sometimes it is just 0.I was succesfull using the ADC to measure different channels before. But I was not using this function SendByte. I suppose the ADC is not synchronized with the function SendByte, because when the correspondent port of the multiplexer is not set the value in the circuit is 0.int main(void) { HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_USART2_UART_Init(); MX_ADC_Init(); while (1) { HAL_ADC_Start(&hadc); /* Start the ADC */ SendByte(0x01); if(HAL_ADC_PollForConversion(&hadc, 100) == HAL_OK){ /* Channel 0 */ media_0 = HAL_ADC_GetValue(&hadc); v_0 = 0.0008*media_0; } SendByte(0x02); if(HAL_ADC_PollForConversion(&
Dear Members, I am interfacing SD card (2 gb , 4 gb , 16 gb) micro SD cards. Microcontroller Used STM32F103RCT6 With SDIO + FATFS. I am trying to Create the New Word Document,To SD Card...But It Fails. Somebody help me To Do Further To Solve my problems..
..
I recently migrated from STM32CubeMX 5.1 to 5.2 and immediately noticed a "error" in my ADC 1 configuration. It turns out that although I can still select Channels 16 and 17 as single-ended analog inputs from the mode and system-view windows, Cube doesn't give the option for selecting them in the "rank->channel" drop down and instead errantly gives DAC_OUT_1 and DAC_OUT_2 as selection options (See images).I would appreciate it if someone would look into this.
I am actually facing issue in generating the code in STM32CubeMX, seems "STM32Cube FW_F4 V1.24.1" is not available for proper code generation.When I try to download "STM32Cube FW_F4 V1.24.1" I am facing repeated issue. please see the issue screen shot. please help me in resolving the issue.
Hi!When I tried to generate STM32CubeIde project, an error occurred:searchjar length = /home/juraj/Programy/STM32CubeMX/third_parties_plugins/array = com.st.stm32cube.ide.common.services.mx.jar-0.0.9.jarsearchjar path = /home/juraj/Programy/STM32CubeMX/third_parties_plugins/com.st.stm32cube.ide.common.services.mx.jar-0.0.9.jarsearchjar class = com.st.stm32cube.ide.common.services.mx.jar.core.mx.plugin.PlugIn2019-06-02 19:45:58,926 [INFO] ToolchainGenerator:371 - stack trace : java.lang.ClassNotFoundException: com.st.stm32cube.ide.common.services.mx.jar.core.mx.plugin.PlugIn at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:817) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at com.st.microxplorer.plugins.projectmanager.model.ToolchainGenerator.CallMethod(Toolcha
Is there example code for using the Virtual Port Com from CubeMX?(Determine baud, rxchar, txchar [preferably with DMA], CD, etc)I found this: https://damogranlabs.com/2018/02/stm32-usb-cdc/and it looks like a good starting point, but even though I can /see/ the com port in device manager (Com8, and I can change the baud rate and it remembers), I can't open it in TeraTerm or my modbus utility.It /is/ showing up in the WMI, but it doesn't show up in TeraTerm...
CubeMX creates a lot of network activity even if there is no need to do so.I can imagine only two reasons explained to user for CubeMX to do any network activity:To update CubeMX and its componentsTo collect info about usage of CubeMXFirst one I turned OFF in Updater Settings to Manual Check (see screenshot)Second one is turned OFF in User Preferences (see screenshot)So there should be no reason for CubeMX to tell anything to someone in internet or ask anything there. BUT CubeMX does not care and tries to do a LOT of connections in internet. WHY?Every time I "Generate Code" it needs connection. Every time I create project - it needs connection. And all this with trurned usage collection turned off. Looks like spying ... NO?And moreover CubeMX states that it needs this connection to fullfill operation with anoying message box. If I press Home after I opened project it states "A network connection is required to proceed". Really!? CubeMX need internet to go to start screen of CubeMX!?Ple
Background: Quick USB stack test on Nucleo F429 with CubeMX-generated USB CDC stack.Added one line to echo input in CDC_Receive_FS (example here: https://damogranlabs.com/2018/02/stm32-usb-cdc/)Windows 10 PC sees virtual COM7 port (usual ding-****, shows up in device manager OK).But this is weird:PuTTY fails to connect with a message "Unable to open connection to COM7. Unable to configure serial port".TeraTerm connects fine and the F429 echoes characters as expected.Any idea what's going on?Does the USB stack not properly fake the serial port configuration or some other silliness?PuTTY is normally solid...Thanks in advance for any pointers,Best Regards, Dave
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim){ /* USER CODE BEGIN Callback 0 */ if (htim->Instance == TIM1) { osSignalSet(defaultTaskHandle, 0x0001); } /* USER CODE END Callback 0 */ if (htim->Instance == TIM4) { HAL_IncTick(); } /* USER CODE BEGIN Callback 1 */void StartDefaultTask(void const * argument){ /* USER CODE BEGIN StartDefaultTask */ /* Infinite loop */ for(;;) { osSignalWait(0x0001, osWaitForever); HAL_GPIO_TogglePin(GPIOA, USERLED2_Pin); } /* USER CODE END StartDefaultTask */}I tracked the code and found that entering the HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) function could not send a notification signal, I don't know why. If you switch to the GPIO interrupt callback function, it works fine. /* USER CODE END Callback 1 */}
Hi,I want to know how to add the user code in project generated by STM32CUBEMX where there is no user code comments are available.With regards,Sivakrishna
Auto-genned code in v1.14 had USER CODE blocks in MX_CAN1_Init, but after upgrading to v1.15 they are no longer there.Where should I put my ConfigFilter and ActivateNotification calls now?
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.