Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on October 11, 2016 at 13:52Hi, I'm creating new project for CubeMx and using freeRtos and lwip. i was able to get eth tx workin(verified in tcpdump) dhcp request with correct mac. I was unable to get ethernet to react on receive -> there is no ethernet RX IRQ. Thing that i've done: - Changed PHY ADDR to 0 (default is 1) - added 1s delay before mac and phy init In these changes we managed to get TX working When i enable eth dma error irq flags i i get TBUIE: transmit buffer unavailable interrupt and and ethernet is not working any more in neither direction. Using stm32f407 and micrel ksz8081 phy All ideas are welcome! #smt32f4-cubemx
Posted on February 02, 2017 at 11:28New version of STM32CubeMX 4.19.0 is giving the following error. what is the problem with LWIP version 2.0.0?#stm32cubemx-4.19.0-lwip-problem
Posted on November 12, 2016 at 23:43I use STM32CubeMX 4.17.0. I create a new project and select any F1. Then, I generate a source code. In function HAL_MspInit() I see following lines: /**DISABLE: JTAG-DP Disabled and SW-DP Disabled */ __HAL_AFIO_REMAP_SWJ_DISABLE();STM32CubeMX disables SWD by default. Is this a bug? #feature #stupid-as-designed #bug-stm32cubemx
Posted on August 02, 2016 at 18:11I'm using 4.16 on macOS, and noticed the .pdsc file is generated with non-portable, backslash windows path: <files> <file category=''header'' name=''\Users\ilg\STM32\STM32Cube\Repository\\STM32Cube_FW_F4_V1.13.0\Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h''/> <file category=''header'' name=''\Users\ilg\STM32\STM32Cube\Repository\\STM32Cube_FW_F4_V1.13.0\Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h''/> <file category=''source'' name=''\Users\ilg\STM32\STM32Cube\Repository\\STM32Cube_FW_F4_V1.13.0\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c''/> <file category=''source'' name=''\Users\ilg\STM32\STM32Cube\Repository\\STM32Cube_FW_F4_V1.13.0\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c''/> </files>Please use portable, slash separat
Posted on May 04, 2017 at 08:47CubeMX V1.12.0I write below code to receive one bye and one bye:HAL_UART_Receive_IT(&huart1, (T_U8*)&g_uart_receive_byte, 1);void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart){ if(huart == &huart1) { //get the byte DrvUartOnReceiveOneByteAtInterupt(g_uart_receive_byte); //receive next byte HAL_UART_Receive_IT(huart, &g_uart_receive_byte, 1); }} and in the main I use HAL_UART_Transmit to transmit data.but when HAL_UART_Transmit is doing, a new buffer is received and HAL_UART_RxCpltCallback will be called, then HAL_UART_Receive_IT will be fail because HAL_UART_Transmit has call __HAL_LOCK(huart). I think HAL_UART_Transmit and HAL_UART_Receive_IT should not use the same lock, they should can use at same time.Is it right?#cubemx #uart
Posted on September 16, 2016 at 23:21We recently started using the OS X version of STM32CubeMX after using the Windows version for all projects for the past 1+ years. We found that the same .ioc file used to generate projects on the different platforms yields files that differ. The differences I see are some spaces before CR/LF characters, especially on empty lines. While this seems minor, the ramifications of this is that to my git clients (Tower on OS X and SourceTree on Windows), the files differ enough for them to just say the entire file has changed. Can you please make the OS X version output files exactly the same as those generated with the Windows version? The Windows version seems to strip all spaces before a CR/LF.EDIT: Sorry forgot to include the version info.Both the OS X and Windows versions are 4.16.1Thanks,Craig #stm32cubemx #generation
Posted on April 07, 2017 at 10:39Hello,I'm using STM32CubeMX to generate a project for a STM32F042. I just found a bug in the automatic code generation concerning the firmware package for STM32F0 family v1.7.0.It concerns the initialization of the IRDA driver.CubeMX generates the following code :/* USART1 init function */static void MX_USART1_IRDA_Init(void){hirda1.Instance = USART1; hirda1.Init.BaudRate = 115200; hirda1.Init.WordLength = IRDA_WORDLENGTH_7B; hirda1.Init.Parity = IRDA_PARITY_NONE; hirda1.Init.Prescaler = 10; hirda1.Init.PowerMode = IRDA_POWERMODE_NORMAL; if (HAL_IRDA_Init(&hirda1) != HAL_OK) { Error_Handler(); }}It forgets the mode initialization :hirda1.Init.Mode = IRDA_MODE_TX_RX;Could you please confirm this bug ?Thanks a lot.#irda #stm32f0 #stm32cubemx
Posted on September 04, 2015 at 15:00Hello,I'm having problems initializing the CAN peripheral, using generated code by Cube.APB1 Peripheral clock is 32MHz (XTAL16*PLL4*0.5PRESC).The device cannot get INAK cleared after clearing INRQ.Pins seem to be correctly set up on the alternate function (Mode = AF_PP and Alternate = AF9_CAN).Any help would be great!Here are some code snippets.void MX_CAN_Init(void){ hcan.Instance = CAN; hcan.Init.Prescaler = 8; hcan.Init.Mode = CAN_MODE_NORMAL; hcan.Init.SJW = CAN_SJW_1TQ; hcan.Init.BS1 = CAN_BS1_8TQ; hcan.Init.BS2 = CAN_BS2_7TQ; hcan.Init.TTCM = DISABLE; hcan.Init.ABOM = DISABLE; hcan.Init.AWUM = DISABLE; hcan.Init.NART = DISABLE; hcan.Init.RFLM = DISABLE; hcan.Init.TXFP = DISABLE; HAL_CAN_Init(&hcan);}void HAL_CAN_MspInit(CAN_HandleTypeDef* hcan){ GPIO_InitTypeDef GPIO_InitStruct; if(hcan->Instance==CAN) { /* USER CODE BEGIN CAN_Msp
Posted on May 03, 2017 at 16:30Hi to all i use STM32CubeMX to configure STM32NucleOL152RE and i use IAR, in old version all work well,now i create easy program for toggel led every tree minutes, but don't work.i see the system don't configure the sAlarm.AlarmMask.I attach the my ioc file and the main.cbest regards.Antonio#stm32cubemx #stm32l152re #bug
Posted on December 15, 2016 at 15:31I'm using using STM32cubeMX to generate the init code for an STM32373C-EVAL board and have found this problem setting up the SDADC (see picture).Basically, I can't set 'Configuration index' to anything other than the default which it tells me is not valid.If I ignore all the error messages and generate the code anyway, it does actually generate good code which works.I'm just learning this tool so thought I'd ask if I am doing anything wrong...It's cube version 4.18 on Ubuntu linux.Thanks !#stm32cubemx
Posted on April 19, 2017 at 14:42Hi All,How can I install a new firmware package to stm32CubeMX. I tried to install X-NUCLEO-IDW01M1 which is a wifi driver firmware package. I downloaded the file (en.x-cube-wifi1_firmware.zip) and I tried to install it from cubemx, but I got an error: 'this package version is not managed on this version of STM32CubeMX'I use Debian Linux, and my cubemx version is: 4.20.1 STM32Cube V1.0 on help/aboutThe zip file is not corrupted, I can unzip it and it has a directory:STM32CubeExpansion_WIFI1_V3.0.1 and the directory contains a package.xml file:<?xml version='1.0' encoding='ISO-8859-1' standalone='no'?><Package DBVersion='2.0'> <PackDescription Release='FW.WIFI1.3.0.1'> <Note Release='ReleaseNotes.html'/> </PackDescription></Package>thxZamek#cubemx #firmware #local-install
Posted on April 29, 2017 at 17:30As title, what is different betweem stm32f10x-standard-library& # library. Shall we makeSTM32CubeMX to usestandard peripheral library?If possible, please let me know how to do detail.Also, what is different of stm32cubemx & stm32cubef1 ? BRLC<LINK NO LONGER ACTIVE>http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef1.html
Posted on March 22, 2017 at 23:04When I generate code for STM32L151CBTx (FW v1.6.0) using CubeMX it enables MCI clock (RCC_ORCILLATORTYPE_MSI) in SystemClock_Config even if only HSI is enabled in the CubeMX clock configuration UI. Similar problem does not exist for other chip versions e.g. L152CBTx.This misconfiguration causes HAL_RCC_OscConfig to fail.#cubemx-bug
Posted on March 21, 2017 at 13:12Hi,I am trying to configure a project in a STM32F769I-DISC1 board using TIM6, DAC1, the FMC connected to the external SDRAM and the DMA (to pass data between SDRAM and DAC).I have generated the configuration using STM32CubeMX, everything compiles OK but when running the code the firmware is throwing me an error from the HSI configuration function.The error comes from this line:/* Check if HSI is used as system clock or as PLL source when PLL is selected as system clock */ if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_SYSCLKSOURCE_STATUS_HSI) || ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_SYSCLKSOURCE_STATUS_PLLCLK) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSI))) { /* When HSI is used as system clock it will not disabled */ if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) && (RCC_OscInit
Posted on March 13, 2017 at 15:52 1. Faulty code generation STMCube Generates to following code in the function: void SystemClock_Config(void) RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;�? this results that the SystemClock_Config function always enters the Error_Handler HSE Clock is used as main clock. By removing the RCC_OSCILATORTYPE_HSI define code functions normally 2. Non working code USB MSC Code generated for USB MSC stops working after the usb command USB Set Configuration Request Device Manager reports Error Code 10 (can't start device) The usb analyzer tool of wireshark shows no communication after host sends Set Configuration Request. Problem observed from at least STM32CubeMX V4.18+ Changing driver versions does not solve the isuue Tested on STM32446e-Eval and STM23F446ZC PC: Windows 10 Toolchain: KEIL µVsion V5 #stm32cube-bug #bug-stm32cubemx
Posted on April 03, 2017 at 18:07Hey, I just updated my version of STM32CubeMX to 4.20 and now when I generate a project for the STM32F401VCTX using only the RCC-> HSE (A crystal not the internal clock) it gets stuck in SystemClock_Cofig(void). I was able to find that the issue was because for some reason the new cubeMX now uses: RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;instead of: RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;even though only the HSE clock is used. For this reason it gets stuck in the Error Handler. This problem was not there in the previous versions of cube. Please look into this and fix this issue.Thank you#stmcubemx-4.20 #hse #rcc #hsi
Posted on March 24, 2017 at 07:28I'm trying to make a interrupt handler which doesn't use FreeRTOS function and preemption priority is higher than FreeRTOS, say 2.However every time I load .ioc file, STM32CubeMX checks the 'Uses FreeRTOS functions' checkbox of the interrupt handler, so I need to uncheck it manually.Please try with the attached .ioc file.STM32CubeMX version is 4.20.0STM32Cube FW_F7 V1.4.1#stm32cubemx
Posted on April 26, 2017 at 08:40Hello, i am working with the HAL USB CDC (CUBEMX) and want configure the baudrate and parity but i cant find a way to configure it.#stm32f407 #cubemx #usb-cdc
Posted on April 21, 2017 at 09:35I have generated a project for an STM32F103C8T6 using CubeMX 4.20.1.I am using i with the 1.4.0 of the STM32CubeF1 library.I am using the unmodified generated code to send out data in the main loop.The CubeMX configuration is the following for the pins:I2C on PB-7 SPI on the PB3-5 (MISO is unused). The generated GPIO initialization code looks ok for me.If the I2C1 module is enabled there is not any output on the MOSI line even if sending non 0xFF data:I have narrowed down the source problem to the __HAL_RCC_I2C1_CLK_ENABLE in the HAL_I2C_MspInit.If I remove that the MOSI output will work as expected. (Of course in this way the I2C peripherial will not work):I have already checked the errata, but have not found any relevant. The generated codes seems to do what they supposed to, but I am not really sure where to look for the problem source.Any help would be deeply appreciated!#spi #cube-mx #stm32 #i2c #stm32f103
Posted on April 23, 2017 at 21:13I wanted to create a project for STM32F407G-DISC1 board (STM32F4DISCOVERY?) but saw two identical lines in the selection dialog (see attach). What kind of discovery board is meant? Or is this mistake?STM32CubeMX 4.20.1.#stm32f4discovery #stm32cubemx #discovery
Posted on February 09, 2017 at 16:32 Hello, I am using STM32F769I-DISCO board and CubeMX-generated project (v4.19) for this specific board. I am having troubles to makeminimal working firmware that can just respond to ping sent from my PC. In CubeMX I configured ETH component in RMII mode, LWiP middleware and clocks. I attached print screens with basic ETH and LWiP configurations. PC that the board is connected to is in the same IP network, IP addresses and masks are correct. Clocks in the project are configured in the same way as example working project mentioned below (Ethernet PTP is 200MHz). All the ETH GPIOs have default configuration (all Very High output speed, no pulling). My main function is default main generated by CubeMX, I just added call to MX_LWIP_Process in the infinite while loop. int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals,
Posted on December 18, 2016 at 21:16Today I played with CubeMX and USB CDC device and I found very silly bug in generated code.I chose USB FS Device only mode and I used CDC class. Nothing else set. I did not enable VBUS.Generated code enabled VBUS sensing but VBUS sense pin was not enabled.I spent 2 hours to figure that out.Please correct this mistake, disable VBUS sense by default or if you enable VBUS sense, then also initialize VBUS pin to sense voltage.Have a nice day.#stm32f7 #stm32cubemx #usb
Posted on April 20, 2017 at 13:02Hi,I'm wondering that when CubeMX generates LwIP projects, it may be pointing wrong directories for the header files. For example, it generates list of following directories:Middlewares/Third_Party/FreeRTOS/LwIP/src/include/lwipMiddlewares/Third_Party/FreeRTOS/LwIP/src/include/netifMiddlewares/Third_Party/FreeRTOS/LwIP/src/include/posixwhereas what is actually necessary is a single directoryMiddlewares/Third_Party/FreeRTOS/LwIP/src/includeaccording to the source files. The same thing goes withMiddlewares/Third_Party/FreeRTOS/LwIP/system/archMiddlewares/Third_Party/FreeRTOS/LwIP/system/OSinstead ofMiddlewares/Third_Party/FreeRTOS/LwIP/systemI only use the .cproject file to convert it into Makefile. So I'm not 100% sure.Thanks,#cubemx #cubemx-4.20
Posted on December 12, 2016 at 16:51CubeMX version 4.18.0 sets the PHY Address Value for the on board PHY (LAN8742A) as 1. This does not work. It cannot even be changed in CubeMX without switching to 'user PHY'. In order for the on board Ethernet to work the user can go into stm32f7xx_hal_config.h and change the macro that defines LAN8742A_PHY_ADDRESS to 0.#stm32cubemx-ethernet #stm32f7-discovery-kit
Posted on April 13, 2017 at 18:08Hello All, I have some serious issue which i am not able to figure it out, i really dont know what i am missing, basically what i am doing is simple, i m using TIM6 (BASIC TIMER) dma to toggle the led. The problem is , the moment i trigger the dma it goes to 'Transfer Error' block of the DMA isr, i have no clue why this is happening , below is my code, i must be doing something silly, but i spent 2 days , i have no clue &sharpinclude<stdio.h>&sharpinclude 'stm32f446xx.h'/* Private variables ---------------------------------------------------------*/TIM_HandleTypeDef htim6;DMA_HandleTypeDef hdma_tim6_up;uint8_t data[2]={0xff,0x00};/* Private function prototypes -----------------------------------------------*/void SystemClock_Config(void);static void MX_GPIO_Init(void);static void MX_TIM6_Init(void);static void MX_DMA_init(void);int main(){ SystemClock_Config(); MX_GPIO_Init();MX_TIM6_Init();/* DMA controller
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.