Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on March 09, 2017 at 20:36Can not set the input frequency value of quartz LSE/HSE - after entering the frequency value and loss of the input focus, the frequency is divided by 1000. The division is repeated if you return and remove the input focus again. As a result, an error occurs with respect to the frequency value.In version 4.19 everything was fine.How to fix?#stm32cubemx
Posted on May 14, 2017 at 00:43Hi All, I am new to this community so please bare with me. I am developing a USB GPS application using STM32F4, CubeMX (4.20.1) and Keil uVison 5. Using CubeMX I created a USB Host skeleton and succeeded in getting the device to enumerate as a CDC device. After many hours I came up with a solution that works (sort of) but would like to ask if this is the correct way to acheive the desired result.First I had to expose Appli_state flag (extern ApplicationTypeDef Appli_state) in main.c in order to determine that enumeration had completed. In the while() loop following MX_USB_HOST_Process() I placed if(Appli_state == APPLICATION_READY) { USBH_CDC_Receive(&hUsbHostFS, UsbRxBuf, 64); printf('%s', UsbRxBuf); }This resulted in data coming through, however,
Posted on February 25, 2018 at 23:30Hello!I'm new to STM32 so I can be wrong everywhere.According to datasheet(RM0090 Reference manual STM32F405/415, STM32F407/417, STM32F427/437 andSTM32F429/439 advanced ARM�-based 32-bit MCUs, page 152), 'When TIMPRE bit of the RCC_DCKCFGR register is reset, if APBx prescaler is 1, then TIMxCLK = PCLKx, otherwise TIMxCLK = 2x PCLKx'.If I create a new STM32CubeMX project for STM32F429ZI, I can see the expected behaviour: for APB2 prescaler value higher than 1, the APB2 timer clocks are set to twice that value.But If I create a project for Nucleo-F429ZI board and say 'Yes' to 'Initialize all peripherals with their default Mode', the APB2 timer clock always stays at 1xAPB2 clock, regardless of APB2 prescaler value. However, on the real dev. board the timer clock seems to be at twice the APB2 clock rate.Initially I was wondering, why was my timer running at double rate compared with what I should get based on the timer clock shown by
Posted on January 18, 2018 at 09:18Hello,I've encountered a bug in code generation when using the LL STM32F3 drivers 1.9.0 in Cube 4.23.0.The device is theSTM32F303CCTx, although it's probably not device specific.Using the clock configurator and setting an HSE of 16MHz, the code generated in stm32f3xx_ll_rcc.hindicates a wrong value for HSE:&sharpif !defined (HSE_VALUE)&sharpdefine HSE_VALUE 8000000U /*!< Value of the HSE oscillator in Hz */&sharpendif /* HSE_VALUE */This can cause all sorts of problems if one uses the API to get various peripheral clock speeds, like LL_RCC_GetUSARTClockFreqwhich gave me the wrong value, causing me to set up the wrong baud.The.ioc file seems correct since the relevant field is correct:RCC.HSE_VALUE=16000000#ll-drivers #stm32f3 #cube-mx
Posted on May 09, 2018 at 10:08I set CubeMX to configure STM32H743ZI, I made my settings in the peripherals and on the clock page.The clock page of STM32H7 is very wide as there are several settings so it must be scrolled down to see all the settings.Then I generated the report (Project -> Generate Report): I opened the report in PDF and I found that the page '4. Clock Tree Configuration' is truncated on the right side of the page.Because of this bug it is not possible to see the whole clock configuration page, but only the top one. How can it be solved?Is this bug known by STM?RegardsAndrea.#pdf-report #stm32cubemx-4.25.0 #report-clock-page
Posted on March 28, 2017 at 02:36main.c generated by STM32CubeMX creates two different prototypes for SystemClock_Config. One with static and one without static./* Private function prototypes -----------------------------------------------*/void SystemClock_Config(void);void Error_Handler(void);static void MX_GPIO_Init(void);static void SystemClock_Config(void);In addition, SystemClock_Config() is called twice in main.c.int main(void){.../* Configure the system clock */ SystemClock_Config();/* Initialize all configured peripherals */ MX_GPIO_Init(); SystemClock_Config();Please try the attached .ioc file.STM32CubeMX version is 4.20.0STM32Cube FW_F7 V1.4.1#stm32cubemx
Posted on May 08, 2018 at 16:38HIIm using Nucleo144 L4R5ZI board, using CubeMX i have generated the code to enabling the LPUART1 which the ST-Link is enabled for virtual COM port. when i just took a simple private variable im trying to see the message on lpuart1 using HAL_UART_Transmit, nothing is being displayed. Tried Debugging it halts the system on HAL_Init().May be with the code generated or so??When i tried with the example provided for the board,PWR/PWR_ModesSelection/Src it works fine, more over this code uses _GNU-...putchar ....redirecting to UART......and making the printf enable. But i tried the basic way of getting the message on virtual COM port.May be something missing in the code which is generated by CubeMX.ThanksPhanirajkiran#cubemx
Posted on May 03, 2018 at 17:31Hi,There is a bug when generating clock configuration with CubeMx on an STM32F413RHT.The SystemClock_Config is missing a line before changing the PWR register (clock is not enable) :void SystemClock_Config(void){ LL_FLASH_SetLatency(LL_FLASH_LATENCY_3); if(LL_FLASH_GetLatency() != LL_FLASH_LATENCY_3) { Error_Handler(); } // THIS LINE IS MISSING IN THE GENERATED CODE LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR); LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1); LL_RCC_HSI_SetCalibTrimming(16); LL_RCC_HSI_Enable(); /* Wait till HSI is ready */ while(LL_RCC_HSI_IsReady() != 1) { } LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSI, LL_RCC_PLLM_DIV_16, 192, LL_RCC_PLLP_DIV_2); LL_RCC_PLL_Enable(); /* Wait till PLL is ready */ while(LL_RCC_PLL_IsReady() != 1) { } LL_R
Posted on December 07, 2016 at 17:15Hi ST,You have this site: http://www.st.com/content/st_com/en/about/events/events.html/stm32cube-basics-online-course-with-hands-on-exercises-a.htmlHowever, I never received log-in details after registering for this. Are you still running this course? If so, how do I get my login? If not, where is the best place to learn CubeMX?
Posted on May 02, 2018 at 22:51When I press the 'generate the source code' button in MxCube a window pops up that says 'Open Folder', 'Open Project', or 'Cancel'. In the past when I would click on 'Open Project' it would take me to the instance of the IAR project that was already open. However, if the IAR project is already open, it open a new instance (rather than the existing instance). So, I end up having 2 windows of IAR open rather than just 1. Any ideas how to correct this?Not sure why it use to open the existing instance and now it opens a new instance. I dont think I modified any of the settings. Any ideas how to correct this?Panecki.Szymon.002‌marsanne.sebastien‌#iar #stm32l100cdiscovery #stm32-iar #cubemx
Posted on April 22, 2018 at 20:09Hello!After upgrading CubeMX to version 4.25In the * .bin code, did the path to the project come up?This is normal?#what-has-changed-in-cubemx-4.25 #what-has-changed-in-cubemx-4.25-from-cubemx-4.17
Posted on April 16, 2018 at 23:34Hi,I'm facing a problem i can't solve. It seem so simple but i think i need an other point of view.For a project using a led driver (LED1642GW) i need a clock in 20MHz~30MHz.I forgot this oscillator in my hardware so i want to generate it with my MCU (and it will be cheaper).I made the most simple project for my stm32L476VGT:- HSI (or MSI) speeded up to 80MHz through PLLCLK.- TIM5 with PWM or CC on Channel 1- PA0 on Alternate function (TIM5 ch5) with very high speedReference manual is saying that internal clock of the timer is APB (so 80MHz).Despite of my differents trys, i don't managed to get an output signal at 20MHz.With the example bellow i expected a signal at 80/80 = 1MHz but i only get 400kHz...Here is some screens:Did i miss something? Or does the GPIO not made for this purpose?Thanks!#cubemx #pwm #clock #signal-generation
Posted on April 11, 2018 at 11:48Hi guys.I'm working in a STM32L433RCTP based project.The code generated by the Stm32CubeMX for clock configuration has no value set for the PLL-M prescaler in the PLL struct, see original code:---------------------------------- /**Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48|RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLN = 10; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7; RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); }----------------------------------I fixed it, by adding the folowing line:RCC_OscInitStruct.PLL.PLLM = 1;Even with PLLM prescalers set with
Posted on September 07, 2017 at 13:48Hello, I'm using STM32F103RBT6 for my project, I've designed a custom board. I'm using cubemx to generate the basic code and Atollic for debugging.I'm reading the switches using external interrupt. In the external interrupt call back, I'm starting a timer. In the timer interrupt handler, I'm doing some work. I've kept the timer timeout period to 2 seconds. My problem is whenever the code is started to run for the first time and when I press the switch, the code immediately goes to the timer interrupt handler. This happens only once for the first time. After this, whenever I press the switch, code goes to the timer interrupt in 2 seconds which is correct. Why does it go immediately goes to the interrupt handler for the first time and then works fine thereafter??I've attached the c file for reference. Is there any changes to be made??Please suggest.RegardsPraveen#cubemx-project #mcu #stm #stm32f103
Posted on February 05, 2018 at 15:41Hello,I noticed a problem while trying to generate code with CubeMX, regarding injected ADC.The problem appears as follow:- Make a project with Cube on a Nucleo-F413ZH,- Use default pin attribution,- set PC0, 1, 2 to analog,- configure 3 Conversions in ADC_Injected_ConversionMode,- rank 1 -> channel 10, rank 2 -> channel 11, rank 3 -> channel 12,- use Low Layer for ADC,- generate code. /**Configure Injected Channel */ ADC_INJ_InitStruct.TriggerSource = LL_ADC_INJ_TRIG_SOFTWARE; ADC_INJ_InitStruct.SequencerLength = LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS; ADC_INJ_InitStruct.SequencerDiscont = LL_ADC_INJ_SEQ_DISCONT_DISABLE; ADC_INJ_InitStruct.TrigAuto = LL_ADC_INJ_TRIG_INDEPENDENT; LL_ADC_INJ_Init(ADC1, &ADC_INJ_InitStruct); LL_ADC_INJ_SetSequencerRanks(ADC1, LL_ADC_INJ_RANK_1, LL_ADC_CHANNEL_10); LL_ADC_SetChannelSamplingTime(ADC1, LL_ADC_CHANNEL_10, LL_ADC_SAMPLIN
Posted on April 02, 2018 at 17:41Hello ST,I found that code, generated by STM32CubeMX for STM32F4 SDIO periperal, is poorly integrated with MCI interface (CMSIS driver). And doesn't work out of box without modification.STM32CubeMX generates HAL_MMC_MspInit function (file stm32f4xx_hal_msp.c). But MCI interface expect HAL_SD_MspInit (file MCI_STM32F4xx.c, line 543).Another problem related to SDIO_IRQ. I've disabled SDIO global interrupt here, because MCI_STM32F4xx.c has SDIO_IRQHandler already:(otherwise STM32CubeMX generates second SDIO_IRQHandler)But in this case no code generated to enable SDIO_IRQn. And MCI_STM32F4xx.c doesn't enable this interrupt as well.After implementing workarounds for bugs above MCI interface driver works fine.My configuration:8 bit eMMCKeil MDK v5.25.1Keil STM32F4xx_DFP v2.12.0STM32CubeMX v4.24.0STM32CubeF4 package v1.19.0Best regards,Eugene.#stm32f4 #sdio #stm32cubemx #mci
Posted on April 26, 2018 at 12:05 when i tried to update the cube mx and also installing cubemx for F7 , i encountered this error . please help how to solve this . screenshot is attached. Thanks. #stm32-cubemx
Posted on April 24, 2018 at 13:58Hi, I have for me big problem with I2C. I would like communicate with DS3231 RTC chip.I wroted small easy code :void DS3231_DateTime_get(void){ DS3231.ds3231_TX_buff[0] = 0x00; HAL_I2C_Master_Transmit(&hi2c1, DS3231_address << 1, &DS3231.ds3231_TX_buff[0], 1, 1000); HAL_I2C_Master_Receive(&hi2c1, DS3231_address << 1, &DS3231.ds3231_RX_buff[0], 7, 1000);//HAL_I2C_Mem_Read(&hi2c1, DS3231_address << 1, 0x00, I2C_MEMADD_SIZE_8BIT, DS3231.ds3231_RX_buff, 7, 1000); DS3231.second = BCD2DEC(DS3231.ds3231_RX_buff[0]); DS3231.minute = BCD2DEC(DS3231.ds3231_RX_buff[1]); DS3231.hour = BCD2DEC(DS3231.ds3231_RX_buff[2]); DS3231.day = BCD2DEC(DS3231.ds3231_RX_buff[3]); DS3231.date = BCD2DEC(DS3231.ds3231_RX_buff[4]); DS3231.month = BCD2DEC(DS3231.ds3231_RX_buff[5]); DS3231.year = BCD2DEC(DS3231.ds3231_TX_buff[6]);}In first cycle I read data good (data is visualized with VIsual GDB in Visual studio in debugging mode, but I t
Posted on March 26, 2018 at 14:29Hey, i tried to setup my STM32L4R9 with CubeMX v4.25.0 as followed:- FreeRTOS- FatFS- SD Card- DMA Support unfortunately i noticed that the DMA-Interrupt tab does not show up in the SD-Card settings. I tried it with other STM32 MCUs where it showed up instantly. Is there anything i can do/configure to activate the DMA-Interrupt feature for the L4R9 in CubeMX? I saw there is an demo project with my requirements for the L4R9 on the eval board.. but would love to have it in CubeMX too! Regards#cubemx-v4.25.0 #stm32l4+ #fatfs #dma-sdmmc
Posted on April 23, 2018 at 12:41Hi, I would like use SD card with SDIO 1bit, FatFS.I tried to wit cubemx 4.17 on F407, it is worked good.But I would like to use with STM32L151RD.I tried with CubeMX 4.25 FW 1.8.1, FatFS R0.11.But doesnt work anything. if anyone could help me ? I tried examples but Card dosnt mount.Please what should I modify after cubemx generatoed code ? thank you.#sdio #cubemx-v4.25.0 #cubemx-l1 #fatfs
Posted on April 22, 2018 at 05:41HELLO..I want to measure the frequency and duty cycle of the external signal. I have gone through some example available , and suggestions on website. Everywhere they are using either channel 1 or channel 2 in any of timer , unfortunately in my case signal is given to channel 4 , Is it still possible to measure duty cycle and frequency by using channel 4 , if so how to configure the same in stm cubemx ..Can anybody suggest please , I am fully stuck with this issue ..Thank you#pwm-input #stm32h7 #cubemx
Posted on April 13, 2018 at 11:06hey,I have a LWIP client/server application and I want to add the PTP synchronization feature to the communication. I'm using STM32F746ZGTx Nucleo and CubeMX. I'm trying to enable RMII_PTP_Synchro mode for ETH (after enabling TIM2) but cubeMX is displaying the following message:'Warning: STM32CubeMX does not support the configuration of this IP's mode. You can configure it only manually'.I can't start this configuration from scratches so is there any precoded sources I can relay on to activate and configure this feature?Thanks.#ptp #stm32f7 #cubemx #ieee1588
Posted on April 21, 2018 at 14:49Hello,I generated the code using the STM32CubeMx 4.25.FW is 1.8.1I'm trying to I2C communication between STM32L1(master) and SSD1306 OLED display(slave, 7bit address).I tested with HAL_I2C_Mem_Write function it is worked fine.I would like send most data to visualise logo etc. and I would like to using with DMA.I find function HAL_I2C_Mem_Write_DMA but dostn work.I visieted examles :https://github.com/pellepl/verisure1512/blob/master/ext-libs/STM32Cube_FW_F7_V1.2.0/Projects/STM32746G-Discovery/Examples/I2C/I2C_TwoBoards_ComDMA/Src/main.c and tried enable Event interrupt and error, but display doesnt work. Dont have Logic analyser for i2c analysis.Please let me know why HAL_I2C_Mem_Write_DMA() is didn't work.thank you.#i2c-hal-dma #i2c-write #i2c-dma-ssd1306 #cubemx-v4.25.0 #i2c-analysis
Posted on April 18, 2018 at 16:56In CubeMX I can configure whether a peripheral initializer shall be static or not under Project Settings -> Advanced Settings. But for the GPIO Initializer I can't unselect 'static'. Why is that?#stm32cubemx
Posted on April 16, 2018 at 11:46hello dear stm32 community,I have installed stm32cubemx 4.25.0 and X cube mcsdk 5.0.2. However, I can not generate file and source code with mcsdk 5.0.2.I have attached the screenshot of problem. It says missing STM32CubeMX.Any help would be appreciated...Thank you so much in advance...Best regards..#stm32 #pmsm #x-cube-mcsdk-5.0.2 #mcsdk #cubemx-v4.25.0 #sdk-foc
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.