Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
According to my understanding of the manual, setting ADC1 to synchronous clock mode requires selecting the clock source as AHB. The constraint should be the AHB1 frequency (green mark). However, CubeMX use D1CPRE clock (red mark) as a constraint. Synchronous clock mode optional only available when the D1CPRE frequency is low enough(In that case CPU clock is too low).Is this a CubeMX bug, or I have misunderstood the manual?
I spend more time trying to get round the bugs of crap software than getting on with the design job in handwhy why why is CRAP cube ST 5 just sitting there hanging when trying to generate project codeany help appreciated
Hello,I try to get the usb vcp running on the nucleo-l053r8 board. I will keep it simple and to it with your software CubeMX in the first step.I created a project with the help of CubeMX. I activated the usb pins, selected usb CDC. Activated rc48 for usb clock and Hsi RC 16 with pll and the settings *3 /2 to drive the rest with 24MHz.After this, I changed the heap size to 1000 and stack size to 400 as described in some article on your homepage.Now I created a project for Iar. This is running and I get some information about a connection trial. The usb analyzer says: PnP: device connectedPnP: device surprise removalPnP: device disconnectedIf I try to debug the software, an interrupt is asserted. Reset was send and in this interrupt call also a suspend flag and an esof flag is evaluated.In my point of view, this fits perfect to the result of the analyser.Can you help me with this issue please. I have tried also some other examples but I had always the same issue.Best regard
CubeMX ver. 5.3.0. I tried different microcontrollers.
Hey everybody. i have the following problem, after updating my System Workbench for STM32 and my STM32CubeMX I got the same error every time (see below). When I create a project with Cube, the first time works well. But if I want to add some options like SPI and generate a second time, CubeMx deletes all the code in STM32H743ZITx_FLASH.ld. Which leads to an error after build and run like this:** Programming Finished **** Verify Started **Error: checksum mismatch - attempting binary comparediff 0 address 0x00000000. Was 0x2d instead of 0xf8diff 1 address 0x00000001. Was 0xa8 instead of 0xb5diff 2 address 0x00000002. Was 0x03 instead of 0x00diff 3 address 0x00000003. Was 0x67 instead of 0xbfdiff 4 address 0x00000004. Was 0xc9 instead of 0xf8diff 5 address 0x00000005. Was 0xb8 instead of 0xb5diff 6 address 0x00000006. Was 0x64 instead of 0x00diff 7 address 0x00000007. Was 0x19 instead of 0xbfNo more differences found.** Verify Failed **shutdown command invokedIt is of course possible
Tried to update and download documents.Still buggy.STM32CubeIDE, Version: 1.0.2, Build: 3566_20190716-0927 (UTC)
I've CUBE-MX 5.3.0 ant I'd like to add package X-CUBE-MEMSMIC1.It's not in the list of embedded packages shown in CubeMX.I've downloaded tha .zip from:https://www.st.com/en/embedded-software/x-cube-memsmic1.htmland I tride to install it "from local" but it's not accepted by Cube-MX.It seems a .pack package file is requested, but where is it?Thanks and Regards
I tried to create a project but I couldn't. Please check out the images for understand the errorI selected STM32Cubemx on Manage RunHow to fix it?
Hello, I'm a newbie with STM32.I transmit data over the UART interface and I have configured 9600 Baudrate, but I can only receive the correct data on my PC terminal if I setup to 4800.. So why the Baudrate is effectively 2 times lower? I'm using the blue pill board with the STM32F103C8Tx, and clock configuration Sysclk,Hcclk is 72Mhz, setup with STM32CubeMx. (no warnings at build)sorry my poor english.thank you very much
Hello, I use STM32CubeMX and use the latest STM32H7 (1.5.0) firmware.When may the MX_SDMMC1_SD_Init finally be fixed?The function still looks like this, which will accomplish nothing, really:void MX_SDMMC1_SD_Init(void) { hsd1.Instance = SDMMC1; hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING; hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE; hsd1.Init.BusWide = SDMMC_BUS_WIDE_4B; hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE; hsd1.Init.ClockDiv = 25; }Should it better look something like this, at least calling HAL_SD_Init too, or is it not needed to do so?void MX_SDMMC1_SD_Init(void) { HAL_StatusTypeDef status; hsd1.Instance = SDMMC1; hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING; hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE; hsd1.Init.BusWide = SDMMC_BUS_WIDE_4B; hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE; hsd1.Init.ClockDiv = 25; status = HAL_SD_Init(&hsd1); if (status != HAL_OK) { Error
Hello everyone, I'm trying to connect UART to my board. I've followed many tutorials on youtube but it still does not work properly. I can't see Hello World on COM6. Board: STM32L053C8I followed this tutorial:https://www.youtube.com/watch?v=d6MZHdgCQx0/* USER CODE BEGIN 0 */ uint8_t myTxData[13] = "Hello World\r\n"; /* USER CODE END 0 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { HAL_UART_Transmit(&huart2, myTxData, 13, 10); HAL_Delay(1000); /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ }
I have an STM32F051R8 on a custom board and use the HAL library, and much of the code is based on the generated code from CubeMX. The problem I see is that about 1 out of every 10 times when I go to STOP mode the HSI is not configured as the current clock source after a wakeup from GPIO interrupt. From the datasheet: "When exiting Stop mode by issuing an interrupt or a wakeup event, the HSI oscillator is selected as system clock.".I configure the clocks as follows: RCC_OscInitTypeDef RCC_OscInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct; /**Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSICalibrationValue = 16; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12; RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) !=
When comparing main.c created by CubeMx 5.3.0 for IAR with default peripheral initialization option selected for STM32H745-DISCO vs Nucleo-STM32H743 boards, it becomes obvious that for the Discovery board, GPIO doesn't get initialized, whereas for the Nucleo board, the code similar to following is added for each GPIO pin: /*Configure GPIO pins : LD1_Pin LD3_Pin */ GPIO_InitStruct.Pin = LD1_Pin|LD3_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);Anyone else seen this problem?
..
I've been working with I2C on STM32s for some time and I noticed an issue while probing my signals with an oscilloscope.I set my project with CubeMX and usse Atollic TrueStudio as an IDE. Everything works fine. However, I've noticed that the real frequency of I²C is always slightly below the frequency set on CubeMX. I'm using the NucleoF746ZGFor example, if I set the I²C to run at 100 kHz, the real frequency will be around 92 kHz. If I set the I²C to run at 400 kHz, the real frequency would be around 307 kHz, etc.If I'm probing the clock frequency, it's sharp on 8 MHz, as it should be (MCO coming from ST-Link).I was working with STM32F4 before and I dont remember having this issue as I've already probed the signals and it was exactly 100 kHz, 400 kHz or 1 MHz.Is there something I am missing with the clock configuration for this particular peripheral on this MCU ?
Hello, I am facing some strange behavior when I try to debug a stm32l4s9 MCU using Atollic TrueStudio 9.3.0.When I try to debug the mcu using a st-link v2 I get following output:STMicroelectronics ST-LINK GDB server. Version 5.1.0 Copyright (c) 2018, STMicroelectronics. All rights reserved. Starting server with the following options: Persistent Mode : Disabled Logging Level : 1 Listen Port Number : 61234 Status Refresh Delay : 15s Verbose Mode : Disabled SWD Debug : Enabled Waiting for debugger connection... Debugger connected ------------------------------------------------------------------- STM32CubeProgrammer v1.3.0 ------------------------------------------------------------------- Log output file: C:\Users\CKRENS~1\AppData\Local\Temp\STM32CubeProgrammer_a04520.log ST-LINK SN : 56FF71065182525043221987 ST-LINK FW : V2J33S7 Voltage : 3.20V SWD freq : 4000 KHz Connect mode: Under Reset Reset mode : Hardware reset Device ID : 0x470 Device
Hi,The outputs on TIMER8 of the STM32G474 are floating when using the non negative channels This for the PWM or Compare options (PWM Generation CHx or Output Compare CHx)When i use the negative channels everything works fine. (CHxN)I used the following initialization code HAL_TIM_Base_Start(&htim8); HAL_TIMEx_PWMN_Start(&htim8, TIM_CHANNEL_3 ); HAL_TIMEx_PWMN_Start(&htim8, TIM_CHANNEL_2); HAL_TIMEx_PWMN_Start(&htim8, TIM_CHANNEL_1); STM32CubeMx 5.3.0 configured as follow (see picture)
Hi,I'm using CubeMX to init CAN module, everything is working, I can send and receive messages.Now I would like to configure filter to accept only message with specified ID.So, I have this piece of code generated by CUBE: //sFilterConfig.FilterNumber = 0; sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK; sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT; sFilterConfig.FilterIdHigh = 0x0000; sFilterConfig.FilterIdLow = 0x0000; sFilterConfig.FilterMaskIdHigh = 0x0000; sFilterConfig.FilterMaskIdLow = 0x0000; sFilterConfig.FilterFIFOAssignment = 0; sFilterConfig.FilterActivation = ENABLE; //sFilterConfig.BankNumber = 0; sFilterConfig.FilterBank = 0; sFilterConfig.SlaveStartFilterBank = 0; HAL_CAN_ConfigFilter(&hcan, &sFilterConfig);When I'm using this code I can accept all frames.Like I said I need to accept only messages with specified, extended ID, for example 0x12F0AAAA, so I'm changing this lines: sFilterConfig.FilterIdHigh = 0x12F0; sFilterConfig.FilterIdLow = 0xAAAA; sFilterC
The FatFS library references a BSP function to determine if a SD card is plugged in. Since I don't have a BSP for this PCB, CubeMX complains about the missing function. How do I generate a BSP that CubeMX will recognize to eliminate this configuration error?
Hi.I am trying to add usb CDC to a project for the STM32L452 mcu. Project can be created, compiled without problem.I did a test with a simple and non-modified project that just had the usb added. To my despair, machines do not see the device and no enumeration take place. It is as just as if nothing was moving on. Checking with oscilloscope confirms that no level changes, at any time.IDE and cubeMX do not support the L452RE board, so i cannot confirm with a reference design.I did check the USB Device application source code that is in the SDK and it is a very different structure than what the IDE generates. I however do believe that lots are missing in the generated project when compared with the example. (cdc baudrate config, I.E cannot be found in the generated one.)Is there a place where i can find information about validated usb support on the generation of project, or better, has anyone succeeded on generating a basic but working USB CDC app from it?Thanks.
Hi,I downloaded the usb audio extension package from https://www.st.com/en/embedded-software/x-cube-usb-audio.htmlIs there a way to integrate this directly into cube version 5.3.0? Thanks
-----I FOUND THE ANSWER MYSELF. ----------Technical environment :- Master : STM32F767- Slave : M24256 EEPROM on custom board. SCL and SDA on PH4 and PH5 with 4.7K pull-ups- CubeMX : V5.3.0- Normal transaction is : MASTER do a 3 bytes WRITEHAL_I2C_Master_Transmit calls I2C_TransferConfig. Immediately after CR2 update two flags in ISR are set: STOPF ana NACKF. Write timeouts in I2C_WaitOnTXISFlagUntilTimeout. Logic analyzer does not show any activity. Both signals are high. Any ideas where to search for problem?
if (HAL_DAC_Start(&hdac4, DAC_CHANNEL_1)) { /* DAC conversion start error */ Error_Handler(); } if (HAL_OPAMP_Start(&hopamp4) != HAL_OK) { /* OPAMP start error */ Error_Handler(); } HAL_TIM_Base_Start(&htim7); // while(1) // HAL_DAC_SetValue(&hdac4, DAC_CHANNEL_1, DAC_ALIGN_12B_R, Dacbuffers[0][0]); if (HAL_DAC_Start_DMA(&hdac4, DAC_CHANNEL_1,(uint32_t *) Dacbuffers[0], DAC_BUFFER_SIZE, DAC_ALIGN_12B_R) != HAL_OK) { /* DAC conversion start error */ Error_Handler(); }Project is Cubemx generated. Everything works fine without DMA and i get result on DAC output. Trying to start DMA immediately stops with calling HAL_DAC_ErrorCallbackCh1. What can be the reason for this?Cubemx generated codeDAC_HandleTypeDef hdac4; DMA_HandleTypeDef hdma_dac4_ch1; /* DAC4 init function */ void MX_DAC4_Init(void) { DAC_ChannelConfTypeDef sConfig = {0}; /** DAC Initialization */ hdac4.Instance = DAC4; if (HAL_DAC_Init(&hdac4) != HAL_O
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.