Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on February 26, 2016 at 02:46So eagle eye'd son pointed out that the publicity picture for CubeMX shows its logo sprawled across the face of Apple's MacBook Pro. And yet there are logos for Windows and Linux next to it.So, when is CubeMX going to be supported on MacOS? It works really well, except for getting updates.Thanks,Andrei from The Great White North. #cubemx-macos
Posted on February 22, 2016 at 16:25I have two UARTs configured as follows (code generated by CubeMX).UART_HandleTypeDef huart2;UART_HandleTypeDef huart4;// Pins (Rx/Tx): PA3 / PA2 - Asynchronous (UART)void MX_USART2_UART_Init(void){ huart2.Instance = USART2; huart2.Init.BaudRate = 115200; huart2.Init.WordLength = UART_WORDLENGTH_8B; huart2.Init.StopBits = UART_STOPBITS_1; huart2.Init.Parity = UART_PARITY_NONE; huart2.Init.Mode = UART_MODE_TX_RX; huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart2.Init.OverSampling = UART_OVERSAMPLING_16; HAL_UART_Init(&huart2);}// Pins (Rx/Tx): PA1 / PC10 - Asynchronous (UART)void MX_UART4_UART_Init(void){ huart4.Instance = UART4; huart4.Init.BaudRate = 115200; huart4.Init.WordLength = UART_WORDLENGTH_8B; huart4.Init.StopBits = UART_STOPBITS_1; huart4.Init.Parity = UART_PARITY_NONE; huart4.Init.Mode = UART_MODE_TX_RX; huart4.Init.HwFlowCtl = UART_HWCONTROL_NONE;
Posted on February 16, 2016 at 09:02My tools: STM32f072rb (NUCLEO) MCP2200 uart to usb board STM32CubeMX (4.12.0) Keil uVision 5 (5.17) What I'm trying to do: Running a program in the main loop and reading UART transmission into a ring buffer. (as soon as Rx signal is present, an interrupt is triggered which reads the incomming data) Init code was generated using CubeMX, setting up UART2, 8Bits 9600 Baud, no HW flow control, on STLink debugger UART1, 8Bits 9600 Baud, no HW flow control, on MCP2200 One attempt of mine was connecting the Rx2 pin to EXTI6, triggering a GPIO interrupt and readingfrom there. (Receiving char on UART2, echo it to UART1) This worked well for only one char and is imo. a really dirty solution. In CubeMX, under NVIC the UART2 global interrupt through EXTI line 26 is selected, and the USART2_IRQHandler() is generated into stm32f0xx_it.c When trying to test it by toggling the LD2 led, nothing happens on an incomming Rx signal. It does work when calling HAL_U
Posted on February 12, 2016 at 15:42 Hello, I've been working with ST HAL libraries for an STM32F030R8T6, using the NUCLEO board, and I'm having some problems with the I2C API. Probably it's a configuration issue but for the love of me, I can't find it. The problem: I call the function HAL_I2C_Master_Transmit_XX with address 0x3E. I attach a logic analyzer to the output to check the lines, and the address does not match. The address I see on the line is 0x1F. My main test code is the following. (Just to reproduce this situation) It is a direct copy from the NUCLEO examples. I skip over the SystemClock_Config and MspInit, since I can see data on the lines (I2C is sending data correcly) and they don't provide information for my current problem. #define I2C_ADDRESS 0x3E #define I2C_TIMING 0x00A51314 uint8_t bTransferRequest = 0; //(other stuff) int main( void ) { HAL_Init(); /* Configure the system clock to 48 MHz */ SystemClock_Config(); /*#
Posted on February 07, 2016 at 19:25Hello, I use the USB device CDC class. I do transmit data. But while I give the the data to the CDC_Transmit_FS function. The application must not overwrite data on those buffer until the transmit is finished. Potentially there are several USB packets to be sent until all data transmitted. What I miss is a trigger for the application to reuse the buffer used in the CDC_Transmit_FS function. I assume in the file usbd_cdc.c in function USBD_CDC_DataIn there you could put a function call to callback function: CDC_TransmitCplt_FS the callback function could be added to USBD_CDC_ItfTypeDef. This way it could callback to usbd_cdc_if.c module. Right now after automated code generation I have to patch usbd_cdc.c and usbd_cdc_if.c in order get signals data_received and data_transmit_completed into the application. Regards, Adib. -- #stm32-usb-cdc-cubemx
Posted on August 11, 2014 at 14:27To avoid glitches at the output, we initialize in the following order: 1. GPIOx clock enable 2. Set output registers to defined value 3. Perform initialization Now we would like to use STM32CubeMX. Is it possible when initializing the GPIO to initialize the output level? Example of implementation: In source: /*Configure GPIO pins : PE2 PE3 PE4 PE5 PE6 PE8 PE9 PE10 PE11 PE12 PE14 PE15 PE0 PE1 */ HAL_GPIO_WritePin(GPIOE,GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5 &n
Posted on January 12, 2015 at 11:38Hello all. Bed path: java.io.FileNotFoundException: /home/krzysiek/STMicroelectronics/STM32Cube/STM32CubeMX/db/plugins/projectmanager\stm32tck.cfg (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:146) at java.io.FileInputStream.<init>(FileInputStream.java:101) at java.io.FileReader.<init>(FileReader.java:58) at convertor.Convertor.getTplVer(Convertor.java:1152) at convertor.Convertor.setTemplates(Convertor.java:536) at convertor.Convertor.setDataPath(Convertor.java:1495) at com.st.microxplorer.plugins.projectmanager.model.ToolchainGenerator.setDllDataPath(ToolchainGenerator.java:116) at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createToolChainFolders(ProjectBuilder.java:934) at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:339) at com.st.microxplorer.plugins.projectmanager.eng
Posted on February 04, 2016 at 11:25Hi all, Quite new in the development with LWIP, there is a question I have not found any answer so far; What is the minimum / maximuum frequency at which the main LWIP process function shall be called? I'm talking about the one generated by CubeMX: MX_LWIP_Process. We don't run it as seen in examples, that is in a simple while(1) loop in the main program. We want (and need) to use it from an IT. Thank you for your help #lwip-process-cubemx
Posted on January 19, 2016 at 11:33Hello,I couldn't find bug/issue tracking system for CubeMX, so I place report here.Description: When generating initialization code for TIM4 in input capture mode (channel 1 direct, channel 2 indirect), HAL_TIM_Base_MspInit() function is being generated in stm32f1xx_hal_msp.c file. This is incorrect function for input capture mode, as far as I understand, which leads to timer not capturing signal. CubeMX project file is attached Expected behaviour: HAL_TIM_IC_MspInit() function should be generated.Notes: I've added HAL_TIM_IC_MspInit() manually, which fixed the problem for me.Additional info: CubeMX version: 4.11.0 MCU used: stm32f103c8t6 Library version: STM32CubeF1 Firmware Package V1.2.0 / 31-July-2015 #cubemx #bug
Posted on February 08, 2016 at 05:05 I found incorrect code in SD_write andSD_read code (sd_diskio.c). This conversion will fail on sectors above8388608 (4GB): (uint64_t) (sector * BLOCK_SIZE) It should be (uint64_t) sector * BLOCK_SIZE (uint64_t) sector * BLOCK_SIZE (uint64_t) sector * BLOCK_SIZE It should be #sdio #sd_diskio #cubemx #sdio
Posted on February 05, 2016 at 13:01Hi, I am using the current version (4.12.0) of STM32Cube. Every time I open a *.ioc file, it is immediately regarded as changed -- it's marked by a star in the window title and if I want to exit, I get a warning about unsaved changes. If I save, I get a file which is byte-by-byte identical to the previous one. And if want to generate a report, I get the message ''The Report will be based on a modified version of the project. Would you like to save <projectname> project first?''. If I do not save, I get a remark about modifications in the report. If I save, my project file contents is not changed, but the file time stamp IS changed, which I do not want. At present, I just set the file to r/o. Than I can ''save'' without error message (!), but the file time stamp is not changed. Not a good solution, though. I think this is bad behaviour and should be fixed. #stm32-cubemx
Posted on January 28, 2016 at 22:18I used Stm32CubeMx with STM32Cube_FW_F0_V1.4.0 to generate my project on STM32F030CC with FreeRTOS and EWARM toolchain. In debug mode. I only have the generated code at this time. It first crashes on HAL_TIM_PWM_ConfigChannel() call. It seems to loop inside a strange memory area around 0x1FFFDA7C, or so says the debugger. Log window displays ''The stack pointer for CSTACK (currently 0x20000A78) is outside the stack range (0x200000B8 to 0x200004B8). I decided to comment MX_TIM3_Init() in main.c, but to no avail. I ended up commenting all MX_() calls to keep it as simple as possible, now it crashes with the same behaviour, but on the line __DSB() inside vPortYield(). I then tried to stard without any other initialisation besides osKernelStart(), still won't work. Decided to see if any ISR are being called, and the answer is none, not even PendSV_Handler() nor SysTick_Handler(). Reset default clock settings or not, same problem. I now have an empty Sy
Posted on January 14, 2016 at 09:55My installation of STM32CubeMX is not working. I tried to reinstall the application but the Windows Control Panel -> Programs and Features Uninstall function does not work. I deleted the installation directory manually and installed the application without success.When I try to run the application STM32CubeMX.exe I see a window popping up for a short time:Can anyboldy help me?Thanks,Martin #stm32cubemx #bug #stm32cube
Posted on January 23, 2016 at 15:27CubeMX: 4.12.0STM32Cube_FW: F3_V1.2.0MCU: Stm32F303VCT(stm32-f3-discovery)I configure OPAM4 to ''PGA not connected'', Non-inverting input is configured to PB11.Cube generates code: hopamp4.Init.NonInvertingInput = OPAMP_NONINVERTINGINPUT_VP2;but it should be hopamp4.Init.NonInvertingInput = OPAMP_NONINVERTINGINPUT_VP3; #cubemx #bug
Posted on January 22, 2016 at 22:09I recently upgrade CubeMX to version 4.12.0 and used it to generate code for a custom STM32F407VGT board. Everything seemed to work fine with previous versions, but not so much with the latest version. For example...There is no function generated for MX_DMA_Init() in ''main.c'', even though there is a function prototype at the top of the file. This of course occurs when the DMA controller is enabled in CubeMXThe file ''stm32f4xx_it.h'' is not generated when it should be.In ''usbd_conf.c'', there is a line generated near the top of the file that just contains a &sharpn. Nothing else, just ''&sharpn''There are a huge number of errors in the ''USBD_LL_Init()'' function in the ''usbd_conf.c'' file. There's text in this file which has no business being there at all. Here's a copy/paste of some of that text:Java backtrace for programmers:----------freemarker.template.TemplateException: Error reading included file Src/usb_otg_fs_HalInit.tmp at
Posted on January 21, 2016 at 17:20HI, Is there any Application Note for runtime stack and RAM utilization of the STM32 application .Any tool specific to Nucleo for evaluating the application?Is STM Studio meant for that?Rgds,R #!stm32-!cubemx #stm32cubemx #nucleo #eclipse
Posted on January 20, 2016 at 17:01 Hello, I am attempting to use the STM32CubeMX to generate a base project for the STM3240G-EVAL, specifically attempting to use the evaluations boards LCD. However when I enable the FSMC in CubeMX and configure it, the pins it assigns are in a different order then what the BSP and demonstration firmware use. I am unable to modify the arrangement of the pins, effectively making the code CubeMX generates useless. I have also tried enabling ''Initialize all IP with their default Mode'' when selecting the STM3240G-EVAL in the board selector and get the same pinout. Is there a way to change the assigned FSMC pins with CubeMX, or is this a bug in the definition file for the board that can be resolved? Pinout from STM3240G-EVAL Spec Sheet for LCD: Pinout generated from STM32CubeMX: /** FSMC GPIO Configuration PE3 ------> FSMC_A19 PE1 ------> FSMC_NBL1 PE0 ------> FSMC_NBL0 PD7 ------> FSMC_NE1 PE4 ------> FSMC
Posted on January 03, 2016 at 13:40I have STM32CubeMX v4.12, Check for Updates revealed STM32CubeF1 Release 1.3 After dondloadint , but Cube say: This Package version is not managed on this version of STM32CubeMX. Wher is probl�m? I am talkingabout http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260820?s_searchtype=keyword #stm32cube #stm32cubemx #stm32f1
Posted on May 13, 2014 at 04:41HelloI'm new with ST microcontrollers and reading the documentation I can see that there is STM32CubeMX and STM32CubeF4. I read also that STM32CubeMX contains the STM32CubeF4 or something like that.My question is; If STM32CubeMX contain the STM32CubeF4 then why is it a separate page and documentation for both of them?Does it mean that I only need to install STM32CubeMX and it will have all I need to generate the code for the STM32F4? or do I need to install them both?I'm planning to use the eclipse plugin but I don't know what's the deal with the STM32CubeF4.Than you for answering.Regards! #stm32cubemx #stm32cubef4 #stm32cubemx #eclipse #eclipse
Posted on December 01, 2015 at 12:41Hi, The STM32CubeMX data model is mentioned in the user manual UM1718, I'd like to use some more advanced custom code generation but am getting stopped by a lack of spec for the data model. Is the data model specified anywhere? regards. #stm32cubemx-data-model
Posted on January 10, 2016 at 23:19I am reading through AN4232 on using the F3 comparator and it notes in section 2.3 that the comparator input is also an ADC channel. I would like to use the channel for both, however I have not found a way in STM32CubeMX to configure a pin as both comparator and ADC channel.Am I missing something or is this not possible in STM32CubeMX? #stm32cubemx-stm32f303x-adc-comp
Posted on September 29, 2015 at 12:22I want to set the CR polynomial according to the most top table in http://users.ece.cmu.edu/~koopman/crc/index.html However STM32CubeMX does not allow to do it due to the following restrictions: ---- CRCPolynomial should respect this format : Xa+Xb+...+Xc. where a,b,c are the powers of the polynomial : - a,b,c should be less than 8. - a,b,c should be odd. ---- Why is this restriction? How can I work around it? The generated function MX_SPI1_Init() does not allow user code in it, so I would have to modify it evertime I run STM32CubeMX generation! I seem not to be the first one with this issue:[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/STM32CubeMX%204.9.0%20issues&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21]https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2
Posted on December 12, 2015 at 19:37Hello,I'm using STM32CubeMX to generate a project for STM32F746VGT6.Everything works fine except I2S3, there is no clock output on MCKO pin (PC7) and the call of HAL_I2S_Transmit(...) generates a timeout error.The I2S3-related code generated by STM32CubeMX is:void HAL_I2S_MspInit(I2S_HandleTypeDef* hi2s){ GPIO_InitTypeDef GPIO_InitStruct; if(hi2s->Instance==SPI3) { /* USER CODE BEGIN SPI3_MspInit 0 */ /* USER CODE END SPI3_MspInit 0 */ /* Peripheral clock enable */ __SPI3_CLK_ENABLE(); /**I2S3 GPIO Configuration PC7 ------> I2S3_MCK PA15 ------> I2S3_WS PC10 ------> I2S3_CK PC12 ------> I2S3_SD */ GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_10|GPIO_PIN_12; GPIO_InitStruct.Mode = GPIO_MODE
Posted on December 27, 2015 at 19:31STM32CubeMX is very useful program.Only too slow, on my computers.Each click is delaying work on a lot of seconds.My computers use AMD Athlon & E1 processors.This is not enough? What should I do?Everything happens for so long that it impossible to work!Thank you. #stm32cubemx
Posted on December 23, 2015 at 00:00 Hi, not sure it's a bug because it's my first time with CDC ACM. But After a fresh CubeMX generation with USB_OTG_FS in device mode. I just add this : uint8_t buf[] = ''Hello\r\n'' ; // delay to allow time to pc to load driver (I think so) HAL_Delay(1000); while (1) { HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5); HAL_Delay(50); CDC_Transmit_FS(buf, 8); } } If usb is connected to host during startup it's works. Even if i disconnect usb cable. My led blinking. But if usb cable is disconected the program freeze at line : CDC_Transmit_FS(buf, 8); have you any idea of what is the cause and how to fix it ? Thanks Attached is a zip of project with a Makefile for gcc. #stm32f4-cdc-acm-usb-cubemx
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.