Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on March 28, 2016 at 13:40I use additional targets for tweaking compiling at different stages of the project: - move in memory - set Vector table offset - compiler defines - user defines to create bin files I use stm32f437 Now when I recreate the project from CubeMX targets getting lost. Pls fix this bug. Regards, Adib. #stm32-keil-cubemx
Posted on April 20, 2016 at 18:08HiI use current stm32cubemx & cubef4 1.11i set in cubemx pins , clock & SDRAM config and generate codewhen i see sdram initialize code seems it not set auto refresh commandsthen configuration of sdram in cubemx not generate all configuration need by sdram such as refresh ? #scram-cubemx
Posted on April 19, 2016 at 20:03 Dear ST, please fix already one-year old bug! It is described here yet: https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Java%2FSDIO%20BUG%20Large%20SDHC%20file%20system%20corruption%20%28sd_diskio.c%29&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&currentviews=2, but I'll repeat again, because it leads to very strange behaviour during writing on SD card. Result: you cannot write more then 4 gb during one session using FatFS. lines SD_state = BSP_SD_ReadBlocks_DMA((uint32_t*)scratch, (uint64_t) ((sector + count) * BLOCK_SIZE), BLOCK_SIZE, 1); SD_state = BSP_SD_ReadBlocks_DMA((uint32_t*)buff, (uint64_t) (sector * BLOCK_SIZE), BLOCK_SIZE, count); SD_state = BSP_SD_WriteBlocks_DMA((uint32_t*)scratch, (uint64_t)((sector + count) * BLOCK_SIZE), BLOCK_SIZE, 1); SD_state = BSP_SD_WriteBlocks_DMA((uint32_t*)buf
Posted on December 29, 2015 at 13:17Hi all,Hi All,I'm building a project in STM32Cube for Keil uVision 5. It's working fine. In next step I'm adding some new files in Keil, adding library path in Options for Target and when I have one more time Generate Code in Cube, all my settings disappear by new code. Is there any option in Cube to block it?It's really annoying when I have to do the same things in Keil every time when I Generating Code. #keil #stm32cubemx #stm32cube
Posted on April 13, 2016 at 23:29For STM32Cube_FW_F4_V1.11.0:1) mxconstants.h does not have the &sharpifdef statements to guard against multiple includes.2) stm32f4xx_hal_msp.c has ''/**tttttttttt'' as the first line. It looks like there is some crap in the template file.Thanks for putting together HAL. I'm finding it VERY useful.Andrei from The Great White North #cubemx
Posted on March 29, 2016 at 19:33Hi, I'm trying to build an ''empty'' project generated by CubeMX using FreeRTOS and gcc for STM32F103xB. I'm using the latest CubeMX (4.14.0) and latest HAL (1.3.1). I've successfully built projects using CubeMX, HAL, gcc that work, I just get errors when I'm trying to use FreeRTOS. I've added to the include path (-I) FreeRTOS/Source/CMSIS_RTOS FreeRTOS/Source/include FreeRTOS/Source/porteble/GCC/ARM_CM3 I've included in the build: FreeRTOS/ FreeRTOS/Source FreeRTOS/Source/CMSIS_RTOS FreeRTOS/Source/portable/GCC/ARM_CM3 FreeRTOS/Source/portable/MemMang/heap_4.c + all the other stuff needed to make a CubeMX/HAL project works. but I get undefined reference to `pxCurrentTCB' port.c undefined reference to `vTaskSwitchContext' port.c BTW if anyone from ST is listening it would be nice if you didn't include in the main.c template the cmsis_rtos stuff so one would be free to chose to use FreeRTOS directly or not without hav
Posted on April 05, 2016 at 16:11Hi Everyone I develop USB Hid application on STM32L0.I sent to data STM32 to Computer.But I m not receive any data from computer.Which CubeMX api I am use or how can i write my own function for receive data from usb hid? Best Regards #cubemx-usb-hid
Posted on April 03, 2016 at 13:45I generated code with CubeMX 4.14.0 for STM32F4 USART1. What I got is mainly for UART.In stm32f4xx_hal_conf.h, UART module is included, not USART&sharpdefine HAL_UART_MODULE_ENABLED//&sharpdefine HAL_USART_MODULE_ENABLED In stm32f4xx_hal_uart.h, there is HwFlowCtl, although UART has no flow control. This has been taken care of in the code:/* Check the parameters */ if(huart->Init.HwFlowCtl != UART_HWCONTROL_NONE) { /* The hardware flow control is available only for USART1, USART2, USART3 and USART6 */ assert_param(IS_UART_HWFLOW_INSTANCE(huart->Instance)); assert_param(IS_UART_HARDWARE_FLOW_CONTROL(huart->Init.HwFlowCtl)); }Flow control belongs to USARTs, but that is missing in USART_InitTypeDef.Have I misunderstood something or are there still that kind of bugs in version 4.14.0 #stm32cubemx
Posted on April 03, 2016 at 14:24Hello everybody, I would like to ''free'' some peripherals in the SMT32F429i-DISCO and drive the ili9341 display in SPI mode instead of LTDC. I'm working with CubeMX to init the SPI5 and DMA for the SPI transfer. After it I've developed the display init starting from a lib example in Keil but without using CubeMX. I would like to port that lib in Cube + True Studio but, by now, it doesn't work. Have someone do the same job and can help me? Thanks. Luca #spi #cubemx #ili9341 #true-studio
Posted on March 27, 2016 at 22:57please read my post under [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/STM32%20Virtual%20Com%20Port%20problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/AllItems.aspx?View%3D%257bA4EEE515%252d04F0%252d42D9%252dAC32%252dA6D8340F101B%257d%26FolderCTID%3D0x012001&currentviews=161]Virtual COM Port problem [solved] link current generated code for CDC_Receive_FS is wrong. Also see my current coding patch below. Regards, Adib. static int8_t CDC_Receive_FS (uint8_t* Buf, uint32_t *Len) { /* USER CODE BEGIN 6 */ // USBD_CDC_SetRxBuffer(hUsbDevice_0, &Buf[0]); // USBD_CDC_ReceivePacket(hUsbDevice_0); usb_cdc_rx_handler(Buf, *Len); return (USBD_OK); /* USER CODE END 6 */ } #stm32-cubemx-usb-vcp-stm32f4
Posted on March 25, 2016 at 12:18Hi,I use a CubeMx V1.0, version 4.14.0.Firmware Package SMT32F2 family, V1.3.0 / 20-November-2015.There is an error in the file stm32fxx_hal_tim.c, in HAL_TIM_IC_Start_DMA function.The problem is the beginning of the code, with the handling of the return state. if((htim->State == HAL_TIM_STATE_BUSY)) { return HAL_BUSY; } else if((htim->State == HAL_TIM_STATE_READY)) { if((pData == 0 ) && (Length > 0)) { return HAL_ERROR; } else { htim->State = HAL_TIM_STATE_BUSY; } }In my application, I use 4 channels of the same TIM with DMA requests.If we start a DMA with one channel of TIMx, it is impossible to start another DMA channel of this same TIMx, because the HAL returns alwa
Posted on March 25, 2016 at 11:22Hi,I use a CubeMx V1.0, version 4.14.0.Firmware Package SMT32F2 family, V1.3.0 / 20-November-2015In my opinion, there is an error in the file stm32fxx_hal_uart.c, in HAL_UART_Transmit function.The problem is the blocking of the UART peripheral durting the transmission.You should not lock full UART during transmission otherwise, we cannot receive correctly on interrupt during the transmission. Without this fix, the performances of my application with the uart is pretty bad.With this fix, all is working well.Can the ST team update this driver ? Since it's a part of the drivers used by CubeMx, it's a very annoying problem.Thanks :) #stcubemx #uart #stm32 #hal
Posted on March 24, 2016 at 20:33Hi, When compiling my project raises some compiler warnings. I use a makefile to compile with the following settings: WARNINGS_FLAGS = -Wall WARNINGS_FLAGS += -Wextra WARNINGS_FLAGS += -Wfloat-equal WARNINGS_FLAGS += -Wlogical-op WARNINGS_FLAGS += -Wundef WARNINGS_FLAGS += -Wwrite-strings ♯ ♯ -Wall WARNINGS_FLAGS += -Wno-sign-compare Follows the compiler output warnings: stm32f100(v 1.3.1): Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c:435:38: warning: unused parameter 'Regulator' [-Wunused-parameter] Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c:1066:96: warning: unused parameter 'Alarm' [-Wunused-parameter] Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c:1108:77: warning: unused parameter 'Alarm' [-Wunused-parameter] Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c:2070:76: warning: unused parameter 'OutputChannel' [-Wunused-parameter] Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c:2103:75: warning: unused parameter
Posted on July 11, 2014 at 10:34Hi,I'm using STM32CubeMX for a STM32F205 MCU.There is a problem with the use of the TIM8 configuration, regarding BDTR config register.The DeadTime does not appear in the config of TIM8. And then, its code is not generated either. The problem is that in the libraries, sBreakDeadTimeConfig.Deadtime is not initialised ; and then it contains a random value at reset. Since the initialisation of the register is made like this : htim->Instance->BDTR = (uint32_t)sBreakDeadTimeConfig->OffStateRunMode | sBreakDeadTimeConfig->OffStateIDLEMode | sBreakDeadTimeConfig->LockLevel | &nbs
Posted on March 13, 2015 at 10:37Hi,There is an error in the file stm32fxx_hal_tim.c, for TIM3 and TIM4 capture compare.We never enter in the callback because of this error. * @file stm32f2xx_hal_tim.c * @author MCD Application Team * @version V1.0.1 * @date 25-March-2014Line 2749 and 2770 => you must replace CCMR1 by CCMR2. /* Input capture event */ if((htim->Instance->CCMR2 & TIM_CCMR2_CC3S) != 0x00) { HAL_TIM_IC_CaptureCallback(htim); } /* Input capture event */ if((htim->Instance->CCMR2 & TIM_CCMR2_CC4S) != 0x00) { HAL_TIM_IC_CaptureCallback(htim); }Can the ST team update this driver ? Since it's a part of the drivers
Posted on September 05, 2014 at 14:53Hi, stm32cubeMX is a very convinient tool that generates code and projects for some commercial IDEs. Unfortunatelly I'm not using those IDEs so I'm left alone with a huge amount of C Code and no instructions how to use it :) Does anyone out there know any simple method to import that code into a working project in eclipse ide? Or maye you have any scripts for converting for example TrueStudio project into Eclipse one? Thanks! #eclipse #stm32cubemx #import
Posted on February 16, 2016 at 14:58The MX_FATFS_Init function is beeing called in the main function and again in the default task. After the second call the SD_Path is invalid. I'm using CubeMX 4.13.0 with the STM32F417IGH6, the configuration is in the attachments.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_DMA_Init(); MX_SDIO_SD_Init(); MX_FATFS_Init(); .../* StartDefaultTask function */void StartDefaultTask(void const * argument){ /* init code for FATFS */ MX_FATFS_Init(); /* USER CODE BEGIN 5 */ /* Infinite loop */ for(;;) { osDelay(1);&n
Posted on February 26, 2016 at 03:09 With STM32CubeMX v4.0 and STM32CubeF0 v1.5.0 the GPIO initialization for a hardware NSS pin has changed and doesn't match the information in the reference manual. For example SPI1_NSS from STMCubeF0 v1.2.1 was initialized: GPIO_InitStruct.Pin = GPIO_PIN_15; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Alternate = GPIO_AF0_SPI1; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); NowSPI1_NSS from STMCubeF0 v1.5.0 is initialized: GPIO_InitStruct.Pin = GPIO_PIN_15; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); Receiving data on SPI using DMA is working intermittently. I'm seeing weird issues like entire data blocks shifted by 1 bit. I've had to manually change the GPIO initialization code to get SPI transfers working properly again. The reference manual indicates that NSS is an
Posted on March 08, 2016 at 19:21Hi, I wanted to check out the WIFI Expansion for Cube MX. But I am failing at integrating it into CubeMX as I cannot find any information on how to integrate the downloadable expansions into CubeMX. Any help is appreciated ;) Kind regards Hans #cubemx-stm3-wifi
Posted on March 08, 2016 at 11:08Hello guys, Can somebody share a list of all possible variables that I can use in FreeMarker templates inside of STM32CubeMX with me? I am working on a Makefile and .ld (because existing have not very nice license ;)) ) template. And a it is possible to achieve filename of generated file based on a variable? It looks like that existing templates have an external logic, but it could be nice to have the same for custom templates as well. #freemarker #stm32cubemx #cubemx
Posted on March 03, 2016 at 14:28I have the STM32F303RE Nucleo evaluation board, and I've used CubeMX to configure & generate the HAL drivers. I've configured a DAC on one of the timers, and everything compiles/runs fine, except when I enabled ''USE_FULL_ASSERT'' then I get the following compile error. ../Src/main.c(329): error: &sharp20: identifier ''HAL_REMAPTRIGGER_DAC1'' is undefined __HAL_REMAPTRIGGER_ENABLE(HAL_REMAPTRIGGER_DAC1_TRIG); This comes down to the following code generated in stm32fxx_hal.h: &sharpdefine IS_HAL_REMAPTRIGGER(RMP) ((((RMP) & HAL_REMAPTRIGGER_DAC1) == HAL_REMAPTRIGGER_DAC1) || \ (((RMP) & HAL_REMAPTRIGGER_TIM1_ITR3) == HAL_REMAPTRIGGER_TIM1_ITR3) || \ &nbs
Posted on February 24, 2016 at 13:56 I am really got tired after so many attempt to use this hal drivers for ADC sampling in dual mode and send data over uart. For god sake plz help me. I did whatever user manuals said but still no output. This is the code: /** /* Includes ------------------------------------------------------------------*/ include ''stm32f4xx_hal.h'' /* USER CODE BEGIN Includes */ include < stdio.h > /* USER CODE END Includes */ /* Private variables ---------------------------------------------------------*/ ADC_HandleTypeDef hadc1; ADC_HandleTypeDef hadc2; DMA_HandleTypeDef hdma_adc1; DMA_HandleTypeDef hdma_adc2; UART_HandleTypeDef huart3; /* USER CODE BEGIN PV */ /* Private variables ---------------------------------------------------------*/ //__IO uint16_t ADC_val[2]={0}; char senddata1[20]; char senddata2[20]; __IO uint32_t ADC_val=0; __IO uint16_t ADC1_val=0; __IO uint16_t ADC2_val=0; /* USER CODE END PV */ /* Private function prototypes ---
Posted on February 28, 2016 at 20:14It would be nice if you could move into a header the definition of GPIO_MODE, GPIO_MODE, ... GPIO_CR_CNF_ANALOG, GPIO_CR_MODE_INPUT, GPIO_CR_CNF_ANALOG, ...GPIO_CR_CNF_AF_OUTPUT_OD currently in stm32fNxx_hal_gpio.c These definitions may be useful to automatically generate configuration functions with external tools. CubeMX does a great job if you've to configure pins once but HAL_GPIO_Init() may be not as efficient as it has to be if you've to switch GPIO configuration in the middle of an interrupt and assigning pin functions manually is so '90 and is terribly error prone. Having to cut&paste code from stm32fNxx_hal_gpio.c is annoying and error prone as well. thanks #hal. #cubemx #headers
Posted on February 27, 2016 at 01:00Using channel4 of TIM5 sets up ARDUINO_PWM_CS_D10_Pin where actually thesignal is on D5ARDUINO_PWM_CS_D10_Pin is defined as pin PI_0 which is the correct pin however.------------- so I am expecting generated code to be:in mxconstants.h&sharpdefine ARDUINO_PWM_D5_Pin GPIO_PIN_0&sharpdefine ARDUINO_PWM_D5_GPIO_Port GPIOIin tim.c /**TIM5 GPIO Configuration PI0 ------> TIM5_CH4 */ GPIO_InitStruct.Pin = ARDUINO_PWM_D5_Pin;---------- also TIM1_channel1 generated code attempts to use the D5 pin, it is likely to have the converse problem #stm32f746-cubemx
Posted on February 22, 2016 at 19:16Under ''slave mode'' the timer configuration of the TIMx_SMCR register: ''Combined Reset + trigger'' mode cannot be reached using the available menu items whereas ''reset mode'' or ''trigger mode'' are available.It could also be that the encoder modes are not available as well. #stm32f7xx-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.