Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on May 17, 2017 at 08:36Title says all. There are a plenty of blank space on the welcome screen which could be utilized better:It would be nice if th recent N projects would be listed there, so it would spare a few context menu opening every time.Like it is done in the QtCreator:Adding ability to restore the last session would be awesome.#cubemx #feature-request
Posted on March 08, 2017 at 14:33Hi,I'm having problems with STM32 CubeMX (v4.19.0) during the setup of the ADC2 peripheral (may be a bug...).Even if the number of conversion is ONE, I have two different ranks both pointing to the same ADC channel (please refer to the attached screenshot).I looked into the ioc and some lines don't convince me (I have only channel 4 active):'...ADC2.Channel-20\&sharpChannelRegularConversion=ADC_CHANNEL_4ADC2.Channel-4\&sharpChannelRegularConversion=ADC_CHANNEL_4ADC2.Channel-8\&sharpChannelRegularConversion=ADC_CHANNEL_4...'Is there any .ioc file cleaner that can fix this behavior?Thanks in advanceFlavio#cubemx-bug
Posted on March 13, 2017 at 07:27In CubeMX 4.19.0 I have USART1 Asynchronous and FREERTOS enabled. USART1 global interrupt is enabled. In NVIC configuration dialog I have:USART1 global interrupt: On, Preemption priority 5, Sub priority 0, Uses FREERTOS functions On.Actually, in my program USART1 interrupt handler doesn't use FREERTOS functions. I want to change the interrupt priority. So, I change it by the following way:USART1 global interrupt: On, Preemption priority 3, Sub priority 0, Uses FREERTOS functions Off.Save the project, exit and open it again. USART1 and NVIC are signed with red. When I open NVIC, the following message is shown:Preemption priority of interrupts should be >=5 if their handlers call system functions. See FREERTOS_LIBRARY_MAX_SYSCALL_INTERRUPT parameter.When NVIC is opened, I see the following parameters:USART1 global interrupt: On, Preemption priority 3, Sub priority 0, Uses FREERTOS functions On.So, CubeMX keeps incorrect value of 'Uses FREERTOS f
Posted on November 29, 2017 at 08:52Hello there,Here is my CubeMX version:The libs versions:So I am using STM32L4. The bug is within ADC initialization procedure created by CubeMX. This is how to trace the bug:Locate this function:HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig)In the file stm32l4xx_hal_adc.c. In line 2201 there is an assert:assert_param(IS_ADC_REGULAR_RANK(sConfig->Rank));The condition for it is wrong, If we go to the IS_ADC_REGULAR_RANK code we get:/** * @brief Verify the ADC regular channel setting. * @param __CHANNEL__ programmed ADC regular channel. * @retval SET (__CHANNEL__ is valid) or RESET (__CHANNEL__ is invalid) */&sharpdefine IS_ADC_REGULAR_RANK(__CHANNEL__) (((__CHANNEL__) == ADC_REGULAR_RANK_1 ) || \ &nb
Posted on January 08, 2018 at 01:14Suppose that a hardware developer wants to pass in a Cube file some info for a fellow programmer.For example tell which UART or GPIO pin to use: &sharpdefine RS232_UART USART4&sharpdefine LED_PIN (GPIOB, 10)But Cube won't allow this. It understands only literal numbers and quoted strings.It will allow &sharpdefine RS232_UART 'USART4' - but this is completely useless for the purpose.How hard would be enabling any user definition text in the Cube code generator?Regards, - pa#cube-mx
Posted on January 07, 2018 at 19:42When your application uses SRAM3 (0x30040000) in D2 domain,it's a must to enable the clock for the domain. I cannot find an option in CubeMXand CubeMX does not generate the important code line.SRAM3 is used for Ethernet for example.The modified SystemClock_Config() function must be like this:/** System Clock Configuration*/void SystemClock_Config(void){ RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; HAL_StatusTypeDef ret = HAL_OK; /*!< Supply configuration update enable */ MODIFY_REG(PWR->CR3, PWR_CR3_SCUEN, 0); /* The voltage scaling allows optimizing the power consumption when the device is clocked below the maximum system frequency, to update the voltage scaling value regarding sys
Posted on January 06, 2018 at 17:12Hi everyone,I'm a fresh graduate Engineer from Egypt . I'm currently working on a project and it was decided that we will utilize the STM32F407G discovery board . The problem is that it was also decided that the Atollic truestudio lite is the IDE that we will be using as well . I have been searching far and wide and I found near to nigh of tutorials . I have been Using Microchip's PIC up until now and I'm new to the ARM as well . Do you have any suggestions as to how I should proceed?The current task that I have is to interface between a Quicktel EC20 and my discovery board through USART and I'm almost done but I still need to add a CR to my UART transmits . please note I'm using the HAL drivers for USART6 on this board using the STM32cubemx .#usart #hal #stm32f4 #atollic-truestudio #stm32cubemx
Posted on January 04, 2018 at 16:14Hi,the USART3_RX & TX DMA1 configuration generates no code.I searched the whole project, there was only code generated for DMA2 (ADC).Im using the STM32CubeF2 1.7.0 library.Is this a bug or am I using the CubeMX software wrong?#cube-mx #stm32cube #usart #dma
Posted on January 02, 2018 at 08:32Hello I have 2 questions 1) i have STM32 F446RE nucleo64 board and i want to take current measurement how can i do it ?2) Why STM32F4 bootloader does not support xmodem, ymodem or any other standard serial transfer protocols to transfer binary . ThanksSerina#stm32f4-nucleo-f446-stcubemx-hal #stm32-f4
Posted on December 20, 2017 at 13:50 STM32F373 slow usb custom hid cubemx. I have encountered a problem. I can easily configure usb custom hid to work but I can't achieve acceptable speed of usb. I am trying to send array of 1200 bytes. The array should be divided into 64 bytes (bits?) packets. The fact is that the array is transmitted for 20 seconds. It's only 60 bytes per second. It's too far from maximum 1.5 mb/sec. What should I do? There is my Report descriptor. __ALIGN_BEGIN static uint8_t CUSTOM_HID_ReportDesc_FS[USBD_CUSTOM_HID_REPORT_DESC_SIZE] __ALIGN_END = { /* USER CODE BEGIN 0 */ 0x06, 0x00, 0xff, //USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, //USAGE (Vendor Usage 1) 0xa1, 0x01, //COLLECTION (Application) 0x85, 0x01, //REPORT_ID (1) 0x09, 0x01, //USAGE (Vendor Usage 1) 0x75, 0x08, //REPORT_SIZE (8) 0x96, 0x04, 0xb0, //REPORT_COUNT (1200) 0x81, 0x82, //INPUT (Data,Var,Abs,Vol) /* USER CODE END 0 */ 0xC0 /* END_COLLECTION */ }; �?�?�?�?�?�?�?�?�?�?�?�
Posted on June 17, 2017 at 11:36Hi, I need help with using the SMBUS/PMBUS V2 library with STM32 Cube HAL, https://my.st.com/content/my_st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-software/x-cube-smbus.license%3d1497686538860.htmlWhaterver I do I get the error: ..\Middlewares\ST\STM32_SMBus_Stack\inc\stm32_PMBUS_stack.h(410): error: &sharp20: identifier 'HAL_StatusTypeDef' is undefinedEven when I include the stm32f0xx_hal.h file in the Keil projec.It can find it ok when i right click and 'go to definition'I just want to add and use the two files stm32_PMBUS_stack.c and stm32_SMBUS_stack.c with the corresponding .h files, but as soon as I include the .h files for the files in main.h then I have this problem.I attach a cleanly generated project from CubeMx (latest version) and the example provided from ST is on this link: https://my.st.com/content/my_st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded
Posted on September 14, 2017 at 10:04With STM32Cube_FW_L4_V1.9.0 when generating code using PLL (HSE or other), SystemClock_Config(void) is missing a diviser :RCC_OscInitStruct.PLL.PLLM is not set and thus generates an issue ( default value is 0)adding RCC_OscInitStruct.PLL.PLLM = 1; // (or any value set in CubeMx) solves the issue.#4.22.1 #stm32-l4 #cubemx
Posted on January 30, 2017 at 12:21HiI am trying to setup a new touch sense project and have question:I configured certain pins as TSC, how do I add the the middleware TSC LIb in CubeMx now? For my Nucleoboard L053R8 CubeMX under middlewares doesnt show TSC but only: USB_device/FREERTOS/FATFS.Thx#tsc #tm32-cubemx
Posted on December 17, 2017 at 23:43I was setting up a project which uses 3 UARTs + USB on a F103.CubeMX reports a conflict on UART 1 when USB is configured.I checked the ref man and datasheet but was unable tosee from what this conflict should arise.There are no shared pins between these IPs.I also diffed the generated code between variants with USART1disabled or enabled and did not see obviuos diffs which do not originatedin the fact of wether USARt1 was configured or not.Is this a false positive on CubeMXes' side?Thanks.#usb #cubemx-project #stm32f1-uart
Posted on March 04, 2017 at 03:36hello. I am luis.Recently I use stm32f051x touch sensing feature that setup touch sensing with CubeMx(the latest ver.).but after test touch sensing, I get touch sensing value only '1'.Searching St community, i have a question.I setup touch sensing code only using CubeMx provided Hal_tsc .. Do I need add another touch sensing library??And where I get touch sensing Full example code??Best regards.#cubemx #stm32f051x #touch-sensing #touch
Posted on December 13, 2017 at 11:43hello,i am trying to send data to pc over the otg used as a virtual com port. The data is received with a terminal program (HTerm). In order to send data i am using the function CDC_Transmit_FS. For a basic test the string 'start' is sent to the pc. Therefor i use the following code. The code is implemented in the while loop of the int main function:while(1){if(((USBD_CDC_HandleTypeDef*)(hUsbDeviceFS.pClassData))->TxState==0){while(CDC_Transmit_FS(((uint8_t*)&'start'),sizeof('start')) != USBD_OK);}}This works and i can receive the data on the terminal program on my pc.What doesn't work: If i try to send 'stop' after the 'start' string.while(1){if(((USBD_CDC_HandleTypeDef*)(hUsbDeviceFS.pClassData))->TxState==0){while(CDC_Transmit_FS(((uint8_t*)&'start'),sizeof('start')) != USBD_OK);}if(((USBD_CDC_HandleTypeDef*)(hUsbDeviceFS.pClassData))->TxState==0){while(CDC_Transmit_FS(((uint8_t*)&'stop'),sizeof('stop')) != USBD_OK);}}what i
Posted on December 14, 2017 at 13:25In the generated GPDSC file, information about preprocesor definitions and include paths are missing. This needs further manual processing of the build proces generated from GPDSC.What is missing, e.g. for attached .ioc file List of include directories need to build the project IncDrivers/STM32F0xx_HAL_Driver/IncDrivers/CMSIS/Device/ST/STM32F0xx/IncludeDrivers/CMSIS/IncludePreprocesor deffinitions to correctly build the project USE_FULL_LL_DRIVERSTM32F030xCIn other project types, all these informations are available.MCU: STM32F030F4PxPC OS: LinuxCubeMX version: 4.23.0Firmware package: STM32Cube FW_F0 V1.9.0#gpdsc #stm32cubemx #bug
Posted on December 14, 2017 at 13:00I have generated GPDSC file from the attached IOC project and the output has wrong items. Real source files are not under correct Csub component. RCC is under USART, EXTI is under RCC, DAC and GPIO (both .c and .h files)Some files are multiple times in the output lige stm32f0xx_ll_rcc.h, stm32f0xx_ll_exti.c, ...some source files are wrongly categorised as header files like stm32f0xx_ll_utils.cHere is part of generated GPDSC file with highlighted errors (blue are duplicates, red are wrong categories), see the attachement for complete IOC and generated GPDSC. <component Cclass='Device' Cgroup='STM32Cube HAL' Csub='USART' Cversion='1.7.0'> <description></description> <files> <file category='header' condition='' name='Drivers\STM32F0xx_HAL_Driver\Inc\stm32f0xx_ll_usart.h'/> &nb
Posted on December 08, 2017 at 21:56After CubeMX griped that my software was too old, I tried to upgrade from the New Libraries Manager, but there was an error downloading the file. I fetched the file manually, then tried installing using the New Libraries Manager 'local' function. I get a 'Problem during unzip of file', though the file unzips fine under 7Zip.Can anybody provide an alternate method of installing this library? This is preventing me from even _starting_ a project.#cubemx-zip-file-new-library-manager
Posted on December 10, 2017 at 11:16Hii'm config evboar nucleo with CubeMX the send data work fine but recive data with HAL_UART_RxCpltCallbacki's work one time and second time is stuck in loop anddon't reach to HAL_UART_IRQHandler(&huart1) again ;i don't know why it's working one time( maybe is relevant to RXN flag )thanks static void MX_USART1_UART_Init(void){ huart1.Instance = USART1; huart1.Init.BaudRate = 115200; huart1.Init.WordLength = UART_WORDLENGTH_8B; huart1.Init.StopBits = UART_STOPBITS_1; huart1.Init.Parity = UART_PARITY_NONE; huart1.Init.Mode = UART_MODE_TX_RX; huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart1.Init.OverSampling = UART_OVERSAMPLING_16; huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; if (HAL_UART_Init(&huart1) != HAL_OK) { Error_Handler();
Posted on November 10, 2016 at 16:01Pin user label disappears when I change the pin function in the cubeMX GUI. This is not an expected behavior, since the already given name of the pin has not changed. #cubemx
Posted on October 26, 2017 at 13:12As I explaned inhttps://community.st.com/0D50X00009XkXviSAF, I have found another big error in the code generation of STM32CubeMX 4.23.In this case, the bug is related to FATFS + SDMMC. In my case, I am working with an STM32F767 microcontroller.I updated an old project to change some config settings, and when I regenerated the project files with STM32CubeMX 4.23, my SDMMC peripheral stopped working correctly. So far, it was working nice with the code generated by an older version of STM32CubeMX.So, (thanks to GIT) I checked which files changed since last release, and I noticed that the problem was in 'SD_initialize' function in 'sd_diskio' file (inside Src folder).The code that the newest version generates is:DSTATUS SD_initialize(BYTE lun){ return SD_CheckStatus(lun);}but, the same functions was different in my old code:DSTATUS SD_initialize(BYTE lun){ Stat = STA_NOINIT; /* Configure the
Posted on December 06, 2017 at 19:03In CubeMX (ver: 4.23 mcu: STM32F427) I'm trying to define two ports PE10 and PB10 as GPIO_EXTI10 (I need to get edge interrupt on either one).However, in the 'Pinout' view, when I click GPIO_EXTI10 for PB10 and then for PE10, PB10 is erased (the green turn white). Am I trying to do something that is not possible at all or is it only a limitation of CubeMX?Is there another way to do it in CubeMX?#cubemx #stm32f4 #exti
Posted on December 05, 2017 at 22:33I am setting up a USB OTG based project on the STM32F4 Discovery Board. I am using STM32CubeMX 4.23.0 and STM32Cube_FW_F4_v1.18.0. This is the same set up on my Windows 10 and Linux Mint 18.2 PCs and both have the same error.The clock configuration tab is always indicating that the clock set up is in error. In the PLL Source Mux, the HSI input is selected and has a red box around it with the message 'PLL Mux should have HSE as input selected'. The HSE button is, of course, grayed out. It generates the code but I get warnings about an invalid clock configuration.Is this a problem with STM32CubeMX? Is there actually an invalid clock configuration? Is the generated code safe to use?#stm32f4-discovery #usb #stmcubemx
Posted on November 26, 2017 at 12:30My settings:Board: STM32F100RBOS: Windows 10 x64Version: STM32Cube V1.0 - 4.20.0IDE: Coocox CoIDE 1.7.8 Problem: I noticed that after regenerating the code I just couldn't access the board, messages like 'Please, connnect the cable' or 'Board was not found' started prompting after downloading others code to the board. The only way to restore the access was using STLink Utility (Holding the reset button (Black button,RST, in the board) and erasing all the memory). However, this issue also happened when checking the option to Create peripheral separate pairs in .c and .h, something like that, this time the code blocks the access just after the download. In both cases the code keeps running but you cannot debug, reset or download new ones. Solution: After some trial and error, comparing the good code with the evil one, I could solve this changing the following fil
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.