Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I'm using Nucleo F767ZI. I'm running the default program composed by CubeMX (all is up to date).No errors in the MCU side (USB init etc.)I also define 3 UARTS (3, 4 and 7), I2C1, SPI3, DAC, ADC3. No conflicts.Heap 0x1000. Stack: 0x600.Clock: HSE Bypass clock source (STLink oscillator), LSE disables.USB OTG FS global interrupt is enabled (preemption priority 5, sub priority 0).I tried with and without activate SOF and activate VBUS.In windows 10 I have installed USB driver en.stsw-stm32102.I have not attached the ioc file due to error in this site.Please let me know what can I do in order to find the problem.
I am using recently updated CUBEMX version 6.6.1As soon as i enable FreeRTOS cmss_v2 in cubeMX the USB init disappears... MX_USB_DEVICE_Init is nowhere to be found........
Hello, I have the latest cubemx 6.6.1 installed.I created a simple project with only one SPI enabled, but cubemx stuck in ''Generating user source code''.Attached is the log file in case your need.
The attached simple project contains an ioc-files where the DFSDM peripheral is configured: channel 0 and channel 1; filter 0 for channel 0 and filter 1 for channel 1. In addition i have configured TIM6; but that's not relevant for the issue. This all is based on a real project; but i have narrowed it down to a minimum because only the code generation process is relevant.The issues are in generated file dfsdm.c in sub folder Src. After generation, the file contains two errors:The code between lines 43 and 67 MUST be executed after line 102. In other words: first the channel must be configured and THEN the filter. This is an old error ... maybe two years old or even more. I don't recall where i have read that the present order is wrong. But in order to make my application work, i need to swap the generated order.The statment "static uint32_t DFSDM1_Init = 0;" occurs twice: in line 119 and in line 175 causing build-error. This is an error which must have been introduced during the last t
Hello I'm using a stm32L431. here the documentation :https://www.st.com/en/microcontrollers-microprocessors/stm32l4x1.html#documentationHSI is enabled at 16MHz for USART2, used to receive a 1200Bd signal (7bit data + even parity + 1 stop).I receive wrong characters because of the trim. of parityI already asked a question about the TRIM but that's not the problemhttps://community.st.com/s/question/0D53W00001iwHrbSAE/how-to-trim-the-stm32-hsi-easilyI connect a USB converter (With FT232) on the RX of UART2 to send data to the stm32I use CubeMx to configure UART2>> Case 1 that works : (no parity)Configuration by CubeMX : huart2.Instance = USART2; huart2.Init.BaudRate = 1200; huart2.Init.WordLength = UART_WORDLENGTH_8B; huart2.Init.StopBits = UART_STOPBITS_1; huart2.Init.Parity = UART_PARITY_NONE; huart2.Init.Mode = UART_MODE_RX; huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart2.Init.OverSampling = UART_OVERSAMPLING_16; huart2.Init.OneBit
Hello. I would like to understand a little bit more about the minimum stack and minimum heap parameters on the cube mx: I use stm32cubemx and stm32cubeIDE1.How can I see what is total available heap and stack memory2.Currently, I use Build Analyzer in stm32cubeIDEFrom what I understand, currently, my program occupies 55.39KB RAM of which some of it is stack and some of which is heap is that correct?Is there any way to know how much heap and how much stack precisely?3.I dont understand the connection between the minimum heap size and minimum stack size under the stm32cubemx project manager. Currently I have set both to 0x5000 but I am not sure how it affect the my firmware. Could someone clarify this to me please?4.If I understand this correctly, I can choose how much memory to allow for stack and how much to allow for heap is that correct?5.I use freertos and when I try to create more tasks I run out of heap size: Changing minimum stack or minimum heap size and then generatin
As a project expands, scolling down the main.cpp file is slowing me down. So I wished to break down the main.cpp by selecting "Generate peripheral initialisation as a pair of '.c/.h'files" inside the ioc file-> project manager -> Code Generation ->Generated files. After compiling the generated code, the IDE shows:undefined reference to `MX_FREERTOS_Init()'make: *** [makefile:83: MX_FreeRTOS_test.elf] Error 1The same issue exsits in an empty project, and the issue would not appear if the project is converted to a C project. I noticed that other peripheral files such as usart has a pair of .c/.h file, whereas freertos only has a .c file been generated. in a C project. How can I fix this issue? Will this be fixed in later versions of cubeIDE?
..
hi,i have questions about cubemx with stm32f seriesi'm testing the stm32f with cubemx + keil v5.26originally, i have created many projects using keil CMSIS Pack Installer with classic methodein this project, i can debug thread list on real time when i entered the debug modebut, after i have created a project using CubeMx with keil, i can't see the thread list and statusimage here..case 1: can see the thread list and status case 2: can't see the any information does anyone know this?thank you in advance
STM32CubeMX does not always update the .project files when code is regenerated on an STM32H7 project. This is especially true when moving a peripheral from one core to the other. For example, I generated a project with SPI1 and I2C4 in the M4 context, and verified the project built cleanly. I then moved the two peripherals to the M7 context and regenerated code. The .project files were unchanged, and both the M4 and M7 projects failed. I manually moved the necessary HAL libraries from the M4 .project to the .M7 .project and everything built cleanly again.The problem was similar when I tried to move USB (and CDC class) from M4 to M7. The USBDEVICE files were moved between cores correctly, but the .project files were untouched.Is there a way to force CubeMX to update the .project files?
Also we have tried DMA with SDIO using FATFS file system and we are not successful.
(1) Please tell me if I'm on the correct track here. I have an STM32F1 design (STM32F105RCT6TR) and a STM32CubeMX .ioc file that I used for pin-out assignment in the 64-LQFP package. This morning I created a new .ioc file for an STM32F2 (more specifically STM32F205RETx), also using the 64-LQFP package. The two pin-outs seem effectively identical. So, if both .ioc files seem to get done what I need to get done with regard to pin-out and library function setups, then might it really be true that I could simply insert a well-chosen F2 part onto my board originally intended for an F1?Beyond that, what I also would like to know is, can I make my next redesign of the board intended for the F2 simply support one F2 in the 64-LQFP package -- and then actually get a hold of ALMOST ANY F2 and, as long as the Cube thinks it has all the pin facilities that I need, be successful in putting that F2 on this board?Maybe I should rephrase. Is it true that all the STM32F1's and all the STM32F2's in the
MCU reference : STM32F429ZITxFW package name : STM32Cube FW_F4 V1.25.0MDK ARM(Keil) version : 5.30STM32CubeMX verision : 5.6.1at that time, i want to create code but i can not. just [the code is successfully generated under ~~ .but MDK ARM V4 project generation have a problem]how can i solve this problem? i can see other qeustion that may already have my problem.but i cant sole...ps. i try MDK ARM V4, V5, V5.27.. BUT ALL FAILED
Currently, my custom PCB with STM32F105RCT6TR based on STM32CubeMX software has a single usb DEVICE port connecting to a display head that must play the role of USB Host. Note I'm also using dual CAN plus 5 analog inputs.Now I need to connect TWO usb thumb drives simultaneously to my custom PCB, but with that head optionally present or absent. So I need to KEEP that single usb DEVICE, while ADDING TWO usb hosts for reading/writing the usb thumb drives, including FAT support.I thought of adding an external Vinculum that does SPI-to-USB(dual) bridging, but there are complications there that I don't like. Any of you have STM32 + VNC1/VNC2 experience?I found the STM32F2 family, including STM32F2?7 series [EDIT 07/30/22: example STM32F207VCT7 {256KB Flash, 132KB Ram}, but I need to compare program flash memory size and ram size, as well as availability, to my current STM32F105RCT6TR {256KB Flash, 64KB Ram}. Or even STM32F205RGT6 looks reasonably priced, same LPFQ-64 package, 1MB Flash, 128K
I'm trying to control a Servo motor (MG90S) using the STM32F767Zi by leveraging the TIM2 Channel 1 (PA0). The Servo requires a 50Hz frequency (20ms) signal. The APB1 bus gives TIM2 timer port 108MHz frequency. The Servo is powered through a 5V port through STM and STM is powered through USB type B cable from my laptop.I'm using the below calculations for PSC and ARR and have given a Duty Cycle of 2.5% - 12.5%. (0.5ms - 2.5ms)My Timer_freq TIM2(APB1) is 108MHZ(108000000)Required Frequency is 50Hzi.e PSC*ARR = 108000000/50 == 2160000PSC = 2160-1ARR = 1000Duty Cycle given is: (since ARR = 1000 i.e 100%)TIM2->CCR1 = 25 (0 degrees - 2.5%)TIM2->CCR1 = 125 (180 degrees - 12.5%)Code SnippetMX_GPIO_Init(); MX_TIM2_Init(); /* USER CODE BEGIN 2 */ HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ TIM2->CCR1 = 25; // 0 degrees HAL_Delay(500
I am trying to create file in sd card and pass some string to that file. And I also want to initiate DMA for SDMMC. How can i do that? there is no any such tutorial for h7
Why in particular has the CMSIS freertos wrapper been chosen as the only option for the cubeMX ecosystem? Has there been any consideration to add a raw FreeRTOS API option to cubeMX?For an example of what seems iffy, see osThreadNew in cmsis_os2.c where it tries to standardize the stack size. While this may seem ideal, it really is a cause for confusion. Also, being forced to use 56 levels of priority for the complete FreeRTOS project seems questionable.About its use the the USB stack, its mixed use from ISR non ISR seems a bit sketchy maybe? Shouldn't this be better defined?For the USB stack, I wish it was something like#if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_PORT_EVENT; #if (USBH_FREERTOS_API) xQueueSendToBack (phost->os_event, phost->os_msg, 0U) #elif (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif
Probably related to gnu-tools-for-stm32.9-2020-q2-update 746 | _ptr = _REENT; | ^~~~~~c:\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\include\stdio.h:746:9: note: each undeclared identifier is reported only once for each function it appears inc:\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\include\stdio.h: In function '_putchar_unlocked':c:\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\include\stdio.h:755:9: error: '_REENT' undeclared (first use in this function) 755 | _ptr = _REENT; | ^~~~~~make: *** [Core/Src/subdir.mk:130:
Hello friends,I used to use stm32cubemx ethernet with previous versions of cubemx and cubeide. However, the new release wondered me in the way that it didn't generate any code for the ethernet peripheral initialization, by which I mean formerly there was a function in the generated code "MX_ETH_init()". But in the recent version even with the activation of LWIP this function isn't generated. I use stm32f429bit6 chip along with stm32cubemx 6.1.1 and cubeide 1.10.1.Moreover, there was Phy Address Parameter in parameter settings in previous versions which I couldn't find that in the new release.
In order to use the HAL's register callback capability, various flags are set for each peripheral in the stm32***_hal_config.h generated by CubeMX such as USE_HAL_FDCAN_REGISTER_CALLBACKS.The issue is that these defines don't look for a prior define first, so it's not possible to override via compiler options etc and each time the project is regenerated it replaces this file.Is there not a way that these can be set that won't be erased upon each generation?Many thanks
AFAICT this is a libc.a although there are quite a lot of these loaded under c:\st\...I have spent a huge amount of time with objcopy trying to weaken a long list of stupid (empty but not replaceable) mutex calls in printf and malloc etc. like this--weaken-symbol=__lock___arc4random_mutex--weaken-symbol=__lock___at_quick_exit_mutex--weaken-symbol=__lock___atexit_recursive_mutex--weaken-symbol=__lock___dd_hash_mutex--weaken-symbol=__lock___env_recursive_mutex--weaken-symbol=__lock___malloc_recursive_mutex--weaken-symbol=__lock___sfp_recursive_mutex--weaken-symbol=__lock___sinit_recursive_mutex --weaken-symbol=__lock___tz_mutex--weaken-symbol=__retarget_lock_acquire--weaken-symbol=__retarget_lock_acquire_recursive--weaken-symbol=__retarget_lock_close--weaken-symbol=__retarget_lock_close_recursive--weaken-symbol=__retarget_lock_init--weaken-symbol=__retarget_lock_init_recursive--weaken-symbol=__retarget_lock_release--weaken-symbol=__retarget_lock_release_recursive--weaken-symbol=__re
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.