Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I am using a STM32N6570-DK board and I can't understand how to configurate the FSBL, Application, and the External memory stuff in Cubemx. Can anyone describe how to use and configurate these three options?
When generating a CMake project using NetXDuo with lan8742 as phy driver and DHCP Client enabled, the necessary includes for the lan8742 bsp component and the dhcp client addon are missing from the CMake build configuration.However when using the STM32CubeIDE as the export target in CubeMX, the includes are present in Project --> Properties --> C/C++ Build --> MCU GCC Compiler --> Include Paths. Building works just fine aswell.
In my project, i use STM32F070CBT6 microcontroller and i use STM32CubeIDE to set up my project. At first i did not place all pins which i use in this project if i get an error. I define only SCL and SDA pins for PB14 and PB13 pins for that purpose. I did not get any error but when i try to generate code, it did not generate anything. I am confused about what i did. I am waiting for your help.
Using STM32CubeMX 6.14.0 with H7 package 1.12.1.When Ethernet is set up with number of RX descriptors set to 16, the default LWIP ethernet driver rx buffer pool overflows. This is caused by during startup, HAL_ETH_Start_IT calls ETH_UpdateDescriptor. This allocates all 16 rx descriptors to a slot in the rx pool. Entirely consuming the pool.Upon first packet receive, via ethernet_input, low_level_input, EHAL_ETH_ReadData, ETH_UpdateDescriptor is called to allocate 1 more descriptor. This allocation fails.Some time later a descriptor is freed, next received packet, a descriptor can be allocated. Every second received packet fails allocation.This behavior should either be prevented by the driver code, or a warning generated in STM32CubeMX that it wont work.It appears setting ETH_RX_BUFFER_CNT to 17, is enough to alleviate the issue. My buffers are all 1568 bytes so can fit a full ethernet packet, so each receive fits in a packet. But for small
I'm trying to create a new STM32H747 project in STM32CubeMX and right away I'm running into an odd issue - I can't turn off FreeRTOS and FatFS. It reports that "peripheral FreeRTOS_M7 could not be removed from context Cortex M7 as it's forced for this peripheral."I need to use Azure RTOS in this project, and I can enable its packages for the project, but I still can't disable FreeRTOS. I had no trouble with this in my last STM32H743 project, so I'm a little puzzled. Is there some setting I'm missing?FYI, I only need the RTOS on the M7 core.
Hi guysI can't find threadx support for F4, F7 and H7, it's only available for C0 series. According to this post, and my google. It should support most stm32 MCUs. What can I do to enable threadx support for these MCUs?
In my project I have FreeRTOS enabled, which occupies SysTick and Time increment is handled by TIM1. I also want to use basic timer as TIM6.However, I don't want them both processed in weak redefined void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)Thus, I enabled register callback for TIM in CubeMX -> advance settings -> register callbacks.The generated code appears in stm32f4xx_hal_timebase_tim.c and looks as following:HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) { RCC_ClkInitTypeDef clkconfig; uint32_t uwTimclock = 0U; uint32_t uwPrescalerValue = 0U; uint32_t pFLatency; HAL_StatusTypeDef status; /* Enable TIM1 clock */ __HAL_RCC_TIM1_CLK_ENABLE(); /* Get clock configuration */ HAL_RCC_GetClockConfig(&clkconfig, &pFLatency); /* Compute TIM1 clock */ uwTimclock = 2*HAL_RCC_GetPCLK2Freq(); /* Compute the prescaler value to have TIM1 counter clock equal to 1MHz */ uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000U) - 1U);
Hi, After configuring NUCLEO-H753ZI using CubeMX, I clicked "GENERATE CODE", the process started for a few seconds, then totally frozen with no progress, no end. What I should do now? Thanks,Rong
I am using Arduino GIGA R1 to build an deploy model from simulink. While building model I am getting " Error:Peripherals in STM32CubeMX project are not configured to generate a global initialization function. To generate a global initialization function open STM32CubeMX project > Project Manager > Advanced Settings > Generated Function Calls and disable "Visibility(static)" option for all the peripherals.Suggested Actions:Click 'Open' to open project in STM32CubeMX." from simulink. Although I followed the steps mentioned in the build summary I am still getting the same error. Please help.
Hi ST-Community, I have a problem with my STM32CubeMX: The pin context assignment for STM32WL55JCI7 is missing. Does anyone have the same problem and know how to fix it? (No generated code for GPIOs) Many thanks in advance for your support! Kind regards,Philipp
I've switched to mac and like any responsible adult all of my projects are handled by git. But when I generated the code with CubeMX it was a little confusing to see so many files have changed. A quick search brought me to this topic without any answer:https://community.st.com/s/question/0D50X00009XkgaG/cubemx-line-ends-in-generated-codeThe solution is that CubeMX uses a repository of files in the background (which have DOS line ending) and it appends different files together to generate your code. So the easy way to fix the problem is to do the following steps:`brew install dos2unix`find where `STM32Cube` directory is (mine was under home)Go to `STM32Cube/Repository/STM32Cube_FW_xx_xxxx` which is the firmware version you use. If you're not sure of it, open your CubeMX go to Project Manager, on the left select Project and under "Mcu and Firmware Package" find the firmware version. Running the commands at Repository directory fixes all the firmwares.Open a terminal at the firmware repos
I've discovered that when I configure the TIM2 timer to ‘input Capture direct mode’ for any port A input pin it doesn’t add the necessary line in HAL_TIM_Base_MspInit() to configure the pin to alternate mode, namely the following line is missing in HAL_TIM_Base_MspInit():‘GPIO_InitStruct.Alternate = GPIO_AF1_TIM2;’The line is present when port B is selected, so that works.My work-around (for PA0) is to add the line to the main code:GPIOA->AFR[0] |= (1U << GPIO_AFRL_AFSEL0_Pos);I'm using Stm32CubeMX v.6.14.0 with STM32Cube_FW_U0_V1.2.0
Dear @KDJEM.1 ,I have seen that in STM32CubeIDE Version: 1.16.0 this issue is solved if the "Generate peripheral inizialization as a pair of '.c/.h' files per peripheral" is NOT selected in the ".ioc". Otherwise, the problem keeps there and "HAL_PWREx_EnableVddUSB()" is not called.Here, you can see the code if the option is NOT selected: void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd) { RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; if(hpcd->Instance==USB_DRD_FS) { /* USER CODE BEGIN USB_DRD_FS_MspInit 0 */ /* USER CODE END USB_DRD_FS_MspInit 0 */ /** Initializes the peripherals clock */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { Error_Handler(); } /* Enable VDDUSB */ HAL_PWREx_EnableVddUSB(); /* Peripheral clock enable */ __HAL_RCC_USB_CLK_ENABLE(); /* USB_DRD_FS interrupt Init */ HAL_
Using "Firmware Relative Path" and generate code with references f STM32CubeIDE will mix relative and absolute paths in generated project files STM32CubeMX 6.14.0 on Windows 11.1. Create a directory and unzip en.stm32cubeh5-v1-5-0.zip there 1. Create a minimalistic new project in STM32CubeMX for STM32H5.2. In tab Project Manager, tab Project:2.1 Set Project Location to the created directory and set the name of your project2.2 Set Toolchain / IDE to STM32CubeIDE2.3 Uncheck Use Default Firmware Location2.4 Use the browse button and select STM32Cube_FW_H5_V1.5.0 in the directory.3. In tab Project Manager, tab Code generator: choose option Add necessary library files as reference in the toolchain project configuration file4. Save the project and generate the code.Note that the path is correctly stored as a relative path in the .ioc-file with the key ProjectManager.CustomerFirmwarePackageBugsDespite that the actual relative path from Toolchain Folder Location i
I tried to use cmake with CubeMx but I cant make RTT works.Error:multiple definition of `_write_r'; /usr/lib/gcc/arm-none-eabi/13.2.0/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(libc_a-writer.o):/build/arm-none-eabi-newlib/src/build-nano/arm-none-eabi/thumb/v7-m/nofp/newlib/../../../../../../newlib-4.3.0.20230120/newlib/libc/reent/writer.c:45: first defined hereRTT needs to define _write_r but seems already define.If I comment this line from the gcc tool chain it solves the problem:set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--start-group -lc -lm -Wl,--end-group")Before I used my custom cmake this way:```target_link_options(${EXECUTABLE} PRIVATE-T${MCU_LINKER_SCRIPT}${CPU_PARAMETERS}-Wl,-Map=${CMAKE_PROJECT_NAME}.map--specs=nosys.specs-Wl,--start-group-lc-lm-lstdc++-Wl,--end-group-Wl,--print-memory-usage)```and have no problem so I don't really understand why.Also tried -fcommon it does nothing.
Hi everyone,I noticed that CubeMX 6.14.0 ignores the octospi parameter settings. I created a new project for the NucleoU5A5 board, configured Octospi1 with a clock prescaler of 99. I notice the following behaviorGenerated code (CubeIDE) has a prescaler value of 1Next time I open the IOC file, the Octospi prescaler is back to 1I didn't check other settings. I have attached my ioc file Kind regards,Timon Zijnge
MCU:STM32U585xxEnv:ThreadX + USBX + FileXI want to use USBX add my own class type, but I'm already have 3 classes, HID, MSC and CDC ACM, it means 4 classes after added my own.In file (ux_device_descriptors.h) have a define (USBD_MAX_SUPPORTED_CLASS 3U), this value determined the (tclasslist) array size, also the framework max class, can not be changed by user define or STM32CubeMX(no option find).If I change this define, it will be overwrite by STM32CubeMX when generated code. How can I do this correctly?
In many cases, especially for middleware, it may be necessary to extend the code generated by CubeMX.Since not all files have sections that are untouched by the code generator or some places inside a file are missing those user code sections, I'm often in the need of a feature that would allow to add my own sections by adding a comment such as /* USER CODE BEGIN */ /* USER CODE END */ to my source file. Unfortunately, those sections are overwritten as soon as the code generator gets triggered again.Would it be possible to add this feature?How does the code generator currently handle those sections anyway if not looking for the specific comments (since adding my own user code comments does not work)?
The GPIO clock is the only code that seemed to be generated under the initialization function. the other necessary code such as the following was not created. GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitStruct.Pin = GPIO_PIN_8; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);In the setup GUI I had selected the pin PC8, and set it to a GPIO_Output yet the above code was not generated.
Hello everyone, I'm currently using the STM32H745BIT6 microcontroller and I'm having difficulty configuring the system so that the M7 core can use internal memory (Internal RAM/Flash) to store data from TouchGFX. I would like to avoid using any external memory (external RAM or Flash). I'm not sure how to properly configure this. I would greatly appreciate any support or guidance. Thank you !
Hi,A small but annoying bug with STM32CubeMX 6.14.0 with H7 package 1.12.1. Every time I change anything in the LWIP general settings (e.g. DHCP enable/disable), the PHY setting changes by itself from USER_PHY to undefined. This is a nuisance as if you generate code without realizing, some files are deleted meaning you lose user defined code blocks.Example file attached.On a side note, ST please add a KSZ8081 PHY option. Seems to be commonly asked for. The code is 95% the same as the LAN8742 option. I have attached a KSZ8081 example to show how similar it is. Or at least abstract the PHY function call names so that just the part number specific function definitions need to be changed (as is done in the EthPHY.h example attached.The USER_DEFINED code template that is generated is not much use. It does not allow returning error for init failure. It also does not have access to the netif or PHY register read/write functions.Thanks
Hi, I do not use PD8/PD9/PB0 pins in my design. Therefore I did not configure them in CubeMax. Why NECLEO-H753ZI CUBEMX Pinout View PD8/PD9/PB0 pins are in RED? Thanks, Peter
I am trying to get the USART2 working on my Nucleo-H7 board. I am using HAL_UART_Transmit for the TX side. This works fine. But when I use HAL_UART_Receive on the RX side, there is never any RX data coming into the device. I have stepped through the HAL lower layers and watched the SFRs for any activity, but there is never any activity on the RX side (the RXNE bit never toggles). I'm starting to wonder if there is a hardware issue with the Nucleo board.My project is an enhancement of the NX-TXP_Echo_Server example which receives 64 bytes received from the ethernet interface, and forwards the 64 byte command to the USART device to be used by another board. The remote board basically echoes the serial data received from the Nucleo board. Again the TX function of the Nucleo board works fine. But the RX side never sees any data received by the chip. I have a scope on the TX and RX lines and can verify that the remote board is indeed receiving the data sent to if from the Nucleo, and it ind
Hi,just made an update of CubeMX from 6.11.1 to 6.14.The problem I have is that our comments within user blocks were ISO-8859-1 encoded and this never was a problem until now and with 6.14, when we generate code, all Umlauts are replaced with the UTF-8 sequence EF BF BD.Is there an option to tell CubeMX to use ISO-8859-1 for reading and encoding?
I'm trying to configure SAI2 as a I2S master.I2S_CKIN has been enabledBut the configuration cannot be loaded when I changed SAI A Mode to master.Now I got a page like this.Is there anything I can do to fix it?
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.