Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi all,We are currently using STM32CubeIDE projects autogenerated from STM32CubeMX as part of our development. The issue with STM32CubeIDE projects is that automating and scripting builds with it is cumbersome even with the CLI interface. I would like to explore using the auto-generated makefile option but there seems to be no clear documentation on:Adding my own headers/source files to the makefile?What happens if I regenerate the Makefile after adding a new peripheral through CubeMX?If I want to use both generated STM32CubeIDE projects and Makefile, how do I keep them both in sync in terms of my own code (not generated by CubeMX)As a start I have played around with adding some source files into the generated makefile and re-generating after adding a new peripheral. At the moment the new source/includes required by the newly added peripheral would just be appended after the SRC list in the makefile. This works as a start but I don't think this is maintainable since it's not known whic
Where can I find a procedure for installing the IDE on linux? I found:SetupSTM32CubeMX-6.3.0 and installed it. No problems.st-stm32cubeide_1.7.0 and installed it. No problems.STM32Cube_FW_L4_V1.17.0 and unzipped it. No method for installing.The last one I downloaded manually because I am trying to find an example program to begin evaluation. If use the IDE to install example programs, it will list some examples but the tool does not know how to find a download site. I found the third one and it can be unzipped, but the readme does not specify how to connect to the existing IDE. A note I found on the web says to unpack to a Repository directory. I looked and could not find this folder/directory.On my box, I have /usr/local/STMicroelectronics/STM32Cube/~/STM32CubeIDE which appears to be a workspace for custom filesa ton of hidden dirs which I am unsure what they are for .stm32cubeide .stm32cubemx .stmcube .stmcufinderI installed a previous version of the IDE and never got this working. I
Hi, I am wondering why STm32CubeMX in some projects will generate the correct order of MX_DMA_Init() before MX_USART6_UART_Init(), but in other projects it will reverse that order. if the order is reversed, then the DMA will not work.I have looked into the *.ioc-files. I notived the Mcu.IPxx fields are not ordered correctly starting with Mcu.IP10.working file (DMA_init before USART6_init)Mcu.Family=STM32H7Mcu.IP0=CORTEX_M7Mcu.IP1=DMAMcu.IP2=NVICMcu.IP3=RCCMcu.IP4=SYSMcu.IP5=USART6Mcu.IPNb=6not working file (DMA_init after USART6_init)Mcu.Family=STM32H7Mcu.IP0=CORTEX_M7Mcu.IP1=DEBUGMcu.IP10=TIM3Mcu.IP11=USART6Mcu.IP2=DMAMcu.IP3=ETHMcu.IP4=FREERTOSMcu.IP5=HRTIMMcu.IP6=LWIPMcu.IP7=NVICMcu.IP8=RCCMcu.IP9=SYSMcu.IPNb=12Is there anything I can do to get generated code that is independent of the Mcu.IPNb < 10 ?
Hello everybody,I am trying to build a simple communication between my PC and a Nucleo-F401RE using UART over the USB connection.I am able to do this successfully using a “polling�? or an “interrupt�? configuration.However, when I configure the UART2 of my F401RE as using DMA (I use the CubeMX tool in CubeIDE to do the configuration) and then try to run the program in run or debug mode, I get the error messages:“Debugger connection lost.Shutting down...�?Is it not possible to use DMA of UART2??Many thanks in advance!
I have a multi target project.My targets are STM32L152CB and STM32L152RC. I use Ubuntu 20.4 with STM32CubeMX 6.3.0.Since STM32CubeMX does not natively support multiple targets I've decided to have two cube projects in the same folder. The generated files are the same since both targets use the same pins and peripherals and have the same core. The only difference is the processor type. Common application code will be in a seperate folder from the generated code and the project files.The first problem I encountered was that you cannot rename the .cproject, .project and .mxproject files. They are nameless and I couldn't find an option in STM32CubeMX to add a name. Therefore they will overwrite the existing files from the other target, so you cannot have both project files in the same folder. My workaround was to place the ioc files in seperate target folders.My second problem is that now each target folder has a copy of all the sources. I want all the sources in one place. The ioc file ha
Hey there,I've noticed, that if I generate a project for CubeIDE using the latest STM32Cube_FW_G0_V1.5.0 and I set the timebase source as one of the peripheral timers instead of the SysTick, the program will freeze when the HAL_TIM_Base_Start_IT function is called. This problem does not present itself, when I'm generating the project using V1.4.0 using CubeMX for example. My question is whether or not am I missing something, or is there a bug in the new FW package?Thanks in advance!
Edit 2: CubeMX 6.2.1 is working aswell. Will use this version for now.Edit 1: CubeMX 6.0.0 and 6.2.0 are workingAfter Code Generation, the 3 injected Channels (0,1,2) would be all initialized with ADC_INJECTED_RANK_1 despite other setting in CubeMX.With older Version this was working. Did something change with the setup which I don't understand or is this a possible bug?
Hello, all.How to post info about found bugs in STM32CubeMX?Can't find correct way for it. (Feedback? ST Online Support Center?)Thank you.
I have an STM32H757I-Eval, I wanted to use CubeMX to generate a Makefile like I do for other targets, but the option is greyed out so I can't selected it.Do you know why is not supported? Do you know when it will be supported?Many thanks.
On STM32H753, I want to change the clock source of I2C1.Previously it was HSI with divisor 4 that gives 16 MHz.I noticed that PLL3R outputs almost 16 MHz and try to change I2C1 to this source.Then Cube craps out and declares conflict. Auto-resolving it changes settings of PLL1 and clock rates of other peripherals. What's wrong with it?Finally I managed to tweak PLL3 ... maybe by pure luck.CubeMX ver 6.2.1
Hi,I've used STM32CubeMX to configure my STM32H7 MCU, but RTC initial values which I set on CubeMX as default value are not set on RTC_TR and RTC_DR registers after debugging line by line when MX_RTC_Init() is called. There is no fault reported or any hardfault..., and I've use LSI for RTC.Please help in this simple issue which waste my time couple of days ...Thanks.
While USART (receive from PC and transfer of gained information back, pic. 1) perfectly works on low baud rates like 9600, use of high baud rates leads to obscure results (bad receive and OK transmit, pic. 2)STM32L476VGT6
I have experience with Arduino, but I have no experience with other boards, so I am having difficulties for a few days.I am using the "NUCLEO-F207ZG" board.What I want is to send a ping to the NUCLEO-F207ZG board.After adding a project to STM32IDE, create CubeMX (ioc), select ARM Cortex-M3, and select STM32F207ZG series.The code was generated by selecting "ETH - RMII", "LWIP - Enable", "High Speed Clock(HSE) - BYPASS Clock source", "Low Speed Clock(LSE) - Crystal/Ceramic Resonator".After that, inside the while statement, MX_LWIP_Process(); was added.The ethernet socket has both green and yellow lights on, but not blinking.But it doesn't look like the IP has been set. I tried both STATIC and DHCP, but no IP was assigned.I saw a blog and tried it by referring to it, and the debug goes without errors, but it doesn't work.Below is the project github addresshttps://github.com/parksy1775/nucleo207fzgAm I missing something or am I doing something wrong?Please.... Thank you
I get the error message below twice when I try to create a new project on STM32CubeMX:I tried deleting the crdb.zip file as mentioned in the post below: https://community.st.com/s/question/0D50X0000BBonsLSQR/stm32-cube-mx-error-downloading-the-following-files-crdbzip-cannot-unzippedand performing a refresh but I still get the error message above. Will there be any issues with my build if I ignore the message? I also noticed that I could not perform any updates as pressing "Check For Updates" on the main window gives me the following error message:Are there any workarounds to these problems? I tried uninstalling and re-installing STM32CubeMX but the error messages still appear. I am currently running STM32CubeMX 5.6.1.Any help would be appreciated. Thanks!
CubeMX, LWIP, STM32
Dear Sir・I want to use BLE with B-L4S5I-IOT01A.(FreeROTS)・However, "UM2178" and "Table 1. FreeRTOS ™ porting abstractions" say "not available".B-L4S5I-IOT01A cannot use BLE?Can I use BLE if I create a project with CubeIDE and implement "STM32_BlueNRG1"?Regards
Hello,Our project uses an STM32H743VIT and we are building the project on Cube rev. 1.7.0.Currently we use the HAL function HAL_SRAM_Write_8b to control a display on address 0xC0000000 on bank 1. (the display has an onboard controller SSD1351 setup for 8bit parallel mode) and it works perfectly fine. To offload the CPU we would like to use DMA. Calling the function HAL_SRAM_Write_DMA revealed that hsram->hmdma was not configured so I tried to connect these together using the Configuration tool. Usually, there is a DMA settings tab in the configuration but it is not visible for the FMC. Some googling later it seems we need to use the MDMA module so I have enabled it with a software request. I was expecting to find a way to have the configuration tool generate the code for me to link the DMA to the FMC but found no way so I changed xx_hal_msp.c tovoid HAL_SRAM_MspInit(SRAM_HandleTypeDef* hsram){ /* USER CODE BEGIN SRAM_MspInit 0 */ /* USER CODE END SRAM_MspInit 0 */ HAL
I am selecting the pins PD4, PD5, PD6, and PD7 in the '.ioc' file.The .ioc when only my nor pins are selected. The pins only when ethernet is being enabled. When I enable both the ethernet and the external nor flash. I see the overlapping of pins when I enable both ethernet and the external nor flash.Will this would be a problem for failing my functions. If so what should I do to get it done?Thanks.Could you please help me with this.!@Tesla DeLorean
I am using STMCubeIDE version 1.7.0 and I saw the generate code for the initializationhas different orders when I configured my ADC with DMASometime the code was generate with ADC init before the DMA init MX_ADC1_Init(); MX_ADC3_Init(); MX_DMA_Init();Sometime the code was generate with DMA init before ADC init MX_DMA_Init(); MX_ADC1_Init(); MX_ADC3_Init();Is there a rule for the auto generated code orders?
I tried HAL_I2C_Master_Transmit, HAL_I2C_Master_Receive, HAL_I2C_Mem_Write, HAL_I2C_Mem_Read and even the DMA functions but nothing works - The 8th bit is always 0 and the ACK is always 1.Due to the fact that I'm trying to read the WHO_AM_I value of a register 0x00 on device with address 0x68, I'm expecting write operation at the beginning, writing the value of the address of the internal register.This is my function and printf should print 0xEA.void I2C_readReg(uint16_t Slave_ADRS, uint8_t Reg_ADRS, uint16_t Size, uint8_t *pBufferRead){ uint8_t pBufferWrite[1]; uint16_t MovedAdrs = (uint16_t)(Slave_ADRS<<1); HAL_I2C_Mem_Read(&hi2c1, MovedAdrs, (uint16_t)Reg_ADRS, (uint16_t)1, pBufferRead, (uint16_t)Size, (uint32_t)I2C_READ_TIMEOUT); printf("val read %x \n\r", pBufferRead[0]);}Where's Slave_ADRS=0x68 and Reg_ADRS=0x00
When creating a new Freertos Task like this: osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);prvAddNewTaskToReadyList(...)will be called and uses taskENTER_CRITICAL()to disable interrupts. This breaks down to the call of void vPortEnterCritical( void )void vPortEnterCritical( void )which increases uxCriticalNesting by one.Before leaving void vPortExitCritical()is called. This function should decrease uxCriticalNesting and reactivate interrupts if uxCriticalNesting == 0.However, uxCriticalNesting was previously initialized with 0xaaaaaaaa. So that uxCriticalNesting == 0 is not reached.A later call of osKernelStart();finally sets uxCriticalNesting to 0 and reactivates all interrupts.This results in deactivated interrupts between the first task creation and kernel start, which has undesirable side effects such as the systick timer being stopped, which results in a broken HAL_Delay() function.
Hello,I created a simple project for a board NUCLEO-F303RE enabling USART2 and DMA for transmit and I believe there is a bug in the code generation that doesn't configure properly the peripherals.The generated code has: /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_USART2_UART_Init(); MX_TIM2_Init(); MX_DMA_Init(); MX_USART3_UART_Init(); /* USER CODE BEGIN 2 */Then the MX_USART2_UART_Init has: /* USART2_TX Init */ LL_DMA_SetDataTransferDirection(DMA1, LL_DMA_CHANNEL_7, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); LL_DMA_SetChannelPriorityLevel(DMA1, LL_DMA_CHANNEL_7, LL_DMA_PRIORITY_LOW); LL_DMA_SetMode(DMA1, LL_DMA_CHANNEL_7, LL_DMA_MODE_NORMAL); LL_DMA_SetPeriphIncMode(DMA1, LL_DMA_CHANNEL_7, LL_DMA_PERIPH_NOINCREMENT); LL_DMA_SetMemoryIncMode(DMA1, LL_DMA_CHANNEL_7, LL_DMA_MEMORY_INCREMENT); LL_DMA_SetPeriphSize(DMA1, LL_DMA_CHANNEL_7, LL_DMA_PDATAALIGN_BYTE); LL_DMA_SetMemorySize(DMA1, LL_DMA_CHANNEL_7, LL_DMA_MDATAALIG
I cannot communicate with my computer. I detect the port but in debug mode, I see that the OTG_FS_IRQHandler interrupt is triggered regulary when I send data on my computer.I did the same thing with my dicsovery card F411, it works. But with nucleo F756, it doesn't work. I'll give you all the parameter I set in picture linked.To complete, when I tried to open the COM port with python, I have this error : serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: OSError(22, 'Paramètre incorrect.', None, 87)Do you need more details? Could you help me? I passed a lots of time on it and I don't find.Thank you!
I have setup ADC1 on an STM32G4 in scan mode where the start of conversions is initiated by a timer. I have also setup the DMA in circular mode and configured it such that the ADC results are transferred to an array every time the scan conversion completes. The code generated by CubeMX calls the MX_ADC1_Init() before MX_DMA_Init(). In this order, the DMA doesn't update my array values. However, when I change the order of initialization so that MX_DMA_Init() is called beore MX_ADC1_Init(), everything seems to work fine. I looked in the code briefly, but couldn't figure out why the order of initialization matters. It is also problematic because I have to manually change the order of initialization every time I regenerate code using 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.