Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on July 25, 2014 at 06:01In both the STM32F2 V1.1 and STM32F4 V1.3 repositories, there is a bug in the FreeRTOS definition for a mailbox. In cmsis_os.h the definition for osMailQDef is missing a semicolon. Show below with highlight of missing semicolon.&sharpif defined (osObjectsExternal) // object is external&sharpdefine osMailQDef(name, queue_sz, type) \extern struct os_mailQ_cb *os_mailQ_cb_♯&sharpname; \extern osMailQDef_t os_mailQ_def_♯&sharpname&sharpelse // define the object&sharpdefine osMailQDef(name, queue_sz, type) \struct os_mailQ_cb *os_mailQ_cb_♯&sharpname; \osMailQDef_t os_mailQ_def_♯&sharpname = \{ (queue_sz), sizeof (type), (&os_mailQ_cb_♯&sharpname) }&sharpendif #stm32cubemx
Posted on April 09, 2015 at 14:30 This came up on the first code generation following the upgrade from 4.6/1.4 to 4.7/1.5. On subsequent code generation it did not happen so I thought it was an upgrade related glitch. However it returned on my most recent code generation. The problem seems to relate to not using CRC calculation. The generated code does not initialize the CRCPolynomial /* SPI2 init function */ void MX_SPI2_Init(void) { hspi2.Instance = SPI2; hspi2.Init.Mode = SPI_MODE_MASTER; hspi2.Init.Direction = SPI_DIRECTION_2LINES; hspi2.Init.DataSize = SPI_DATASIZE_8BIT; hspi2.Init.CLKPolarity = SPI_POLARITY_LOW; hspi2.Init.CLKPhase = SPI_PHASE_1EDGE; hspi2.Init.NSS = SPI_NSS_SOFT; hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_64; hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi2.Init.TIMode = SPI_TIMODE_DISABLED; hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED; HAL_SPI_Init(&hspi2); } However the parameter is checked later: HAL_StatusTypeDef HAL_SPI_I
Posted on March 24, 2015 at 16:25I'm working with an STM32F429IIT6 and producing init code using STM32CubeMX (v4.6.0, library 1.4.0.) When configuring the LTDC peripheral, the ''Active Width'' input is limited to 800 and the ''Active Height'' to 600. From the manual (DM00031020.pdf, RM0090) it lists the maximum resolution as 1024x768. Later under register settings it states these as ''Themaximum Active Width supported is 0x400'' and ''The maximum Active Height supported is 0x300.'' Is there something I'm missing about the maximum dimensions or does STMCubeMX have it wrong?Thanks!(The actual dimensions of the display we have selected are 480x800 so I suppose we will lose 32 lines.) #stm32cubemx-ltdc-stm32f429
Posted on March 24, 2015 at 00:12 My conditions: STM32CubeMX 4.7.0 STM32F042F6P6 and STM32F103CT6 STM32CubeMX removes bracket inside /* USER CODE BEGIN 3 */ /* USER CODE END 3 */ section of main.c. STM32CubeMX 4.7.0 Code before regeneration: ... /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ if (1) { } } /* USER CODE END 3 */ } Code after regenerations using STM32CubeMX 4.7.0: ... /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ if (1) /* <<< missing bracket */ } } /* USER CODE END 3 */ } STM32CubeMX 4.6.0 was correct: ... /* USER CODE BEGIN 3 */ /* Infinite loop */ while (1) { if (1) { } } /* USER CODE END 3 */ } #stm32cubemx-main.c-user-code
Posted on April 02, 2015 at 14:08First, I was happy to see the bug that resulted in code generation for ADC2 to use channel 0 (vs. channel 2) even though channel 2 was specified. Thank you - I no longer have to fix that every time I regenerate initialization code.I have just migrated from STM32CubeMX 4.6 to 4.7 (and Cube library 1.4.0 to 1.5.0) and have encountered a surprising number of issues. Do you (ST) prefer that they be documented one per post or should I lump them all into one post?Thank you,hank #stm32cubemx
Posted on April 03, 2015 at 03:00 Hello everyone, I have trouble with getting ADC values over DMA. I saw example :STM3210E_EVAL\Examples\ADC\ADC_Sequencer and create project in MXCube with 13-ADC channels after generate code and launch project I am got only ch0 value other values set as zero. *Interrupt HAL_ADC_ConvCpltCallbackhas been occurred. My initialization code: void MX_DMA_Init( void ) { /* DMA controller clock enable */ __HAL_RCC_DMA1_CLK_ENABLE(); /* DMA interrupt init */ HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 5, 0); HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn); } /* ADC1 init function */ void MX_ADC1_Init( void ) { ADC_ChannelConfTypeDef sConfig; /**Common config */ hadc1.Instance = ADC1; hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc1.Init.ContinuousConvMode = ENABLE; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.NbrOfConver
Posted on September 10, 2014 at 16:50I use CubeMX to add FreeRTOS to my project, currently running on a 429 discovery board. Cube adds FreeRTOS and a CMSIS-RTOS wrapper.I'd like the use the FreeRTOS Event Groups or the CMSIS-RTOS Signals but Event Groups don't appear to be included and Signals remain unimplemented in cmsis_os.cAm I missing something or are these features just not there? #stm32cubemx #freertos
Posted on March 18, 2015 at 07:28I use the STM32CubeMX. However, it has a wrong configuration problem for UART. I want to use the asynchronous RX only mode, but it's not configurable. My configuration procesures: 1. Configuration -> Peripherals -> UART4 as Asynchronous Then 2 pin is set as UART4_TX, UART4_RX 2. I want to use the RX only, so I disable the TX pin. Then the UART4 configuration is changed as Disable. As a result, I can't configure as Asynchronous RX only mode. #cubemx #stm32cubemx
Posted on March 22, 2015 at 10:45 I am using CubeMX 4.6.0 with STM32Cube FW 1.2.1 for a STM32F072 chip. I am having trouble getting the clock settings code to work properly. I have activated some ADC features in CubeMX, which turns on the HSI14 clock. This is fine. But it mixes HSI14 with the system clock in a strange way. If I start with selecting HSI as the clock source in CubeMX, the following code is generated: void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSI14; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSI14State = RCC_HSI14_ON; RCC_OscInitStruct.HSICalibrationValue = 16; RCC_OscInitStruct.HSI14CalibrationValue = 16; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; HAL_RCC_OscConfig(&RCC_OscInitStruct); RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_H
Posted on March 23, 2015 at 15:59NOTE: edited by moderator on Oct 6th, 2016 Hello, I have working example project for STM32F4 Discovery with dp83848 phy, from [[this link/image has been flagged as malicious by our security scan software and has been deleted]] Now I'm trying to run project generated with CubeMX, and program have timeouts during initial communication with dp83848. In function: MX_LWIP_Init/lwip_init ... low_level_init/HAL_ETH_ReadPHYRegister Is there something I should configure manualy for this phy? Are there any examples, running ethernet in CubeMX? I couln't find any. Thanks for any advice. #cubemx #stm32f4 #ethernet
Posted on September 24, 2009 at 20:58C compilers and bit banding #bit-banding #bit-banding #cubemx
Posted on March 17, 2015 at 14:24Hello everyone,I am about to start a commercial product with STM32F429 MCU and have previous knowledge with std_periph_drivers. Since I have already read about bugs with HAL drivers sometimes before, would you suggest using them? #stmcube-stmcubemx #!stm32f4-disco
Posted on March 10, 2015 at 01:47I have created an STMCubeMX project for the STM32F411RE Nucleo board and it is going pretty well until I tried to use DMA. I do not get very far because in no case does the MX_DMA_Init() function get created. The function is declared at the top and called in main(), but it is never defined. This happens whether I set up DMA for ADC1 or for UART2 TX or for both of them at the same time.This seems like a fairly fundamental problem to be having. Has anyone else encountered this or know of a solution? I am running the standalone STM32CubeMX 4.6.0 with STM32F4 package version 1.4.0. I am running this on Linux and generating source for TrueStudio 4.3.1. (I am building on Eclipse with the GNU ARM Eclipse plugin.) #stm32cubemx-hal-mx_dma_init
Posted on February 19, 2015 at 10:31I'm a beginner in stm32Fx. I'm using Keil IDE and cubeMX code generator.I've used I2C1 and I2C3 in my board with stm32f407 microcontroller and used cubeMX for generating initial codes. I've tried to use I2C3 and it didn't work but I2C1 worked correctly.I've tested cubeMX code generator in my stmf429 discovery board and the same issue. I2C1 worked and I2C3 didn't work.I have found a website that has very good libraries with drivers but not as complete as stm's, in that libraries all I2Cs work properly.Does CubeMX code generator has some problems in I2C or not?Thank you Best regaurds #auto-corrected-dyslexia #cubemx #i2c-stm32f4
Posted on February 23, 2015 at 22:49In attempting to validate a schematic design in progress I used CubeMX to verify that none of the I/O assignments and peripheral functions being called out in the schematic were going to conflict. I noticed that at least 3 ADC channels that appear to be valid according to the data sheet, but through CubeMX they are not selectable.PA2/ADC2 PA7/ADC7PC2/ADC12Overall CubeMX is a great product, looking forward to this being fixed. #stm32l152 #cubemx #adc
Posted on February 19, 2015 at 05:25I , just installed the updated version of STM32 MAT target 4.0 version in my matlab 2014a . now there is one block regarding MCU Configuration in which , I have to provide one .ioc file for configuration . My question is when i tried to include any other blocks such as dac adc etc...there is one error pop out on screen like configuration must be done before. how to rectify this error? #stm32f4 #adc #dma #stm32cubemx
Posted on March 05, 2015 at 22:55 STM32CubeMX 4.6.0 Configurator for CAN controller has inaccuracy in calculating of time for one bit. If I set the values for CAN speed 500 kbit /s (bit time 2000 ns) then configurator show 2004 ns. If you calculate the bit time from BS1=8, BS2=3, prescaler=8 and APB=48 Mhz, the bit time is 2000 ns. I also recommend to add to CAN configurator the calculated sample point. It's a very important value. stm32cubemx-bug-can-bus-bit-time
Posted on March 05, 2015 at 01:01My EE was using CubeMX for a 407 and noticed that a lot of the pins can be declared as being GPIO_ANALOG, even if the pins have no analog alternate functions and are not able to be routed to ADCs or DACs.I declared PE0 as GPIO_ANALOG and Cube did generate code to load PE0's mode register with analog, and running the code didn't generate any asserts, but what does that mean?Is this a CubeMX bug or is there some undocumented semantics that I'm missing? (take that as the english language ''or'' please). #cubemx-gpio_analog
Posted on January 07, 2015 at 20:50I am trying to find an example using a cube to build a project and have a simple touch key. I am only able to find the linear slide example, and non HAL examples. Any help is appreciated! Thank you in advance! #hal #capacitive-sensor #cubemx #stm32l1
Posted on February 03, 2015 at 12:01When i try to generate basic code for my STM32F429-DISCO board, CubeMX 4.6 software not generate any main.c file sometimes msp.c not be generated too !My toolchain is: Keil MDK5.13 - new updateIs it because my toolchain uncompatible with cubemx4.6 . HELP Please ? #cubemx-4.6 #stm32f4
Posted on January 28, 2015 at 14:37Does anyone know if there is any planned support for the Keil MCBSTM32F400 within the STM32CubeMX application? #diy #stm32cubemx #mcbstm32f400
Posted on October 27, 2014 at 00:34I am trying to get a USB CDC Device demo working on an STM32F4 Discovery board (with the STM32F407) with code from the STM32CubeMX generator application. The process has been murky at best, hopefully one of you can set me straight. So far, I have configured the project in STM32CubeMX, exported the code, merged the src and inc files with my project template (to use arm gcc). Included in my project template is the CMSIS, HAL and USB driver libraries. Additionally, I have updated my Makefile to build all of the required files. Here is the entire project: https://github.com/thenatefisher/stm32cube-usb-cdc-device-demoAfter connecting both the mini and micro USB ports to my PC, I am able to build the application and load it to my device using openocd and arm-none-eabi-gdb. I can also run the application, but I do not see the device enumerate on my PC. I can verify this by performing an ls /dev/tty.usb* and I see no results. In addition, in the OS
Posted on December 13, 2014 at 21:21 STM32CubeMX 4.5.0 generates the following code for multichannel ADC /**Configure for the selected ADC regular channel to be converted. */ sConfig.Channel = ADC_CHANNEL_1|ADC_CHANNEL_6|ADC_CHANNEL_8; HAL_ADC_ConfigChannel(&hadc, &sConfig); But HAL_ADC_ConfigChannel stm32l0xx_hal_adc.c V1.1.0 has assert_param(IS_ADC_CHANNEL(sConfig->Channel)); which crashes because IS_ADC_CHANNEL() checks for a single channel, not a set. The fix is to comment out this assert_param(). I have not checked whether ADC actually works. Are there any examples of actual conversions using stm32l0xx_hal_adc.c ? Best regards, Tomasz Motylewski K&J Schmittschneider AG #multichannel #stm32l0 #stm32cubemx #adc
Posted on August 23, 2014 at 10:14Does somebody know when the F1 devices will be completely supported on STM32 Cube(i.e. STM32F103)? #stmcube-stmcubemx #stm32f1
Posted on November 06, 2014 at 13:34When selecting the number of channels in the ADC configuration window the automatically generated channel fields are off-by-one, e.g. select 4 channels, there are 3 fields generated, here is the demonstration: Thank you. #stm32cubemx
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.