Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on February 16, 2018 at 22:35I just upgraded to CubeMx 4.24 and attempted to migrate a STM32F7 project .ioc file. The migration failed with a Java null pointer exception when it reached the CAN IP portion.To verify my .ioc file was not the culprit, I created a new project and the issue persisted. Here are the steps to reproduce: Start CubeMx 4.24, create new projectSelect STM32F745VET for processorSave project, Close CubeMxRe-Open CubeMx, attempt to open file previously created -- opens successfully.Add Ethernet IP, allow clock tab to auto-resolve clock tree issuesSave project, Close CubeMxRe-Open CubeMx, attempt to open file previously created -- throws null pointer exception and uses 100% CPUHere is the topmost portion of the stack trace when it throws the exception:2018-02-16 16:29:02,320 [INFO] UtilMem:68 - End LoadConfig() Used Memory: 2695795904 Bytes (3036151808)2018-02-16 16:29:02,386 [INFO] ThirdPartyDb:293 - Open Third Party DataBase File (/home/david/.stm32cubemx/plu
Posted on February 26, 2014 at 01:38I was able to download and install the STM32CubeMX plugin from ST (stsw-stm32095.zip) into my Eclipse 64-bit Kepler SR-1 software on a Linux 64-bit machine. Opening the perspective created a problem - An internal error of ''../plugins/com.st.microxplorer.rcp_4.0.0.201402191421//db/plugins/projectmanager/linux/64/toolgen.so not found'' message came up. Looking through the jar files in the zip file, it appears that only Windows dlls (32 and 64) can be found in the projectmanager directory of the plugin. The slightly older version of microxplorer (pre-STM32CubeMX) dated from Sept 2013 was able to run, in it's own limited way, without hitting this type of error. Was Linux just overlooked with this plugin, or is it really just for Windows only? #bug #stm32cubemx #stm32cubemx-eclipse-linux
Posted on February 13, 2018 at 16:25I have a project for STM32F446 generated by CubeMX.After changing some pins and re-generated the code, it builds successfully but the debugger settings in the uvoptx file are broken: Keil's debugger cannot connect and shows 'unknown target' in debugger settings. But it sees the ST-Link dongle and its serial number.The solution for me was to restore the uvoptx file from backup. It may be caused by the recent CubeMX update (4.24) or not, I'm not sure.Another suspicious thing after CubeMX update is that it inserts spaces between components of include path in Keil project (uvprojx). But Keil does not mind...Hope this may help to others with the debugger issue, I've lost a lot of time today checking all cables, boards etc.Regards,-- pa#cubemx-4.24 #keil-uvision
Posted on March 28, 2017 at 13:05Hi,Can I add Middlewares from X-Nucleo in STM32Cube MX ?#stm32cubemx
Posted on March 15, 2017 at 16:00Thank you for your patronage. I am Japanese and a beginner of STM32.I am using STM32F3348-Discovery Board to study BuckBoost algorithm. Is there STM32CubeMX file(.ioc) in the STM32Cube example? STM32Cube MX is very useful. So I want to change STM32Cube example configuration with STM32Cube MX.#stm32cubemx #.ioc
Posted on February 04, 2018 at 08:16 Hello! I found a problem with initialization code generated for TIM2 when you select Clock source as ETR2. The bug is with pin initialization for alternate function: GPIO_InitStruct.Alternate is not set to any value (let alone the desired one): Inside function HAL_TIM_Base_MspInit: /**TIM2 GPIO Configuration PA0-WKUP ------> TIM2_ETR */ GPIO_InitStruct.Pin = GPIO_PIN_0; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? The version of CubeMX is 4.0 The problem is only with TIM2, all other timers generate proper code. Regards, Maciej #cubemx-bug #cubemx-bug-report
Posted on February 12, 2018 at 13:25Hi,STM32CubeMX seems to have no option to set the FreeRTOS configuration option configUSE_QUEUE_SETS in FreeRTOSConfig.h file.Would you please confirm?#stm32cubemx
Posted on January 17, 2018 at 12:27Hey everyone,For some reason I can mount, open and write to a SDcard. Although for some reason I cant use the LinkDriver function.I have the function setup as if(FATFS_LinkDriver(&SD_Driver, SDPath)==0) and when it enters, it fails because disk.nbr seems to always be 1 no matter what I do.Does anyone know what could be causing this? I have one sdcard connected in 4bit sdio mode.A little stumped as it seems to be linked before I even call the function. I also dont have the MX_FATFS_Init(); in the code, so it couldn;t be linked there. Completely Cube generated.int main(void){ /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* Enable I-Cache-------------------------------------------------------------*/ SCB_EnableICache(); /* Enable D-Cache-------------------------------------------------------------*/ SCB_EnableDCache(); /* MCU Configuration----------------------------------------------------------*/ /*
Posted on October 20, 2017 at 14:51Hello!Right now CubeMX generates code with the following signature of Error_Handler function:void _Error_Handler(char *, int);When I turn my project to use c++, compiler doesn't like it, and I change it to the following:void _Error_Handler(const char *, int);So I suggest to adjust code generation accordingly.Regards, Nikolay#cubemx #stm32 #code-generation
Posted on October 23, 2017 at 10:16Hello.I am troubled with garbled characters of CubeMX's code generation function.The version of CubeMX is 4.22.1.The development environment is SW4STM32.The reproduction method is explained below.1. Generate the code with CubeMX.2. Open the project with SW4STM32 and change the character code of the project to UTF-8.3. Open main.c and add Japanese characters to the USER CODE area.4. Quit SW4STM32.5. Start CubeMX and generate the code again without changing anything.6. When SW4STM32 is started and main.c is opened, it can be confirmed that garbled characters are occurring. You can also check garbled characters in the text editor.From this, I think that CubeMX has the cause of garbled characters.Is there any workaround?Best RegardsYas#cubemx-4.22
Posted on August 11, 2017 at 09:39The enforced project and directory structures created are seriously limiting especially when trying to use STM32CubeMx for defining boards which can run multiple applications or when trying to use the code generated as a library for board functionality, including not being able to generate board.h and board.c instead of main.h and main.c for for encapsulating startup code. These 'perceived' limitations make it impossible to use STM32CubeMx to maintain these initialisations except for very small projects. #stm32cubemx
Posted on February 07, 2018 at 15:56Hi Everyone,I am brand new to the community and so far I'm pretty impressed! I am relatively inexperienced and I'm just getting up to speed migrating from the underwhelming TI microcontroller platform so my questions may be a bit rudimentary. I've found the example code for the L4 HAL quite useful and I'm already making some progress. In the example code I notice:1. Often there are lines reading PPPhandle.instance = PPPx (for example AdcHandle.Instance = ADCx) and I notice that eclipse throws a warning on this. I assumed that ADCx, ADCy, TIMx, etc need to be changed to ADC1, ADC2, TIM3, etc. Is that assumption correct?2. Likewise, I notice in the example code sConfig.Channel = ADCx_CHANNELa; and I assume that this must change to the form of ADC1_CHANNEL_0 for example. Is that assumption correct?3. In one of the HAL examples , the goal is to set a timer trigger ADC channel. In the code there isa) an ADC_Config function w
Posted on September 20, 2017 at 12:35Hi guys.I'm working in a STM32L476JGY based project using the board STEVAL-STLCS02V1.The code generated by the Cube using the default clock configuration 'forgets' initialize the M value of the PLL struct, see original code:/** System Clock Configuration*/void SystemClock_Config(void){RCC_OscInitTypeDef RCC_OscInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_PeriphCLKInitTypeDef PeriphClkInit;/**Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI; RCC_OscInitStruct.MSIState = RCC_MSI_ON; RCC_OscInitStruct.MSICalibrationValue = 0; RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI; RCC_OscInitStruct.PLL.PLLN = 40; 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) != HA
Posted on February 06, 2018 at 17:37Hello,Why CubeMX is not supporting Segger Embedded Studio and Crossworks ?Segger Embedded studio is completely free for non commercial use, and have very nice and responsive interface. and also very fast debugging capabilities.It will be great to have support for this IDE's.ThanksSasha#crossworks #segger-embedded-stusio #cubemx
Posted on September 20, 2017 at 00:46Hi!I found couple of troubles while programming STM32F030F4 with STM32CubeMX.1. I used simple code likewhile(1){ HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_3); HAL_Delay(1);}which must generate 500 Hz square wave on PA3. It is actually work for STM32CubeMX V. 4.18.0, but 4.22.1 version gives 250 Hz signal.2. I tried to use PLLCLK source (with the same code), but it absolutely doesnt work with any settings in V. 4.18.0 and V. 4.22.1 - there is no signal, just little ripples on PA3. With HSE and HSI sources without PLL it works. Some months ago I used V. 4.20.1 without this trouble. Can you provide a download link to this version?#pll #cubemx #stm32f0 #rcc
Posted on February 02, 2018 at 19:15Hello, I will first describe what I am trying to accomplish, what I have tried, and how it is not working; any help/advice is greatly appreciated.I have an external MCU (Particle Photon) acting as the SPI Master. Approximately every half second it needs to send 64 bytes to the STM32F103. It can also be multiples of 64 bytes (e.g. 50x 64 byte chunks equaling 3,200 bytes in this example... maximum of 200x chunks). The STM32 also has its own data that needs to be sent back to the master MCU, same format.I have stripped a lot of this down, and am just trying to get a single 64 byte exchange to happen reliably, and I am failing at that.I used STM32CubeMX to generate the source code and configurations. Here are the functions I am using:SPI Buffers & Init Flag: uint8_t txData[64]; //uint8_t txData[MAX_DEVICES_TRACKED * 64]; uint8_t rxData[64]; //uint8_t rxData[MAX_DEVICES_TRACKED * 64]; bool spiReady = true;Main L
Posted on January 28, 2018 at 08:22Hello,I am working on a project connecting a Nucleo-F767ZI with IBM Watson IoT. I found an expansion X-CUBE-WATSON I I read the example inside it using the Disco-F769NI. I read the code and tried to configure my Nucleo the same way but I don't know if my configurations are right or not because there are many things in the examples (I know that there are some files don't need changing). I checked the documents and they are not showing how to configure the CubeMX or some kind like that to run the example. So are there any tools or many documents or may be articles that can help me with this? I hope that there are somethings that can help.Thank you very much, Best regards, Duy#x-cube #x-cube-watson #cubemx
Posted on February 01, 2018 at 16:36Hello there,Is it possible to download older versions of CubeMX form somewhere? The new releases rarely work and there is no way for me to fallback if I didnt keep a copy. I would appreciate all help.#cube #cube-mx
Posted on September 12, 2017 at 15:37I have had hands on the CubeMX user label feature for pin assignments and found it very usefull. It was possible to write application code like HAL_GPIO_TogglePin(my_label_GPIO_Port, my_label_GPIO_PIN), and when the pin assignment changed later on, simply regenerating code using CubeMX would redefine the my_label_GPIO_Port and my_label_GPIO_PIN definitions. No changes in application code needed!Now correct me if I'm wrong, but I believe no such feature is present for full peripherals. Being able to assign a user label to, say, SPI4 would be great. I would be able to do HAL_SPI_Transmit(my_label, buf, len, 0). If I would want to switch from SPI4 to SPI2 I would only need to do so in CubeMX and be sure to give SPI2 the label my_label again. This way again, no changes in application code are needed.I came across this old thread: https://community.st.com/message/136659 where the feature is already discussed. Has the feature been implemented for periphe
Posted on December 21, 2017 at 14:44I am wroking on a project using two microcontrollers a STM32F412 and a STM32L011 (8K flash, 2k RAM) .The STM32L011 is used as RTC to manage the power comsumption of the STM32F412. I used STM32CubeMx to generate the code to set the peripherics that I use within the L011 (I2C, RTC, RCC). The problem is the size of the generated code once compiled is bigger than the 8k available inside the flash of the L011.I only compile the genretaded code without writting a line of code.!How could be possible to get a bigger code than the place to stored it for a defined STM32?I think I did something wrong but I can find what is wrong.Someone could provide me any ideas to resolve this situation. (i can not change the micro)You will find in attachment the .ioc file. The genrated code from STM32Cube Mx is trasnfered on a Eclipse platform and is used GNU ARM tools..Thanks in advance for your helpBest regardsSerge LOPEZ#stm32cubemx #stm32l0xx
Posted on February 23, 2017 at 21:43I am using atmega AT24C256 EEPROM and STM32F0 discovery module. I am struggling to read/Write to the memory. Here is the example I trying to use:-&sharpdefine I2C1_DEVICE_ADDRESS 0x50 /* A0 = A1 = A2 = 0 */&sharpdefine MEMORY_ADDRESS 0x07Buffer[0] = 'M'; HAL_I2C_Mem_Write(&hi2c1, (uint16_t) I2C1_DEVICE_ADDRESS<<1, MEMORY_ADDRESS, 1, Buffer, 1, 5); HAL_Delay(1000); Buffer[0] = 0x00; HAL_Delay(1000); HAL_I2C_Mem_Read(&hi2c1, (uint16_t) I2C1_DEVICE_ADDRESS<<1, MEMORY_ADDRESS, 1, Buffer, 1, 5); if (Buffer[0] == 0x4D) // if xBuffer[0] = 'M' { Test = 1; }On reading from memory, I do not get the 'M' or but some '255' instead. Where is the problem? Do I need to configure clock properly? I used CUBEMX for basic routines.#cubemx #eeprom #hal #stm32f0 #i2c
Posted on May 29, 2017 at 22:20CubeMX V4.21.0 on MacOS 10.12.5.4.21.0 was available, so I downloaded it. Opened my current project, checked to see if my pet peeves had been fixed yet - nope. Went for lunch.Came back from lunch and Cube has 3.7GB of RAM locked down.If I click between the various tabs, the memory goes up in 20MB increments. Now up to 3.89G.Simply move the cursor around on the screen, you don't need to click on anything, and it goes up in 100MB increments. Now up to 4.94GB.Just as a point of reference, Eclipse, with a large project open, in the debugger, using OpenOCD, since mid last week 428MB.Andrei from The Great White North(as seen on the Embedded.FM podcast and blog)#cubemx-ram
Posted on June 08, 2016 at 16:48Hi, setting the ADC1_IN8 or ADC_IN15 as OPAMP x Output Differential or OPAMP x Output Single-ended in STM32CubeMx v 4.15 with NUCLEO-L476RG doesn't generate the correct GPIO setup. The OPAMP output pins are configured as GPIO_MODE_ANALOG under HAL_OPAMP_MspInit in stm32l4xx_hal_msp.c while they should be configured as GPIO_MODE_ANALOG_ADC_CONTROL to feed the ADC. There is also another error: setting the the ADC1_IN8 or ADC_IN15 as OPAMP x Output Differential generates the wrong regular channel configuration as ADC_SINGLE_ENDED. It should be ADC_DIFFERENTIAL_ENDED. Regards #stm32-cubemx-opamp-adc
Posted on January 16, 2018 at 16:42Hey everyone,I'm using the stm32f722ze and CubeMx and have gotten my input capture working. Essentially, when every rising edge is detected, the timer triggers a DMA event and stores the GPIO pins value to memory. This happens on every rising edge, although I'd like this to only occur every 8 rising edges. Is there anyway that I can get the input capture to be triggered every 8 rising edges instead of every rising edge?Thanks in advance for any help!#nucleo-stm #cubemx #timer-interrupts #input-capture-mode #stm32f7-timer
Posted on January 18, 2018 at 05:36I am trying to configure the timers for a BLDC applications, so that the hall sensor change triggers another timer.In cube, If you configure a timer as XOR ON/ Hall Sensor Mode, you can't configure it as a Master Timer.In the configuration, the Master/Slave Mode disappears, and in the generated code, it automatically selects disabled. Cube 4.23.0#cubemx-configuration-tab #cube-mx #hall-effect-hall-timer #timer-master-slave #hall-sensors #bug
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.