Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
The Linker Script is not being updated, if a heap or stack size of 0x00 is being written in MX and a code is being generated. Also mx.scratch won't be deleted.I'm using STM32CubeIDE v 1.3.1 and tried it on the L011F4 and L452RE controllers.To set the heap or stack on 0x00 you have to either set it to 0x00 in the Linker Script everytime manually oder set it in MX to 0x00 and don't have an updated Linker Script.
Hi,I've just received new nucleo board, created new project for this board using cubeIDE and first thing i wanted to check is how the memories are split between cores and i'm a bit confused because i'm missing atleast 500k of RAM as it's not in linker files.CM7 Linker:MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K }CM4 Linker:MEMORY { FLASH (rx) : ORIGIN = 0x08100000, LENGTH = 1024K RAM (xrw) : ORIGIN = 0x10000000, LENGTH = 288K }Nucleo is advertised with 1Mb of ram so where is the missing part? It looks like i'm mising SRAM4, AXI SRAM and backup RAM sections, do i need to add them manualy to linker script or there is an option somewhere in .ioc file?
Hi,1) How to make copy of Project which created with STM32CubeIDE 1.3.0 and TouchGFX ?2) How to rename the STM32CubeIDE and STM32CubeMX (.ioc)--Karan
CubeMx 5.6.1, STMH7 SW v 1.7.0:Symptoms: measurements from ADC1/2/3 makes no sense, they are usually very close to full scale or at full scale.After much onion peeling, it turns out the VREF is not getting enabled.The CubeMX generated code does try to enable it in stm32h7xx_hal_msp.c: /** Configure the internal voltage reference buffer voltage scale */ HAL_SYSCFG_VREFBUF_VoltageScalingConfig(SYSCFG_VREFBUF_VOLTAGE_SCALE0); /** Enable the Internal Voltage Reference buffer */ HAL_SYSCFG_EnableVREFBUF(); /** Configure the internal voltage reference buffer high impedance mode */ HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE);But it forgets to enable the VREFBUF clock before doing that.This seems to be a HAL bug, as I cannot find a "__HAL_RCC_VREF_CLK_ENABLE();" being called before the 3 lines above configuring the VREFBUF.
When I generate for TIM9 input capture to measure a pulse width, CubeMX inserts correctly these two lines into the function MX_TIM9_Init: if (HAL_TIM_IC_Init(&htim9) != HAL_OK) { Error_Handler(); }Then in the stm32fxx_hal_msp.c file it inserts a HAL_TIM_IC_MspInit with the TIM9 stuff in it.But for TIM10:If I also generate for TIM10 also for input capture to measure pulse width it now inserts these lines in the MX_TIM10_Init function: if (HAL_TIM_Base_Init(&htim10) != HAL_OK) { Error_Handler(); } if (HAL_TIM_IC_Init(&htim10) != HAL_OK) { Error_Handler(); }and in the stm32fxx_hal_msp.c file it inserts a HAL_TIM_Base_MspInit function instead of a HAL_TIM_IC_MspInit.Why the 2 different behaviors for TIM9 and TIM10? I did manual code (without using CubeMX) could I get away using TIM9 annd TIM10 the same way (without the TIM_Base stuff) just sticking with HAL_TIM_IC_Mspinit for both timers?Thanks
I am using STM32h743 , code is generated using STM32CubeMx.I am using USB_OTG_FS in device only mode, with USB_DEVICE middleware configered as CDC class .Here's my clock configurationThe usb is clocked from RC48I could reduce the clock from 480MHz to 120 MHz by changing RCC_OscInitStruct.PLL.PLLP from 2 to 8 .But when I try to change clock to 96MHz or 80 MHz by changig RCC_OscInitStruct.PLL.PLLP to 10 or 12, the USB is not recognized by windows!!!I am using windows 10 .How to overcome this problem?
I'm noticing lots of interrupts during reception of the last byte. Should there not just be one interrupt at the end of the last byte received?The top trace in the following screenshot shows entry/exit to/from the I2C Event ISR.
Hello everyone,I have a circuit that measures 6 adc inputs from various voltage readings. I've got 3x4 pcs 7 segment displays and 4 buttons on the circuit. Tim1 is working on 100uS to generate a 100us tick and display scans.the thing is when I left ADC Pins floating, readings are extremely noisy (+- 100 ADC counts),also when timer works these jumps widens. I've changed capacitors, resistors, added voltage divider circuits, changed ADC frequency, nothing helps. I simply coulndt get a stable reading at any circumstances.I've built same sort of circuit with my stm32f4 discovery kit, same results as well.do you know any particular reason for this behavior?Project created via CubeMX, Stm32f103c8t6 Runs at 72Mhz ,ADC Runs at 12MhzADC: hadc1.Instance = ADC1; hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc1.Init.ContinuousConvMode = ENABLE; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.
Hello,When I was trying to use PWM complementary outputs of TIM1, I used CubeMX to create the C code but was not able to turn on the N output while the P output shows right period and duty cycle but no deadtime inserted. Tried many CubeMX configs and compared that to the example in "STM32F3xx_HAL_Driver\...\Examples\TIM\TIM_ComplementarySignals", no obvious difference was found. I found later the CCER was always set to 0x1 instead of 0x5 for both Ch1P and Ch1N to operation, ticked CC1NE in CCER, the N output showed up and both P and N had right deadtime.Digging deeper, I found TIM_OC1_SetConfig() in stm32fxxx_hal_tim.c as belowstatic void TIM_OC1_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config){ uint32_t tmpccmrx; uint32_t tmpccer; uint32_t tmpcr2; /* Disable the Channel 1: Reset the CC1E Bit */ TIMx->CCER &= ~TIM_CCER_CC1E; /* Get the TIMx CCER register value */ tmpccer = TIMx->CCER; /* Get the TIMx CR2 register value */&nbs
Happens in an old project created with an older version of cubemx and going to a new one. When I create a new project with pin interrupts, it defines #ifdef HAL_EXTI_MODULE_ENABLED #include "stm32f0xx_hal_exti.h" #endif /* HAL_EXTI_MODULE_ENABLED */however, no matter where I search (online and downloaded drivers in my CubeMX dir), that file exists no where in the drivers library. Why is this an option when the file doesn't exist? Using STM32Cube FW_F0 V1.10.1 and STM32F091RCTx. I had just rebuilt some code and it enabled this where previously it hadn't (or i had to comment it out before, I can't remember)
Hi, I've an STM32F411VET and CubeMX 5.5.0.I need to read data from uart2, but callback (HAL_UART_RxCpltCallback) isn't called.- In POLLING mode the usart2 works fine but this method isn't appropriate for me.- In INTERRUPT mode, I can send data but don't receive any and obviously HAL_UART_RxCpltCallback isn't called.- In DMA mode with circular buffer, I can send and receive data, but HAL_UART_RxCpltCallback isn't called.In all tests I've called:HAL_UART_Receive_IT() or HAL_UART_Receive_DMA() with read lenght of 1 or 4 bytes.I've created the test projects from CubeMX activating "Usart 2 global interrupt", but after 8 hours of tests withouth satisfaction I start to give up.Can you help me?Thanks.Best regards.
I am trying to program an STM32H7x3 device. My memory device (AS4C16M16SA) has address bits A0 - A12 and seems to need each of the 13 signals for access. However, when I go into STMCubeMX there is a max on SDRAM of 12 address bits. It seems like I should be able to assign the A12 address to pin PG2 based on Table8 in the DS12117 product document. How can I override STMCubeMX to allow me to connect the full address bus?
stm32cubeMX have bug in SDIO 4biti use stm32f407vg, stm32CubeMX ver 5.4.0in use 1 bit true work but 4bit not working.this code generate for SDIO mode: SD 1 bit/** * @brief SDIO Initialization Function * @param None * @retval None */ static void MX_SDIO_SD_Init(void) { /* USER CODE BEGIN SDIO_Init 0 */ /* USER CODE END SDIO_Init 0 */ /* USER CODE BEGIN SDIO_Init 1 */ /* USER CODE END SDIO_Init 1 */ hsd.Instance = SDIO; hsd.Init.ClockEdge = SDIO_CLOCK_EDGE_RISING; hsd.Init.ClockBypass = SDIO_CLOCK_BYPASS_DISABLE; hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_DISABLE; hsd.Init.BusWide = SDIO_BUS_WIDE_1B; hsd.Init.HardwareFlowControl = SDIO_HARDWARE_FLOW_CONTROL_DISABLE; hsd.Init.ClockDiv = 4; /* USER CODE BEGIN SDIO_Init 2 */ /* USER CODE END SDIO_Init 2 */ }and this code generate for SDIO mode: SD 4 bit Wide bus/** * @brief SDIO Initialization Function * @param None * @retval None */ static void MX_SDIO_SD_Init(void) { &nbs
Hi,Please help me, how to add a custom file into my project. When regenerate source by CubeMX it will delete my sourceThanks,
..
Hi Team,Greetings of the day.We are using the STM32F746ZET6 controller from STM.We are using all the timers for our development.While configuring that timer we faced some conflict errors on that. Kindly help us on this to solve the issue.1. We are configuring the Timer 5_CH1 in normal mode2. Then we configure the Timer8_CH8 with PWM and Output compare mode. (in both the modes we need to set the internal clock).3. We are getting the conflict error as ( Clock source conflict error with TIM5)Refer: Error images are attached with this mail.Query: We are not using the internal clock for Timer 5 but it shows the conflict error with Timer 8. Kindly help us on this issue.
Can I use only the TX and RX pins of an USART and make it work exactly as an UART?
I'm creating serial communication application.I'm using STM32F303RE and USB CDC interface generated by STM32CubeMX.I used USBD_CDC_TransmitPacket() for transmitting data from device to PC.But when the data size == 64*x then read() in PC program didn't respond only on Windows.when <=63 bytes or >=65 bytes responded correctly.I used Windows10 and usbser.sys was used as driver.I investigated what is happened, then found out bulk in transportation is not finished in the driver.In USB FS mode max packet length is 64bytes so the data will be divided into 64bytes.Thus the driver have to wait less than 64bytes packet to detect the end of the data.In stm32f3xx_hal_pcd.cwhen the data is 64bytes then send only one 64bytes packet and end transmission.So I edited the code to send 0 bytes packet when the last packet is 64bytes.Then read() in PC worked correctly.I edited in PCD_EP_ISR_Handler() in if ((wEPVal & USB_EP_CTR_TX) != 0U)------/* Zero Length Packet? */if (ep->xfer_len == 0U){-
EDIT:I installed STM32CubeMX 5.6.1. When I ran CubeMX it freezes when I click Install/Remove embedded software packages. How can I fix that? There is a section for managing software installation. When I click any button here ("CHECK FOR UPDATES" or "INSTALL / REMOVE") the CubeMX freezes completely
Please show as a picture what kind of signal buses like I2C, SPI will produce with each setting.There are explanation with settings of course, but sometimes one picture is really worth of 1000 words or more.
Hi everyone,I created this small project.I uploaded package firmware to version 1.11.0 When I generate the code I have all these error messages.The only one we don't need to pay attention is the first error as it's a lib I imported myself.But why I have missing files even if last updated drivers?Let me know if you need to know something else in order to help me. Thank youBuild started: Project: NumPad *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Build target 'NumPad' assembling startup_stm32f072xb.s... compiling ssd1306.c... ssd1306\ssd1306.h(12): error: #5: cannot open source input file "_ansi.h": No such file or directory #include <_ansi.h> ssd1306\ssd1306.c: 0 warnings, 1 error compiling freertos.c... compiling usbd_desc.c... compiling usbd_conf.c... ../Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h(63): warning: #47-D: incompatible redefinition of macro "HID_FS_BINTERVAL" (declared at line 76 of "../Inc/usbd_conf.h")
Sorry for these noob questions, but I am having a hard time understanding the exclamation marks in CubeMX. If somebody could please guide me here, it will be much appreciated.Example 1:The ADC converter is shown as Partially Disabled. However, I should still be able to use is, as long as I don't select IN2, right? So, since I have selected IN9, why do I still get this warning? There is clearly nothing wrong.Example 2: Again, I assume I can safely use USART5 as long as I do not select hardware flow control. Is that correct? Also, since I have clearly NOT selected hardware flow control why is it showing this warning?Final Example:I have selected the STM32F030CCT6 for my design. I want to use USART4 and USART2. Their RX and TX signals are on pin 10/11, and 12/13 respectively. However, since USART4 RX and TX pins can also be used for USART2's CTS and RTS signals , there is a POTENTIAL conflict here. This is flagged, despite of me NOT selecing hardware flow controls CTS and RTS. I have look
I have generated my code using CubeMx tool in STM32CubeIDE. I find the stm32f4xx_hal_uart.c missing from the project. But when I generated the code by enabling the uart as asynchronous mode the second time, the uart appears in the driver folder. Why uart is missing?
When I want to use the X-CUBE-BLE1.5.0.0 on STM32CubeMX, the file "b_l475e_iot01a1_bus.h/c" is not generated. Thus the project cannot be compiled.To reproduce:create new project on B-L475E-IOT01A boardoption of Targeted Language: C++Initialize all peripherals with their default Mode: YESAdditional Software: STMicroelectronics.X-CUBE_BLE1 (version 5.0.0): Controller: checked, HCI_TL: BasicHCI_INTERFACE: USER_BOARDUtils: CheckedWireless BlueNRG-MS: checkedExti Line: SPBTLE_RF_IRQ_EXTI6 [BT module_SPI_IRQ]Bus IO driver: SPI3CS line: SPBTLE_RF_SPI3_CSN [BT module_SPI_CS]Reset line: SPBTLE_RF_RSTSee attached file...
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.