Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi,I'm trying to set up the HSI (16MHz) on a nucleo-f446ze board. The clock configuration GUI is kinda misleading I guess: default PLLMUX configuration is selecting HSE, but HSE oscillator is not present by default on the nucleosselecting HSI on PLLMUX highlight an error that goes like "PLLMUX should have an HSE input"....is this just a warning (wording is "should") ? if not and this is a proper error and is not possible to select HSI why is there a MUX at all?with that said, what is the correct way (if any) to use the HSI with PLL? hope someone can shed some light.cheersStef
For version 6.2.0 of cubemx software, select stm32l562vetx chip, use FreeRTOS CMOS V2, and fill in the stack size for the new task. In the generated armmdk code, the unit is not "words", but "bytes". But if I change to f429ze chip, the generated code will see stack_ size “* 4�?。
已解决。
..
I am using an STM32F407 controller and have configured I2C1 as SMBus.However after configuration in the IDE, the initialization code generated for I2C1 is as follows:void MX_I2C1_SMBUS_Init(void) { /* USER CODE BEGIN I2C1_Init 0 */ /* USER CODE END I2C1_Init 0 */ /* USER CODE BEGIN I2C1_Init 1 */ /* USER CODE END I2C1_Init 1 */ hsmbus1.Instance = I2C1; hsmbus1.Init.OwnAddress1 = 0; hsmbus1.Init.AddressingMode = SMBUS_ADDRESSINGMODE_7BIT; hsmbus1.Init.DualAddressMode = SMBUS_DUALADDRESS_DISABLE; hsmbus1.Init.OwnAddress2 = 0; hsmbus1.Init.GeneralCallMode = SMBUS_GENERALCALL_DISABLE; hsmbus1.Init.NoStretchMode = SMBUS_NOSTRETCH_DISABLE; hsmbus1.Init.PacketErrorCheckMode = SMBUS_PEC_DISABLE; hsmbus1.Init.PeripheralMode = SMBUS_PERIPHERAL_MODE_SMBUS_HOST; if (HAL_SMBUS_Init(&hsmbus1) != HAL_OK) { Error_Handler(); } /** configuration Alert Mode */ if (HAL_SMBUS_EnableAlert_IT(&hsmbus1) != HAL_OK) { Error_Handler(); } /* USER CODE BE
I updated to the latest 1.7.0 for IDE and 6.3.0 for MX and when I regenerate configuration code using MX I get the following for ADC clock configuration. PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC; PeriphClkInit.AdcClockSelection = ADCCLockSelection;The second line gives an error, when I comment the second line out it compiles correctly. It seems that the code generation might have an error in it regarding this.Caleb
STM32CubeMX Version 6.3.0 "Manage embedded software packages"When I try to load packages from STMicroelectronic, I always get the error message"STMicroelectronics.X-CUBE-***.pack (HTTP Access Forbidden)"The other categories (STM32 Cube MCU Packages or ARM) do not have this problem.RegardsRolf
I have spent a couple weeks trying to get this working, reading many ST threads about many quickfixes to get this to work on various stm32 chip versions. Ive had no real luck other than seeing some details about the SD Card like its size. Stm32CubeMX is pretty nice for some things but for this case its not so nice. (Example. The FATFS option "Use DMA template" breaks DMA evidently, yet I havent seen any FATFS DMA work so its just another undocumented piece of what the heck is this)The non DMA version works. Which is great, but the DMA example uses RTOS which I dont believe I want.32L496GDISCOVERY\Applications\FatFs\FatFs_uSD_StandaloneI tried to convert this project that looked like what I need, but I could not change the micro in stmcubeIDE due to it being greyed out and my porting attempt failed. The readme text file says its easy to port the project to another micro but I could find no documentation on where/how this "easy" process takes place. So into the dark failed porting I've b
In cubemx, the config of Tim12 TGRO is missing.Where in tim1, i can config it under Trigger Out Parameter. This feature is required by DMA request generator.I tried manually add some code to init this, but none of them work./* USER CODE BEGIN TIM12_Init 1 */ TIM_MasterConfigTypeDef sMasterConfig = {0}; sMasterConfig.MasterOutputTrigger = TIM_TRGO_OC1REF; sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET; sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; HAL_TIMEx_MasterConfigSynchronization(&htim12, &sMasterConfig); /* USER CODE END TIM12_Init 1 */The DMA is used to transfer GPIO to memoryuint32_t test[100] __attribute__((section(".ARM.__at_0x24000000"))); //ignore some code here HAL_DMA_Start(&hdma_dma_generator0,&GPIOB->IDR,test,100);
I have a project which uses CH3N of Timer 1 (not CH3) and activated it as PWM. In Cube everything seems to be activated correctly.When looking on the output signal, nothing is output unless I activate the CH3N output by Keil debugger or via code as follows:// To activate PWM on CH3N: Set Register: TIM1_CCER Bit CC3NE = 1; uint32_t tmpccer; /* Get the TIMx CCER register value */ tmpccer = TIM1->CCER; tmpccer |= TIM_CCER_CC3NE; TIM1->CCER = tmpccer;There is no parameter option to enable CH3N. Only CH3 is available.BR GS
From L475 datasheet and reference manual it was mentioned that the WWDG clock source is from PCLK1. Whether PCLK1 Timer or Peripheral clock is used for WWDG? I couldn't find the details.. Attached reference image from cubeMXThanks
Hello, I use SensorTile.box with Stm32L4R9 MCU, CubeMx 6.1.1, Cube FW L4 V1.16.0I want to configure USB like a Virtual Com Port and it work's nice.But, when I set USB_OTG_FS->Parameter Settings->Battery Charging to Enabled CubeMX generate's such code:/** * @brief Handle USB VBUS detection upon external interrupt * @param GPIO_Pin */ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { HAL_PCDEx_BCD_VBUSDetect(&hpcd_USB_OTG_FS); }And it doesn't check any pin, so all the GPIO callbacks run this code.I also tried to enable VBus pin, but it's still the same .Tell me please if I am doing something wrong or it's a bug.Thank you,Anton
HAL �?��?�브러리 LPTIM 소스 보는�?� �?�전�?는 없었는�?� 최신 HAL �?��?�브러리�? 소스가 새로 �?겨서 ENABLE 하는 부분�?서 TIME_OUT 걸려서 return �?�어서 빠져나가는�?� �?�전 버전�?서는 그 부분�?� 없어서 잘 �?�작했는�?� cubeMX�?서 Firmware Package Name and Version�?서 수정하려고 해�?� 강제로 막혀있어서 수정�?� 불가능 합니다. 해결 방법좀...
I need push-pull mode PFM for resonant converters,but I can't generates push pull PFM on STM32G4 .
Using Project Manager -> Advanced Settings -> Generated Function Calls you can change the initialization order. However this setting is ignored when writing the code.You have to manually change the order in the .ioc file in this line:ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_DMA_Init-DMA-false-LL-true,4-MX_LPUART1_UART_Init-LPUART1-false-LL-true,5-MX_TIM20_Init-TIM20-false-LL-true,6-MX_USART3_UART_Init-USART3-false-HAL-true,7-MX_ADC1_Init-ADC1-false-LL-true,8-MX_ADC2_Init-ADC2-false-LL-true,9-MX_ADC3_Init-ADC3-false-LL-true,10-MX_ADC4_Init-ADC4-false-LL-true,11-MX_ADC5_Init-ADC5-false-HAL-trueChanging the numbers is what CubeMX is doing, but that is not enough. You have to actually reorder the items.CubeIDE:Version: 1.2.1Build: 5190_20200115_1224 (UTC)STM32CubeG4 Firmware Package V1.1.0 / 28-June-2019
Hi,my STM32L151RC-A running at 65,536 khz with the MSI.I´ve created the basic code with STMCubeMX.i´ve tried to use this command to use the low power run mode:HAL_PWREx_EnableLowPowerRunMode();But this does nothing :\Same power comsumption at 168µA (ST-Link is dissconnectet when i measure the Current.)The standby mode works fine with a comsumption at 2µA.Does anybody have an idea why i cant switch the low power run mode?Main.c source:/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obt
With the G4 Cube package version 1.1.0 I could configure OPAMPs as "PGA Internally Connected" and only the positive Input is enabled. With version 1.3.0 also the negative input is enabled. OPAMPs where this is not possible due to pin conflicts are silently disabled.My interpretation of the datasheet is that the old behavior is correct and it should be possible to use the OPAMP only with a positive input.Version 1.1.0:Version 1.3.0:
Hello,I am working on the stm32h745zitx controller. My requirement is as follows:1.USB_HS2.USB_FS 3.Booting USART ,I2c4.JTAG ,SWD5.Total 6 spi=SPI 1-2-3 configure as Receiver only master at 75MHz, SPI 4-5 as Receive only master 50 MHz and SPI 6 as receiver only slave6.10 ADC7.3 timer8.14 NSS external software pin9.DAC10.OPAMAccording number this are my priorities but when I initialize the peripherals on peripherals yellow sign is shows. I want to ask that the what is yellow sign means? And the peripherals that I initialized are properly get initialized I am attaching the my the project file please tell me that initialized its properly.
Working on three level t type inverter. We are using two timers to generate 12 pwm signals. Using stm32h743ift6, timer1 and ttimer8 in complementary mode. Requirement: 1)to generate two stage carrier pwm. 2) timer 1 to run from 2400 to 4800, then 4800 to 2400 centre aligned mode., 3) timer 8 to run from 0 to 2400 and then 2400 to 0 centre aligned mode. 4) timer 1 and 8 are already in synchronisation. Need suggestions how this can be implemented. Timers run at 240Mhz clock and produce 50kz switching frequency.
Hello,I am working on STM32h745Zitx controller.If i enable the USB_HS peripherals then i select the I2C1 in that yellow icon is present and shows the message that partly disabled conflict with USB_OTG_HS :External Phy Device_only.Similarly all the peripherals shows that error i added the images of it . It is compulasary to remove the yellow icon or we cam move forward with that pin configuration. Someone can help me please?
The screen blinks when mouse over the code area in stm32cubeide . i install the generic versio of linux. my system is manjaro 21.0.7. May I ask what the reason is?
In my current project I am using CubeMX to generate the proper code and drivers for my stm32H7. The outcome of this generation is only a part of the needed project, I also have several SW infrastructure layers which are Supposed to be above the generated CubeMX code. Is there an efficient way to generate the project with the cube while controlling its structure?(meaning the hierarchy and file structure of the project)Thanks in advance,
Hello,I have a problem with ADC and timer setup and I was hoping I could get a bit of help.I would like to sample two analog signals simultaneously with regular dual simultaneous mode. The only way this has somewhat worked for me so far is to use TIM3 and set one of the channels in PWM mode, and then set ADCs to trigger at TIM3 Trigger Output Event. However, even in this case, another problem arises: It appears to me that TIM3 triggers ADC too often (in such a way that the main loop does not even manage to execute a single line of code no matter how much I slow down TIM3 - even with Prescaler in the order of 10000).Not sure why ADCs will not trigger on any timer other than TIM3 or any other capture/compare event other than PWM.Code snippet for ADC and timer initialization, CUBEMX generated:(If needed, I can provide the rest of the code).static void MX_ADC1_Init(void) { ADC_MultiModeTypeDef multimode = {0}; ADC_ChannelConfTypeDef sConfig = {0}; hadc1.Instance = ADC1; hadc1.Init.Scan
Hi,I have control H-bridge with 4 MOSFET .PWM Topology : Push Pull Mode (Complementary)PWM Frequency : 10KHz.Dead Time : 2.5usDuty Cycle : 0% to 50%Emergency Stop : 2 Fault Pins for Individual ChannelsHow to generate Push Pull Mode with PWM Fault pin/Shutdown CubeMx for 2 channels with TIM1 with Above configuration:Will that possible ?--Karan
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.