Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
..
I am using STM32L010c6tx processor I need Microseconds function. How can I do it using a timer? https://www.youtube.com/watch?v=SqC0IhLKJ9o&ab_channel=ControllersTech I did as it shows in the video but the program didn't work. Most likely APB2, prescaler, counter mode etc. I have an error in the values. How do I write those values?
I have both CubeMX and CubeIDE installed on a LMint system (deb) and if I have software packages available in both It looks like the repositories are keep in different locations which takes up a lot more space. The CubeIDE will not use or load from the repos downloaded by CubeMX. Is there a way to only load one repo and use it for both?
I have a problem of the HAL Driver function HAL_I2C_Master_Transmit's parameter 'DevAddress'. It says that the device 7 bits address value in datasheet must be shifted to the left before calling the interface, that is, if I want to transmit to a device addressed 0x60, the parameter should be 0xc0. And that's exactly what happened. But when I use the function HAL_I2C_Mem_Read, which has same require, the parameter was 0x60, the 0xc0 was wrong.MCU: STM32F407ZGT6CubeMX Firmware Package: V1.26.2I'am confused now. Please help me.:sad_but_relieved_face:
Hello and Thank youI'm starting with I2C on STM32L4R5ZI and I can't get it to work.I'm generating a very simple project for the Nucleo board in CubeIDE.I have only initialize the parameters in CubeIDE, and when I try to run it the red LED ligths up and the programm doesn't execute.I've been messing with it and it doesn't execute code after the initialization of the I2C peripheral ("MX_I2C1_Init();").I have tried changing the clock that the peripheral is using but that doesn't seem to work.Looks like the CubeIDE initialization is not working, but I can't find why.Thank you so much Daniel
Hi!I use two I2C device on two different bus (I2C1 and I2C2) on a STM32G07B1 MCU.The two bus works very well, if I use only one in my code.But if I would like to use all of two, then it will go to HardFault from "__HAL_I2C_GET_FLAG".I use the polling functions in the code.I checked the signals with oscilloscope and logic analizator, too. The signal is very nice, no problem.In the logic analizator I see, that the first i2c device works fine until I would like to switch on the second device on the other bus. The second device sends NOTHING.This is my pinout:My I2C config: Do you have idea, what could I make?Thank you!Balazs
I am trying to get 2 stm32f411's to communicate via SPI. From my understanding, there should be 1 master device while the others should be its slaves. For my master device, I am using full-duplex master and I have disabled NSS and enabled the NSS pin as an GPIO OUTPUT pin. For my slave device, I am using full-duplex slave and have enabled NSS INPUT SIGNAL so it knows when it needs to read. Here are my problems:I have set the prescalar of the master device to 64 but am unable to set the prescalar of the slave device as there is no option to do so. I am unsure if this is a problem as I have seen an example where it is possible to set the prescalar for the slave device. However, am I unsure if it is necessary as the option disappears for me every time I set a device to slave.I am unsure if I need to change anything in the "clock configuration". I noticed that there is a option to enable PLLCLK for CSS but I am not sure if I need to do this or if leaving it set to HSI is ok.I am
When using SAI for I2S, STM32CubeIDE does not give you the option to choose Mono mode. It's only option is Stereo Mode. However, STM32 SAI HAL supports both SAI_STEREOMODE as well as SAI_MONOMODE, so I think this should be an option.
Hi everyone,Is there a preferred way of adding "core features" of FreeRTOS in a FreeRTOS application created by CubeMX? Do i have to add the respective files manually by copying them into my project?Unfortunately I found no built-in option in CubeMX.Example: I would like to add the coreJSON feature https://www.freertos.org/json/index.html Thanks for your help!
There seems to be a bug in the clock configuration for STM32H750XBHx. D1CPRE clock should be able to go up to 480MHz, but Cube won't take anything higher than 200MHz. HCLK is affected as well, can't set it to anything higher than 100MHzAndy
In the Device Configuration Tool it allows you to name pins. But it appears my program is not aware of those pin names and I cannot find any .h or .c file where the mapping is defined. The are only defined in a .ioc file, which the compiler does not use.I would have thought the Code Generator would have done that. So I have to make my own .h file with the mapping defined.
Hello,on a STM32G474 I use "Basic timers" (TIM6, TIM7), as well as a "General Purpose Timer"(TIM4). For the "Basic Timers" I setup I2C devices an then enable the "Basic Timer"-Interrupt by calling HAL_TIM_Base_Start_IT . That works and the HAL_TIM_PeriodElapsedCallback is not called before HAL_TIM_Base_Start_IT was called.I have the issue that I have calls of the HAL_TIM_PeriodElapsedCallback that come from TIM4 before I called HAL_TIM_Base_Start_IT, may I have the wrong config, or do these timers and the HAL work differently in that aspect?I admit I find ST's documentation confusing and the Timer-Parameters hard to understand, even the cookbook, so if there is alternative documentation with examples, it would be nice if you could share that as well.Thanks a lot in advance.Best regards, Seppeltronics
I noticed that some of the pins are configured in MX_GPIO_init() while others are not. They seem to have been configured somewhere else, so I'm not sure where to check if my pins were set properly. Also, some of the pin configurations are not updated after manually changing the pin outs. For example, SPI2_NSS_Pin, which is "#define SPI2_NSS_Pin GPIO_PIN_11" in main.h, is still configured as "GPIO_PIN_11" in MX_GPIO_init() despite the fact that I changed it to another pin in STM32CUBEMX.That said, I am quite confused on how the code generator works and how the pins are configured. Also, is it better to use stm32cubemx to generate code or would it be easier to manually configure everything from scratch? Thanks for the help
** Questions asked by @KSag **I am trying to migrate the keil project into stm32cube ide. startup file is generating errors. if I add the object files of main.o, stm32f1xx_hal_msp.c and stm32f1xx_it.c along with the startup file(startup_stmf105rbtx.s generated from STM32cubemx ide). it gives main undefined errors and LoopFillZerobss errors. Is it possible to fix these issues? Is it possible to migrate project from keil to stm32cubemx ide?I also try to add the statup file of keil project startup_stm32f105xc.s. upon compiling a lot of bad instruction error occur.
Hello everybody, I would need to use the HAL_I2C_Master_Transmit function in an ISR, in particular I would like to use it in the HAL_ADC_ConvCpltCallback function.I have seen that the HAL_I2C_Master_Transmit function calls HAL_GetTick() so I set the interrupt priority of Tima Base: Syste tick timer to a higher priority than all the others interrupts, but the HAL_ADC_ConvCpltCallback function stops when HAL_I2C_Master_Transmit is called.Can anyone help me?This is my NVIC configuration:
I am trying to get both PWM CH1 and PWM CH2 to fire independently with TIM15.However, both are enabled at the same time.Using CubeMX to generate initialization function:void MX_TIM15_Init(void) { /* USER CODE BEGIN TIM15_Init 0 */ /* USER CODE END TIM15_Init 0 */ TIM_MasterConfigTypeDef sMasterConfig = {0}; TIM_OC_InitTypeDef sConfigOC = {0}; TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; /* USER CODE BEGIN TIM15_Init 1 */ /* USER CODE END TIM15_Init 1 */ htim15.Instance = TIM15; htim15.Init.Prescaler = 3200-1; htim15.Init.CounterMode = TIM_COUNTERMODE_UP; htim15.Init.Period = 1500-1; htim15.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim15.Init.RepetitionCounter = 0; htim15.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; if (HAL_TIM_PWM_Init(&htim15) != HAL_OK) { Error_Handler(); } if (HAL_TIM_OnePulse_Init(&htim15, TIM_OPMODE_SINGLE) != HAL_OK) { Error_Handler(); } sMasterConfig.MasterOutputTrigg
In the release notes of CubeMX 6.3.0 it says:Added thread-safe locking support. It can be enabled or disabled in [Project manager]>[Project] Thread-safe SettingsIn the Project settings tab there's a new item: But it is not mentioned anywhere else. Can ST share documentation on this?
I cannot find anything in the code generation which allows for me to easily, being the operative word, create threads from the generated code. I have not been able to find any examples either to this nature.What is the best way to go from a standard "main" loop to a thread based generated program? Are there any examples? Every time I create a thread I get an unhappy compiler. There is a secret somewhere on how to create a true thread based program, isn't there?
The image shows my clock configuration for the STM32F469IIT. I want a 12MHz output from MCO2 and I found that I could theoretically achieve this using the PLLI2SCLK input. However, when I use this configuration, the device is not recognised by the PC via USB. I have also measured the signal using a scope and I seem to get a frequency of 6MHz. I can increase the clock speed on MCO2 to be "24MHz" and this will produce a 12MHz signal.I won't post any code just yet as this issue may be more fundamental, but let me know if more information is needed. I hope someone can explain why this doesn't work.I'm using an external 8MHz clock, USB FS but I am not using the I2S peripheral itself, only the clock divider and multiplexer.
I receive the following error trying to start the project: Error Downloading the following files: stm32cube_fw_u5_v102.zip (Target directory already exists). The zip file is in fact there. But I can't proceed any further.
As datasheet states (more than once) the LQFP64 package of the 446RE has 2 SAI blocks (both with SAI-A and SAI-B) and in the HAL driver/definitions stm32f446xx.h both are available, but I'm not able to select the 2nd SAI in Cube (it is not shown there !), so the pinout caanot be done ! Any idea what happens there ?
The fields ADC1.InjectedConvMode and ADC2.InjectedConvMode of a .ioc file could contain value "None" in the past. This allowed, at least for the F4 family of chips, to disable the JAUTO feature in the CR1 register of the ADC configuration.In new versions, the "Injected Conversion Mode" setting only has one valid option: "Auto Injected Mode".The result of this is that code generation no longer allows one to set AutoInjectedConv of the injected config struct to DISABLE.I believe this is a bug. Any chance this could be looked at?Thank you.
Hi,I can add "X-CUBE-AZRTOS-L5_V1.0.0_M33NS" via "Pinout & Configuration->Software packs->Select Components" successfully, but failed at add "X-CUBE-AZRTOS-L5_V1.0.0_M33S".Please check the attachment.Your example "Tx_SecureLEDToggle_TrustZone.ioc " in "x-cube-azrtos-l5_v1.0.0\Projects\STM32L562E-DK\Applications\ThreadX\Tx_SecureLEDToggle_TrustZone" can add both successfully.Please advise how to add "X-CUBE-AZRTOS-L5_V1.0.0_M33S" via the .ioc file.Thanks,QiZhang
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.