Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on August 08, 2014 at 08:45I see a lot of talk about STMCube on here, and I am sure its exciting for ST to be developing this new product. But, this is NOT ready for professional level embedded engineers that need to ship products that work. I need to spend time building stuff, not hunting down bugs, and playing with APIs and tools that don't work. I am shocked that ST is not supporting the Standard Peripheral Libs anymore. I have put in an email to leadership (I am the CEO of an Austin Embedded company, so hopefully it will find its way to decision makers), but that said, of the FAEs on here and professionals, have we heard anything that ST is going to come to their senses and retract the position of not updating and supporting the Standard Peripheral Libraries? And instead do the SANE thing of continuing to support the SPL while suggesting customer try out the new STMCube tech, and at such time the STM Cube tech is 100% operational then they can wind down the SPL support. Rig
Posted on August 23, 2014 at 01:14I am trying to configure a new project in STMCubeMX which will utilize the FSMC Nand module. I have several other peripherals obviously and the code generation works fine until I enable the NAND module. I can enable NOR/SRAM with no trouble, but any time I try and enable NAND, it fails. This happens for F2 and F4 series chips. Has anyone else experienced this? I have tried re-installing clean, as well as the eclipse plugin. #stm32f4 #hal #stcubemx #stm32
Posted on August 12, 2014 at 11:42I have implemented USB FS CDC on STM32F405 (OLIMEX H405 prototype board) using CubeMX. A LED indicates (hUsbDevice_0->dev_state == USBD_STATE_CONFIGURED) and a communication with VCP on PC works in both directions. Now I have added a handling of ADC1 (single channel, continous conversion, no DMA, interrupt) using CubeMX again. I use Priority Grouping 4 and set the interrupt priority 0 for SysTick, 1 for ADC and 2 for USB. There is currently nothing in the ADC handler except HAL_NVIC_ClearPendingIRQ(ADC_IRQn) and the interrupt is fired (debugger). If I do not disable the ADC interrupt (to comment __HAL_ADC_ENABLE_IT(hadc, ADC_IT_EOC) in HAL_ADC_Start_IT(...)) the LED is not getting and USB communication cannot work. The board is still seen in the Windows Device Manager as enumerated without a problem (no yellow exclamation mark). Any opinion or advice welcome. #cubemx-stm32f405-adc-usb-cdc
Posted on July 31, 2014 at 16:55I'm using STM32CubeMX v4.3 to generate my STM32F303x custom board pins.I need both USB and CAN enabled.I can set USB (as FS Device) pins as: PA11: USB_DMPA12: USB_DPAnd CAN pins as: PD0: CAN_RXPD1: CAN_TXBut for some reason, I can't enable USB and CAN at the same time.When I try to enable USB, CAN can't be enabled anymore (grayed-out) and on mouse hover, says: ''CAN Not Available: CAN IP can be selected if USB IP is not selected''When I try to enable CAN, USB can't be enabled anymore (grayed-out) and on mouse hover, says: ''USB Not Available: USB IP can be selected if CAN IP is not selected''Why?Anything I'm missing here? #stm32cubemx-usb-can
Posted on August 07, 2014 at 22:42STM32CubeMX ver.4.3.0 / STM32Cube V1.0Generated the attached STM32CubeMX project file.Upon reloading the project the Clock Configuration tab is empty - it does not show the clock tree info.What should I do to fix the Clock Configuration tab in order to show the clock tree? #stm32cubemx-clock-configuration
Posted on August 02, 2014 at 05:40 Fresh download and build of STM32CubeMX v4.3 for STM32F3-Discovery_Demo fails due to implicit declaration of __HAL_USB_EXTI_CLEAR_FLAG: Warning[Pe223]: function ''__HAL_USB_EXTI_CLEAR_FLAG'' declared implicitly C:\Users\maj\Downloads\STM32CubeF3\stm32cubef3\STM32Cube_FW_F3_V1.0.0\Projects\STM32F3-Discovery\Demonstrations\Src\stm32f3xx_it.c 172 ... Error[Li005]: no definition for ''__HAL_USB_EXTI_CLEAR_FLAG'' [referenced from C:\Users\maj\Downloads\ STM32CubeF3\stm32cubef3\STM32Cube_FW_F3_V1.0.0\Projects\STM32F3-Discovery\Demonstrations\EWARM\ STM32F3-Discovery_Demo\Obj\stm32f3xx_it.o] Error while running Linker Tried to workaround by adding this line in stm32f3xx_hal_pcd.h: #define __HAL_USB_EXTI_CLEAR_FLAG() EXTI->EMR &= ~(USB_EXTI_LINE_WAKEUP) But I'm not sure if this workaround is OK. #stm32cubem
Posted on July 06, 2014 at 15:59 Hi guys, I tried to make a project by STM32CubeMX. I configured the MCU and the Project file is this (USART.ioc) : #MicroXplorer Configuration settings - do not modify #Sun Jul 06 17:52:14 IRDT 2014 File.Version=4 KeepUserPlacement=false Mcu.Family=STM32F0 Mcu.IP0=NVIC Mcu.IP1=RCC Mcu.IP2=USART1 Mcu.IPNb=3 Mcu.Name=STM32F030F4Px Mcu.Package=TSSOP20 Mcu.Pin0=PF0-OSC_IN Mcu.Pin1=PF1-OSC_OUT Mcu.Pin2=PA0 Mcu.Pin3=PA2 Mcu.Pin4=PA3 Mcu.PinsNb=5 Mcu.UserName=STM32F030F4Px NVIC.EXTI0_1_IRQn=true\:0\:0 NVIC.SysTick_IRQn=true\:0\:0 NVIC.USART1_IRQn=true\:0\:0 PA0.GPIOParameters=GPIO_PuPd,GPIO_ModeDefaultEXTI PA0.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_RISING PA0.GPIO_PuPd=GPIO_PULLDOWN PA0.Locked=true PA0.Signal=GPXTI0 PA2.Mode=Asynchronous PA2.Signal=USART1_TX PA3.Mode=Asynchronous PA3.Signal=USART1_RX PCC.Family=STM32F0 PCC.MCU=STM32F030F4Px PCC.MXVersion=4.3.0 PCC.PartNumber=STM32F030F4Px PCC.Seq0=0 PCC.SubFamily=STM32F030 Value Line PCC.Temperature=25
Posted on August 05, 2014 at 17:42Hello, it is nearly impossible to update the Firmware Libraries for the CubeMx Tool on a PC without Internet connection, following the description in the manual. Please clearify the the procedure. Probably there is also a bug somewhere. I managed to update the FW Lib on a PC, using the Eclipse plugin. On other machines which had seen the standalone version, I'm unable to update the Lib. I get only a list of the Libraries from 1.1 to 1.2, but never 1.3. #cubemx #offline #st32cubemx
Posted on July 25, 2014 at 15:13Hi, recently I have used STM32CubeMX to generate framework (FreeRTOS, LwIP) for our platform based on STM32F429. Every except ethernet is working out pf the box. When ethernet connector is not connected everything is running fine. Ethernet status gets from HAL_ETH_STATE_RESET to HAL_ETH_STATE_READY and the FreeRTOS is running just fine. However, when I connect ethernet to the MCU board the FreeFROS will hang at configASSERT( ucCurrentPriority >= ucMaxSysCallPriority ) in file port.c. Looking at the PC I can see that an ARP packet (with correct MAC and IP address) has been received from the MCU. Therefore I assume that ethernet is from the electrical point of view working. Could this be a bug in configuration generated by STM32CubeMX? Thanks, Crt #stm32cubemx #ethernet #freertos
Posted on April 08, 2014 at 17:20I have two probably-related bugs relating to clock configuration in the pinout and clock configuration wizards of the STM32CubeF4 tool; I have been unable to find any references to these bugs, so I don't know if there's a tool limitation I haven't found in the documentation yet... On a project using the STM32F405RGTx with an external 32.768 KHz crystal on the OSC32 pins, the clock config wizard does not allow me to configure the RTC clock mux to use the LSE, although I have appropriately configured the pins as OSC32 and have enabled the LSE in the RCC section of the pinout wizard. The RTC clock mux remains grayed out and cannot be changed from its default setting. On a project using the STM32F205RCTx (testing the ability of STM32CubeMX to replicate an existing product design for the F2 series), the pinout wizard does not allow me to configure OSC32_IN and OSC32_OUT as GPIO output pins, although the LSE is disabled in the RCC. Since I'm using this exact
Posted on March 06, 2014 at 13:02Hi,It would be great to have access to the STM32CubeMX project files for various evaluation and demonstration boards, like the STM324xG-EVAL that uses the STM32F407IGH6 processor. This would greatly help porting a dev board to a custom PCB.Thanks,Nicholas #stm32cubemx #stm324xg-eval
Posted on June 03, 2014 at 19:15Hi, I've been trying to use some of the math/DSP functions from CMSIS, but that doesn't seem to work out of the box since STM32CubeMX doesn't generate/copy the required library files. It does, however, copy (some version of) the CMSIS &sharpinclude files, e.g. arm_math.h, arm_cm4.h, and so on. Those files are pretty useless if you want to actually use some of the functions defined there, say arm_cos_f32() or various others. There will be a linker error since the respective library files (e.g. libarm_cortexM4lf_math.a for gcc, or any other variant) is not available in projects generated by STM32CubeMX. (I'm currently using STM32CubeMX 4.2.0 with STM32CubeF4 1.1.0) No, I do not think that having to manually download (some unknown version) of the CMSIS ZIP file from arm.com is a good solution for users. Neither is having to copy the lib files from random places in 3rd-party toolchain directories, from random eval-board CD-ROMS or ZIP files, or from ran
Posted on May 13, 2014 at 07:23 Hi! I'm sure there is a bug inHAL_Delay() when current time returned by HAL_GetTickis close to overflow (0xFFFFFFFF). Check out this code: http://ideone.com/MAdwBN Second version ofHAL_Delay() is my suggestion, it's pass the test. //----------------------------------------------------------------------------- #include <stdio.h> #include <inttypes.h> //----------------------------------------------------------------------------- #define __IO static uint32_t Ticks; /// Debug version of HAL_GetTick() static uint32_t HAL_GetTick() { return Ticks++; } //----------------------------------------------------------------------------- #if 1 /// Original HAL_Delay() from CubeMX void HAL_Delay(__IO uint32_t Delay) { uint32_t timingdelay; timingdelay = HAL_GetTick() + Delay; while (HAL_GetTick() < timingdelay) { } } #else /// Proposed HAL_Delay() void HAL_Delay(__IO uint32_t Delay) { uint32_t tt = HAL_GetTick(); while ((uint32
Posted on April 24, 2014 at 13:32Tired of changing project settings after each code generation from MX. Is there a chance of modifying Keil-project template? Thanks. #keil-cubemx-code-generation
Posted on April 24, 2014 at 04:50Greetings all,I have a couple of problems with STM32CubeMX-V1.1.0 with the following options: * STM32F439 * FreeRTOS * LwIP The first problem is a bug in the sys_mutex_lock function which is generated as: void sys_mutex_lock(sys_mutex_t *mutex) { sys_arch_sem_wait(*mutex, 0); }It's calling the sys_arch_sem_wait function which has a prototype of: u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout) As can be seen here; both sys_mutex_lock and sys_arch_sem_wait both expect to receive a 'sys_mutex_t*'; however sys_mutex_lock dereferences the pointer rather than passing it across correctly. The correct implementation of sys_mutex_lock is: void sys_mutex_lock(sys_mutex_t *mutex) { sys_arch_sem_wait(mutex, 0); } The second problem is with configuring Lw
Posted on September 02, 2013 at 13:14Hi Folks I'm working with the 32F4 discovery board and I've been looking for some examples of mixed Input and output pins on the same port, however they seem a like hard to find!! I checked the Ref Manual and does seem possible to put input and output on the same port. I'm using the following setup code - is this the right way to go about it?? (the strut was declared earlier) - The outputs (3,4) seem to work fine, but I get no pull ups on the inputs.... GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_DOWN; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_25MHz; GPIO_InitStruct.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_4; GPIO_Init(GPIOE, &GPIO_InitStruct); GPIO_SetBits(GPIOE, GPIO_Pin_4 ); GPIO_SetBits(GPIOE, GPIO_Pin_3 ); GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN; // so change the strut to from Alt funct to GPIO (in
Posted on April 08, 2014 at 11:51 Hi, I can't get the USB Host code generated by STMCube to work. When I connect a device, none of the interrupts get triggered - the software doesn't seem to recognize it at all. The peripheral clock is enabled and the interrupts are getting set, I see this function get called in usbh_conf.c in the debugger: void HAL_HCD_MspInit(HCD_HandleTypeDef* hhcd){ GPIO_InitTypeDef GPIO_InitStruct; if (hhcd->Instance==USB_OTG_FS) { /* Peripheral clock enable */ __USB_OTG_FS_CLK_ENABLE(); /**USB_OTG_FS GPIO Configuration PA11 ------> USB_OTG_FS_DM PA12 ------> USB_OTG_FS_DP */ GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); /* Peripheral interrupt init*/ /* Sets the priority grouping field */ HAL_NVIC_SetPriorityGrouping(NVIC_PRIO
Posted on April 01, 2014 at 12:38 STM32CubeMx generate code for STM32F407VGTx I chek box '' DMA2 Stream0 global interrupt'' in '' NVIC Configuration'' STM32CubeMx not add in stm32f4xx_hal_msp.c - HAL_NVIC_EnableIRQ: void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc){ GPIO_InitTypeDef GPIO_InitStruct; if (hadc->Instance==ADC1) { ... HAL_NVIC_EnableIRQ(DMA2_Stream0_IRQn); // No Add } } #stm32cubemx-dma-interrupt-nvic
Posted on March 22, 2014 at 01:39 Hello. I am currently trying to build a project using the STM32F429 iDisco. The toolchain I am using is the arm embedded gcc, under Eclipse IDE. I am trying to use STM32Cube to write the initialization part for me. Initially I want to use CDC to loopback data sent from a pc (host) to the board (device). Later I want to implement communication between pc and board to control sensors. I'm fiddling with the various callbacks that Cube puts in usbd_conf.c. Since my first problem is the fact that the host pc cannot recognize the connected board (Windows has stopped this device because it has reported problems. (Code 43)A request for the USB device descriptor failed.) I am playing with HAL_PCD_ConnectCallback, but I am not sure what I should be doing there. I tried opening a bunch of endpoints (with HAL_PCD_EP_Open()), but to no avail. Using the board's LEDs to give me output depending on the device state, tells me that after initia
Posted on February 21, 2014 at 15:09Hi all,I have installed ST32CubeMX tool and I was wondering if there are any ''pre-built'' project files for STMicro evaluation boards such as ST32F407 Discovery board. I don't know the exact configuration of the ST32F407 chip on the Discovery board. I have tried to select all the possible peripherals but I get conflicts when I assign the pinouts.Best Regards,Mohamed #st32cubemx #discovery
Posted on March 12, 2014 at 22:17I am trying to use the STM32CubeMX tool to select and generate initialization code for the encoder interface. I am using the Discovery board (STM32F407VGT) and trying to configure timer 5, but not sure how to get it to allow me to select this interface. It is grayed out and not sure how to resolve it. Anyone been able to do this? Also there does not seem to be an motor encoder example using the new HAL layer, if any one can point me to one, to would be helpful. Thanks #motor-encoder #st32cubemx
Posted on March 04, 2014 at 19:42HiI'm exploring the STM32F405 and for this, i wanted to create the initial project with the Cube MX tool. I've settet all the things up to my configuration. In minimal i just set the hole clock thing up.I've burned this down to the chip just to make sure if the thing going to my while(1).But the generated code leads to the Hardfault error handler.I discovered that the fault is happening somewhere around when it calculates the latency for flash read write. This is in the beginning of the method: HAL_RCC_ClockConfig located in stm32f4xx_hal_rcc.cIt jumps directly after command '' if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSE) '' (Line 782) to Address 0I don't think that i have to change some lines in the library.. Probably the clock is set the wrong way.here are the values out of the generated code: RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILL
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.