Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on June 01, 2017 at 15:15 I have generated a GPDSC project with CubeMX 4.0 for an STM32F103C8Tx which utilized the SPI1 peripherial. In the output XML the following section is present: <component Cclass='Device' Cgroup='STM32Cube HAL' Csub='SPI' Cversion='0.2.0'> <description></description> <files> <file category='header' condition='' name='Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_spi.h'/> <file category='source' condition='' name='Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c'/> <file category='header' condition='' name='Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_spi_ex.h'/> <file category='source' condition='' name='Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi_ex.c'/> </files> </component>�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? However the stm32f1xx_hal_spi_ex.h is not present in the Drivers\STM32F1xx_HAL_Driver\Inc folder: mm@mm-imac:/tmp/pocs$ ll Drivers/STM32F1xx_HAL_Driver/I
Posted on February 07, 2018 at 17:11Hi, I have a problem with STMCubeMx v4.24.0.My problem is : I cannot open a new project created with STM32CubeMx v4.24.0. This project was created from scratched. After I finish editing the file, I save it and close the software. When I re-open the project file, nothing happens. My mouse cursor is transformed into a blue circle (busy). It's impossible to close the tool without forcing (ctrl-alt-supr or task manager).In STM32CubeMX.log I have these errors : 2018-02-07 16:57:00,996 [INFO] ImportTextPane:155 - (OptionalMessage_ERROR) IP (RCC) : Parameter (ADCFreq_Value) has invalid value (96000000)2018-02-07 16:57:00,997 [INFO] ImportTextPane:155 - (OptionalMessage_ERROR) IP (RCC) : Invalid parameter (FamilyName)When I open the .ioc file, I have these value for these attributes :RCC.ADCFreq_Value=96000000...RCC.FamilyName=MI am sure to configure correctly my clocks before I close the file. My ADC clock is 80MHz and not 96MHz. If I
Posted on January 30, 2018 at 16:59Hi,when I generate a example for the nucleo32 L432kc everything is fine, until I check the option freeRTOSAfter this the includes are not correct anymore:>>>>>Src\freertos.o: In function `StartDefaultTask':E:\Workspaces\Atollic9\432kcTest\Debug/..\Src/freertos.c:118: undefined reference to `HAL_GPIO_TogglePin'E:\Workspaces\Atollic9\432kcTest\Debug/..\Src/freertos.c:119: undefined reference to `osDelay'Src\freertos.o: In function `MX_FREERTOS_Init':E:\Workspaces\Atollic9\432kcTest\Debug/..\Src/freertos.c:99: undefined reference to `osThreadCreate'Src\gpio.o: In function `MX_GPIO_Init':E:\Workspaces\Atollic9\432kcTest\Debug/..\Src/gpio.c:80: undefined reference to `HAL_GPIO_WritePin'E:\Workspaces\Atollic9\432kcTest\Debug/..\Src/gpio.c:87: undefined reference to `HAL_GPIO_Init'Src\main.o: In function `SystemClock_Config':E:\Workspaces\Atollic9\432kcTest\Debug/..\Src/main.c:156: undefined reference to `HAL_RCC_OscConfig'E:\Workspaces\Atoll
Posted on March 20, 2018 at 03:21After upgrading to 4.25 and regenerating the project, I went through a diff of all the changes in generated code since the previous version. The majority were whitespace and comment changes which were fine.But I did notice the following which looks like path breakage in the generated Makefile:Notice the insertion of the '/' preceding 'Src', which breaks the relative path.A similar change that makes a relative path into absolute is in mx.scratch:#cubemx #bug #code-generation
Posted on August 08, 2017 at 10:23 I have just updated one of my projects to STM32F1 FW 1.6.0, and my code was not able to compiled anymore. IOC file attached. Here is my clocking scheme: As you can see the LSI oscillator is not used, so I assume this is why the LSI_VALUE is not generated to the stm32f1xx_hal_rcc.h file. However the LSI_VALUE constant is still used in the stm32f1xx_hal_rcc_ex.c: case RCC_PERIPHCLK_RTC: { /* Get RCC BDCR configuration ------------------------------------------------------*/ temp_reg = RCC->BDCR; /* Check if LSE is ready if RTC clock selection is LSE */ if (((temp_reg & RCC_BDCR_RTCSEL) == RCC_RTCCLKSOURCE_LSE) && (HAL_IS_BIT_SET(temp_reg, RCC_BDCR_LSERDY))) { frequency = LSE_VALUE; } /* Check if LSI is ready if RTC clock selection is LSI */ else if (((temp_reg & RCC_BDCR_RTCSEL) == RCC_RTCCLKSOURCE_LSI) && (HAL_IS_BIT_SET(RCC->CSR, RCC_CSR_LSIRDY))) { frequency = LSI_VALUE; } else if (((temp_reg
Posted on January 31, 2018 at 11:06CubeMx 4.24.0 (Eclipse plugin) generates invalid MBEDTLS_CONFIG_FILE symbol definition for TrueStudio (9.0.0 Windows) project Double quoted 'mbedtls_config.h' must be inside single quotes:MBEDTLS_CONFIG_FILE=''mbedtls_config.h''Otherwise the defined macro will not have double quotes when C preprocessor sees it, causing include statements to fail.#cube-mx #truestudio
Posted on March 08, 2018 at 00:01Creating a project using version 4.24 of CubeMX for the STM32F4Discovery board, I select 'yes' to 'Initialize all peripherals with their default Mode.'The RCC block selects 'Crystal/Ceramic Resonator' for the LSE. However, the device (X3) is not populated on the F4Discovery board, and so this entry should be 'disabled'.The user manual (UM1472) states the part not provided is X1, but the schematic I have (1/9/2012) shows X3--a typo?An issue, or my interpretation?Thank you.#cubemx #stm32f4discovery
Posted on March 07, 2018 at 00:16Why CubeMX 4.24 says that PB12 conflicts with USB_OTG_HS when external HS PHY is not is use?The MCU is F446ZCT, its USB HS core is in FS, host only mode, Activate_SOF and Activate_VBUS unchecked.PB12 can have two alternate functions for USB HS core - but both are related only to HS mode, correct?So why conflict with the PHY in FS internal PHY mode?(and, by the way, what does ''Activate_VBUS'' in host mode? I use a different output pin to switch VBUS to the port).Thanks,-- pavel#usb-fs #cubemx-v4.24
Posted on March 07, 2018 at 13:49Hello ST community,Our customer requested a software development for his device based on a ST microcontroller. After the development process ends he wants to have the source code what is a common condition for a service request.When I use directly the HAL library there shouldn't be any license problems like explained in this topic: https://community.st.com/s/question/0D50X00009XkeH0SAJ/commercial-use-of-st-hal-libraries-and-middlewaresBut is it allowed to propagate the generated code (Init functions, HAL...) and the project file of STM32CubeMX? According to the license agreement http://www.st.com/resource/en/license_agreement/dm00217720.pdf:Unless otherwise explicitly stated in this Agreement, You may not sell, assign, sublicense, lease, rent or otherwise distribute the Licensed Software for commercial purposes, in whole or in part....No source code relating to and/or based upon Licensed Software is to be made available or sub-licensed by You unless ex
Posted on January 19, 2018 at 16:12The makefile output feature of CMX is really great but as others have said here it has bugs that make it somewhat problematic, and it appears that ST are not taking it too seriously.I am trying to use CMX with Visual Studio Code via makefile. In particular the fact that you have to manually define the path for 'BINPATH = 'in the makefile is wrong because all changes to the makefile are lost if you modify the project in CMX. Better to make BINPATH (and possibly other makefile variables) a definition in CMX if you choose makefile output - that way it is always incuded in the generated makefile.Anyone figured another way to do this?
Posted on February 14, 2018 at 14:43Would be very helpful if the Cube automatically showed the clock frequency for timers in Configuration view.Otherwise I have to dig out of the RM which bus corresponds to specific timer - AHB1 or AHB2, then open the Clock configuration view and search there. And would be nice if Cube had converter from milliseconds to prescaler value.Thanks...-- pa#cube-mx
Posted on August 06, 2017 at 19:22Hello!!I post an .IOC file that produces initialization code for Keil v5.This file produced with 4.22 version of CubeMX and uses the latest firmaware for L1 family.At module, gpio.c and especialy inside called function LL_SYSCFG_SetEXTISource(LL_AHB1_GRP1_PERIPH_GPIOA, LL_SYSCFG_EXTI_LINE0); , the first parameter, LL_AHB1_GRP1_PERIPH_GPIOA is not correct.Inside the module stm32l1xx_ll_system.h, contained the right parameters must put.This parameter has value 0x01, but the correct LL_SYSCFG_EXTI_PORTA has value 0x00.This cause problem to set the correct source of EXTI interrupts.#ll #stm32cubemx
Posted on October 04, 2017 at 11:52Hi,Currently the defaults set for STM32F042 in STM32CubeMX v4.22.1, FW 1.9.0 for USB CDC will not compile after generation.This is because the USB CDC Rx and Tx Buffers are set to 2048B each by default, which is too much considering the micro has 6kB RAM. In previous versions this was set to the minimum 4B and caused no problems (at least for me).Can you please update the defaults to be compilable by default?Thanks P.S. It took me quite a long time to figure this out, and it was only thanks to having a project I created with cube before.#stm32cubemx #stm32f042 #usb-cdc #defaults
Posted on July 02, 2017 at 02:49I am using STM32CubeMX 4.21.0 with the STM32L4 HAL library version 1.8.1.It seems that the Src/usb_device.c includes code with customization points (e.g. HAL_PCDEx_BCD_Callback() has a user code comment block) but there are no customization points within the file at global scope for adding things like headers, variables, function declarations or definitions. Is this an oversight?Please add customization points at global scope in this file.#stm32l4 #stm32cubemx #pcd
Posted on January 18, 2018 at 16:31Since ST already https://github.com/STMicroelectronics, could you consider publishing there the CubeMX repositories content?So that users could clone the Cube BSPs and libraries into their projects, as git sub-modules and offer patches, pull requests and so on?Same with historical low-level libraries.Regards,Pavel#cube-mx
Posted on March 03, 2018 at 07:46I am using STM32CUBE V1.0 Version 4.24.0I am using STM32F107VC.In the RCC settingsFor the purpose to know the what code has been modified.I use WinMerge to compare the outputs.I enable the [1] (mark by yellow) and [3] (mark by yellow) ♯♯♯, then generate a project A.Then I disable [1] and [3], then generate another project Bafter comparing project A and B... I found [1] and [3] doesn't do any thing to the code generation.So, the [1] and [3] are useless?#rcc #stm32-hal-rcc #stm32cubemx-4.24.0
Posted on February 27, 2018 at 21:43Hey everyone! I'm trying to install the STM32CubeMX version 4.24.0 as a plugin in TrueStudio by going into help->install new software... But i always get 'No software site found at..(Directory)'. I have tryid different versions of the STM32CubeMx aswell and I get the same result. What do i do? I run the TrueStudio 9.0.0. PLEASE HELP#stm32cubemx-4.24.0 #truestudio-9.0.0
Posted on March 28, 2017 at 22:56Hello, I still tried with I2C on nucleo F401RE. I am use STM32CubeMx for generate files, but my program is not working. I want send three bytes on I2C in blovking mode. This is my code: I2C not working, still is log. 0 on SDA and SCL. Please help me.In rar. is all files.int main(void){/* USER CODE BEGIN 1 *//* USER CODE END 1 *//* MCU Configuration----------------------------------------------------------*//* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init();/* Configure the system clock */ SystemClock_Config();/* Initialize all configured peripherals */ MX_GPIO_Init(); MX_I2C1_Init();/* USER CODE BEGIN 2 *//* USER CODE END 2 */uint8_t buffer[3]={0x33,0x87,0X76};while (1) { HAL_I2C_Master_Transmit(&hi2c1,0X40,buffer,3,10); HAL_Delay(100); HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_5);/* USER CODE BEGIN 3 */} /* USER CODE END 3 */}#hal #smt32-nucleo #cube-mx #i2c
Posted on February 27, 2018 at 01:04Version 4.24.0 STM32CubeMX - STM32F303RCTx has pin 18 as PF4 instead VSS - thought I had an extra signal!!#cubemx-v4.24
Posted on February 25, 2018 at 00:06DUT:Device: STM32F407VGTBoard: STM32F4-DISCOVERYPC part:OS: Windows 10Driver: USB Serial Device, Microsoft, 6/21/2006, v10.0.16299.15Initialization code is generated using the STM32CubeMX Version 4.24.0 with STM32Cube_FW_F4_V1.19.0.Attached are already pre-built initially generated project with CubeMX (initial.7z) and fixed project (fixed.7z). The .ioc files are included to the projects.When running initial.7z it acts normally until the port opening trial. Port opening fails.The fixed.7z has no such behavior and is running good so far.The key line which is different for two projects:USBD_memset(pdev->pClassData, 0x00, sizeof (USBD_CDC_HandleTypeDef));Up to you to decide whether the problem is caused by non-initialized memory usage or by dynamic memory usage in principle.I can describe more why I'm sure the bug is here. Please let me know if more evidences are needed.#bug #cubemx #usb-cdc
Posted on February 02, 2017 at 11:40The ST HAL should make programming STM32 microcontrollers easier. After all, it is a 'Hardware Abstraction Layer'. It provides an interface to the user, so he doesn't need to manipulate the hardware registers directly.An abstraction layer is called 'leaky' when its interface isn't sufficient, such that the user needs to dig deeper into the low-level stuff. The failure of an abstraction layer generally has two causes:(1) BugsI didn't bumb into bugs in the ST HAL. It looks like the code is of good quality and well-maintained.(2) Lacking documentationThis is definitely the weakest point of the ST HAL. The documentation is so brief that I end up doing this:>> Study the whole (related) chapters in the 'Reference Manual' of the chip>> Open the functions of the ST HAL and read their code, study how the actual registers are manipulatedThe lacking documentation forces the user to dig into the low-level stuff. This makes the abstraction very 'leak
Posted on February 17, 2017 at 04:44Hi! I'm using Linux x86_64 with OpenJDK 64-Bit Server VM (build 25.71-b15, mixed mode). The versions affected: 4.19.0, 4.18.0When I start STM32CubeMX and create a project, everything is fine. But if I click the 'Clock Configuration' tab, the whole X11 session freezes.Please drop me any idea how to get more info: traces, debug, anything?#cubemx
Posted on December 14, 2017 at 13:10There are lot of bugs in STM32CubeMX and its components. Having public issue tracker will simplify the situation with reporting all issues and tracking their status.Idally, having public source code of STM32CubeMX can also atract community to fix these issues and send Pull Requests to ST developers. Waiting more then year (or forever) for fixing a bug is not ideal situation.What do you think, ST?#bug #stm32cubemx
Posted on May 16, 2017 at 12:51I'm using STMCubeMX 4.21.0 to generate custom USB HID project. My device needs to send frequent HID reports, therefore it calls USBD_CUSTOM_HID_SendReport every 1-10ms.This function always returns USBD_OK, even if previous report is not transmitted - in this case it just ignores new report. It becomes a problem because there is no way for user code to check if data was successfully transmitted or another attempt is required.I've implemented a local workaround in this function: it returns USBD_BUSY when hhid->state == CUSTOM_HID_BUSYBut this change is not in user modifiable area, therefore this change is lost on every project re-generation in CubeMX.Am I missing something, is there any other good way to work around this issue?#cubemx-usb-hid
Posted on February 21, 2018 at 14:08I am trying to use the latest CubeMX V4.24 with FatFS R0.12c, I am using FreeRTOS in my project. The SD card is connected using SDIO 4-bits wide bus. The MCU is STM32F427. HAL driver is V1.19.The problem is that f_mount function is never working. Seems that a response from queue never comes in function SD_read from sd_diskio.c file:event = osMessageGet(SDQueueID, SD_TIMEOUT);I was able to make f_mount work OK by applying suggestions described in this post, which refers to CubeMX V4.23: https://community.st.com/0D50X00009XkWyLSAV, however now creation of a file does not work.Can you suggest anything?P.S. I know that when there is no FreeRTOS present operation with SD card is working well as provided in examples of CubeMX.#cubemx-v4.24 #fatfs-r0.12c #cubemx-v4.24-with-fatfs-r0.12c #freertos #hal-driver-v1.19
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.