Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi, all.I hope anyone who can help me ~I now use STM32F401 & CubeMx to driver color sensor, the color sensor's timing requirements like this:I use master/slave Time to do this:master Tim1' CH1 to seed PWM(cycle is 500ns, high 200ns, low 300ns), and Tim1 also use for DMA to get data from Dout port(DMA cycle is 500ns too). And use slave Tim3 to control Tim1 to send 12 pulses at sample time. every 12 pulses finished, stop tim1&tim3, wait t2(4us)time, then start again.According to the above logic, I got this wave:From this picture, I unable to get 12 pulses stably(sometimes 12 times, sometimes 14 times and sometimes 10times).Thanks for everyone again.
Hi, first of all i had a problem downloading the firmware package for my STM32F107VC. The IDE downloaded by itself two package v1.8.0 and v1.8.4, unzipping the first one worked, but the second failed. I found out that the name of the folder inside the two archive was the same, so i extracted them manually and renamed them correctly.Now I created the project and made the IDE generate the files, (it was a test so i only selected the external clock in the .ioc file). Building return error:../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f107xc.h:150:10: fatal error: core_cm3.h: No such file or directoryI tried to do the same passages on another PC and it works fine (neither the problem of the firmware package shows up)I tried to unistall and reinstall three different versione of the IDE and all of them behave the same. Can somebody help me??Thanks in advance.
I am using STM32F427ZIT6 with both USART1 and USART3. Both USART ports are DMA enable. I use STM32CubeMX version 6.2.1 to generate the code.My problem is when USART3 is not transmitted, USART1 communication works as expected. When USART3 is transmitted, USART1 data is corrupted. My question is __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart1_tx); __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart3_tx);Would the same hdmatx cause my problems?
Using the STM32F303RE Nucleo, I need to put ADC1 in scan mode so I can read multiple channels. To do so, I need to set the 'Scan Conversion Mode' to 'Enabled' in the Configuration. However that is not an option in the CubeIDE. Only 'Disabled' is showing.The only other peripheral I have is the DAC1. How to Enable scan mode ?
..
CubeMX prevents the user from selecting certain (valid) CANFD bit timing configurations."Nominal Time Seg1" and "Nominal Time Seg2" are affected: These should have a minimum value of 1, but instead CubeMX only allows "2" as minimum value.This is problematic because it prevents the very common bit timing configuration 1 (Sync, fixed) + 6 ("Nominal Time Seg1") + 1 ("Nominal Time Seg2": This is where the problem shows).That configuration is highly desirable because it has the sample point at 87.5% which is desired by many higher level protocols and it also works out nicely for almost every common baudrate from a 8MHz clock just by changing the prescaler.Current workaround is to manually change this in the generated code; this works, but the changes will need to be re-done every time after running the code-generation which is super annoying.Affected (also all older version AFAIK):STMCubeMX: 6.3.0STMCubeIDE: 1.7.0Both using STM32Cube FW_H7 V1.9.0Occured with: STM32H730VBH (TFBGA100 Package)
Good day, I'm developing a remote control using a STM32G and I encounter some problems.For my code i need two timers:Timer1: it has a 1us overflow time and is not handled by any interruption, I just use it to count micro seconds for my delay_us function.Timer3: its configured with a interruption frequency of about 76.2kHz and it is handled by an interruption. This timer is used to modulate an output so it should only negate a variable and make an and operation between that variable and the output.For now I'm just testing whether the controller runs, and I'm just making a led blink:void setLED(uint8_t val) { HAL_GPIO_WritePin(OUT_LED_GPIO_Port, OUT_LED_Pin, !val); } while (1) { setLED(1); HAL_Delay(500); setLED(0); HAL_Delay(500); }I'm seeing some erratic behavior, with timer's 3 interruption on if I leave the interruption handler empty it works and the led blinks, but if I even make a variable assignment inside the interruption handler it stops working.The debugger h
My question says it all. I would like to use X-Cube-TOF1 package with X-Nucleo-53L0A1. I do not see that board mentioned in the list of options.
I'm using CubeMX to configure the BSP for an STM32F767. My clock tree has 54MHz going to I2C2, and when I set up I2C2 with "I2C Speed Frequency" of 400KHz, CubeMX outputs a timing register (I2C_TIMINGR) value of 0x6000030D. With a prescaler of 7 and 20 prescaled periods, that comes out to an actual ideal frequency of ~385KHz (which I've confirmed with a scope.)Problem is, I actually need the full bandwidth of a 400KHz bus. I manually edited the hi2c2.Init.Timing value in the CubeMX-generated main.c to 0x6000030C and compiled and ran it, and this value meets my requirements and works on my hardware. (I am aware this runs the bus at a slightly out-of-spec ~406KHz assuming ideal rise/fall time, but this is acceptable for the application.)My question is: how can I get CubeMX to either output this value for I2C2's timing register, or edit main.c in such a way that CubeMX won't override it when regenerating? I know about the user code sections, but hi2c2.Init.Timing is set and then consumed
CubeMX does no longer create the TIM1_UP_TIM10_IRQHandler in the stm32f4xx_it.c file after the timebase source have been changed to any timer and System tick timer 'Generate IRQ handler' and 'Call HAL handler' code generation has been disabled in NVIC.Follow these steps to reconstruct the issue:System in use: CubeIDE V1.7.0 with CubeMX V6.3.0Create new project, choose STM32F429ZI (LQPF144) as processor (possible this also occurs with other MCUs, I only tried with MCU stated above)Go to 'System Core' -> 'SYS' -> Change Timebase Source to 'TIM1' (Problem also occurs with TIM2, didn't test the other timers)Save and generate codeIn main.c, see that 'HAL_TIM_PeriodElapsedCallback' is generatedIn stm32f4xx_it.c, see that 'TIM1_UP_TIM10_IRQHandler' is generatedCopy .ioc file for later inspectionSwitch back to CubeMXGo to 'System Core' -> 'NVIC' -> 'Code generation'For 'System tick timer', diasble both chechboxes ('Generate IRQ handler' & 'Call HAL handler')Save and generate co
I'm using CubeMX 6.3.0 with a STM32H755 micro. The cube mx generated code assumes a HAL_PWREx_ConfigSupply( ) setting that is not correct for my hardware. Is there a place to configure this setting? I notice PWR is setup under Power and Thermal but it doesn't look like there is a spot to pick SMPS or LDO there.My hardware requires it set to HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY) and this is very important. When set for SMPS, which my hardware doesn't support, the core shuts down and not even the JTAG interface is working at that point. There is a work around to do a mass erase to recover but it isn't obvious.
Stm32g4xx_hal_adc.c line 644 adc_multi_skave macro returns null if adc3 is a parameter to the macro, when it should return pointer to adc4.
I’m currently working on a project where I write software for an STM32F072 that will control a couple of stepper motor drivers via PWM with a bit of precision. I’m therefore using TIM2 and TIM3 to control two separate PWM outputs where I can regulate the period time in microseconds.The board will also be connected to a CAN bus, mainly for receiving messages, but also to send some status messages. I’ve configured settings as far as possible using CubeMX and generated the project from there. After that I’ve coded in IAR EmbeddedWorkbench, which is our main coding environment for embedded.1. I started by getting the CAN bus up an running, very basic functionality, just by polling via HAL functions. I could receive messages and bounce back replies. Everything was fine.2. After that I set up TIM2 and TIM3 in CubeMX to use ‘Internal Clock’ as clock source and give PWM as output. I also setup the prescaler to get microsecond count for both timers.3. I’m using the autoreload-register to set th
STM32H743I-EVAL2Custom Bord(H723)CubeMX 6.3.0[ Datasheet ] (H743) DS12110 Rev8 (H723) DS13313 Rev2[ Reference manual ] H743 RM0433 Rev7 H723 RM0488 Rev2I using the H743EVAL and setting up a custom board.I’m setting up for a custom board with CubeMX.A problem occurred while setting “USB_PHY�? of “GPIO�?. I want to setting “medium�? to “maximum output setting�?However, this choice is “high�? or “very high�? only. The settings of CubeMX on the custom board are the same as those of H723.Therefore, I checked if the same result could be obtained with H743.As a result, I had only "high" or "very high" options. When I checked 517P of the H723 reference manual (RM0468),"Refer to the product data sheet for OSPEED Ry bits and VDD ranges and external load values."Since it is written, I checked 203P of the data sheet (DS13313). In the data sheet"USB function is guaranteed up to 2.7V.However, all USB electrical characteristics deteriorate in the voltage ra
I am using stm32l496, I want to use external memory CY62157EV30L, so I enable FMC in the CubeMx, but when I compile and run the project, a lot of current is consumed, about 4 mA, only with MX_FMC_Init(). how can I reduce this current?HCLK is 2 MHz.I attached FMC setting.Thanks.
I am finding the documentation to be very difficult to parse through and had a few questions: I have PWM set up using TIM2 and one on TIM1. There are no interrupts. I initialized it using CubeMX. Based on my understanding I expect that the output to be low until CCR1 then remain high until ARR but I seem to be having the opposite happening. How do I flip this?Where are example programs....I am new to this and have installed CubeMx but nowhere do I seem to be able to access basic examples for each target to be able to get a feel for how things work? (This is very frustrating)
STM32CubeIDE Version: 1.6.1 Build: 9958_20210326_1446 (UTC) (C) 2021 STMicroelectronics ALL RIGHTS RESERVED Device: NUCLEO-L412KB In Device Configuration Tool, Pinout & Configuration, GPIO Mode and Configuration, for a GPIO Output, what is the meaning of the "Fast Mode" field, and how is that related to "Maximum output speed"? Why is it n/a for port A pins but available to Enable/Disable for port B pins?
It is not realy a bug as the code works fine even if any comment is placed at a wrong line but comments should make life easier.Steps done to generate a main.c with STM32CubeIDE 1.7.0:New STM32 projectselected a NUCLEO-F44rRE board and chose default initializationon Clock Config tab for Code Generator set "Gen. peripheral init as a pair of c/h files..."Generated code of main.c at line 90ff: /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */What I think it should look like: /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ /* Infinite loop */ while (1) { /* USER CODE BEGIN WHILE */ /* USER CODE END WHILE */ } /* USER CODE BEGIN 3 */ /* USER CODE END 3 */
Hey guys.Im using MT29F1G08 as an external flash. I want to use fmc and cubemx as a code generator.I cant find some of he timings in the datasheet and Im a bit confused.We have a lot of setup time in the datasheet and i dont know which one is it.And i dont know the difference between common and attribute timings. There is no attribute and common timing in the datasheet.The wait time and HIZ time is not in the datasheet either.Thanks.
What's with this warning, and how do I avoid it (apart from commenting it out). Is there something that I'm doing in error in STM32CubeMX?I'm using Keil uVision V5.33.0.0 with an STM32F7 processor.
Hello ,i am using LDC1101 proximity sensor and it data ready interrupt on SPI_MISO pin.Can any one please tell to how to configure a pin both SPI_MISO and External interrupt.thanks
Hi ST Support,I have an STM32H743ZI and use SPI4 for the SPI communication.I have generated the Project from the Cube MX and configured an SPI clock of 50Mhz, But on the Logic analyzer captures, I can see only the clock of 25Mhz. We are trying to interface with some Slaves where STM32H743ZI is a DMA Master.It would be great if we get some code that can show us a Clock frequency of 50Mhz on the Logic analyzer.I am attaching the Cube MX file for reference.
Hola, i have been succesfully using DMA+ADC in stm32f072/f103/f105.ADC in Scan+Continuous mode. (15 channels enabled)But now im trying to use stm32f207 (NUCLEO-f207zg) , the DMA works one time(first channel) and dies. DMA interrupt IRQ is only triggered 2 times (mid transfer and transfer completed of the first adc channel) What am i missing , what is different in stm32f207?
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.