Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
using stm32mx stm32CubeIde
Hi,I have STM32H745ZI-Q Nucleo board. I have generated code using STM32CubeMX firmware version H7 1.5.0 (SW4STM32). I have enabled the LwIP Netconn and Ethernet for M7 core in STM32CubeMX. The issue is that it doesn't assign the IP address using DHCP and it always gets timed out. I have tested LwIP example given for STM32H743ZI on the STM32H743ZI Nucleo board which works fine and it assigns IP Address to the board. But, the code generated from STM32CubeMX for STM32H745ZI Nucleo is not working.Awaiting your response ASAP.
Hi,I working with an STM32L010 controller. I have a confusing issue with one of ADC channel.Here is the configuration:I using ADC channels 1, 3, 6 and Vrefint.Here is the ADC configuration:I forgot the clock configuration:My problem is while the voltage on CH3 increasing from 0 to about 2V the calculated VDD will started to increasing to 3.9V until the CH3 reach 2.4V. In above the VDD falling down to 3.3V. As I see Vrefint value changing. Like it would have a negative characteristic. I using formula from refmanual to convert raw values to mV. On VDD(a) pin I can see about 20mV changes during I increasing voltage on CH3. Could it cause this kind of ADC behavior?Thank you!Attila
After a fresh install of Fedora32 STM32CubeMX fails to start. The error msg is the same for a freshly installed 5.6.1 as for the previously installed 5.6.0 (which worked under Fedora31).Has anybody a clue how to proceed? The error message is a follows:[root@linux STM32CubeMX]# ./STM32CubeMX chdir /usr/local/STMicroelectronics/STM32Cube/STM32CubeMX/. current dir /usr/local/STMicroelectronics/STM32Cube/STM32CubeMX log4j user configuration file not found: /root/.stm32cubemx/log4j.properties Configure log4j with default settings from jar:file:/usr/local/STMicroelectronics/STM32Cube/STM32CubeMX/STM32CubeMX!/log4j/log4j.stm32cubemx.properties 2020-05-23 17:49:23,118 [INFO] MicroXplorer:570 - Detected Java Version = 1.8.0_252 Exception in thread "main" java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204) at java.awt.Window.<init>(Window.java:536) at java.awt.Frame.<init>(Frame.java:420) at java.awt.Frame.<init>(Frame.java
I tried this wayFile >> New >> STM32 Project From STM32CubeMX .ioc File.Selected the CubeMX .ioc fileClick FinishThen, CubeIDE says belowThis file has been generated with STM32CubeMX version '5.6.1'.Your current STM32CubeMX version is '5.6.0'.Please check for update: Help > Check for UpdatesI already installed CubeMX 5.6.1.When I tried "Check for Update", there are no any old version tools.I'm using the latest versions.Why CubeIDE detect wrong CubeMX version?How can I resolve it?
I'm using Nucleo-F767ZI, I am configuring the 25 kHz PWM signal on pin PD14, TIM4_CH3.I set up clock source HSI RC 16MHz, HCLK 216 MHz , APB1 peripheral clocks 54 MHz, TIM4 PSC = 0 ARR = 2159 CKD = No Division.As a result, I get PWM with a frequency of 50 kHz.When I change RCC_OscInitStruct.PLL.PLLM = 8; on RCC_OscInitStruct.PLL.PLLM = 16; in main.c file the frequency is correct 25 kHz.Is STM32CubeIDE generating bad code or did I make a mistake somewhere?Regards, Adam.
When the file stm32f3xx_hal_msp.c is created there is a missing line in function void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc) which enables the DMA clock - ( __HAL_RCC_DMA1_CLK_ENABLE(); The STM32CubeMX generates code that enables that clock in main.c in a separate function called MX_DMA_Init(); But this is to late to configure DMA and make it work. So with that extra line in HAL_ADC_MspInit everything is fine. Can you please fix that problem and offer an update so that everything works just out of the box.PS: I really appreciate the STM32CubeMX. It is very handy
All code paths depending on USE_SPI_CRC thus stay disabled and CRC checking is silently deactivated. There seems to be no place where USE_SPI_CRC can be defined without being deleted by the next automatic code generation. Is there a workaround or did I miss something?
Today cubemx deleted my repository. I launched it after about two weeks. Is it a bug or some cubemx function?
..
The error message like as:Core/Startup/startup_stm32f765vitx.o: In function `LoopFillZerobss':J:/STM32PRJ/CB_ENV/MS220_F765VI/VIDEOBOARD_V9A/20200520/Debug/../Core/Startup/startup_stm32f765vitx.s:97: undefined reference to `main'collect2.exe: error: ld returned 1 exit statusmake: *** [makefile:47: VideoBoard.elf] Error 1"make -j8 all" terminated with exit code 2. Build might be incomplete.How can I solve this problem?
I've been trying to achieve this for a while but I did not. When I import that framework, there is always conflict issues which related to cpp .h files which I include to my main. Even I rename main.c as .cpp, it doesn't work. Can you help me please ?
uint32_t REG_INIT[32];//// i dont think it is necessery that only for explanation #define MainAddr ((uint64_t)0x801FEC0)#define step 0x8#define BiasRefInit *(uint64_t *)(MainAddr+0*step)#define BiasRefFinal *(uint64_t *)(MainAddr+1*step)#define PowerRecycles *(uint64_t *)(MainAddr+2*step)#define REG_INIT[32] *(uint64_t *)(MainAddr+3*step)/// i wont to set a 32 regs range to "reg init".
The current STM32CubeMX package cannot generate proper code to initialize the VREFBUF in STM32H743 MCU. Modifications to HAL_MspInit() in stm32h7xx_hal_msp.c can fix this: Add "__HAL_RCC_VREF_CLK_ENABLE();" to user code section 0.In user code section 1,Add HAL_SYSCFG_VREFBUF_VoltageScalingConfig(0x00000020); // For 1.8V Vref+. orAdd HAL_SYSCFG_VREFBUF_VoltageScalingConfig(0x00000030); // For 1.5V Vref+. or ...
Hello,Fully new with OPAMP, configuration, I made some tries, and for me ther is an issue on the CubeMX code generator. If I want use an OPAMP with PGA with positive gain, I only need non inverting input and output. There is no way to specify this configuration and the generate code is always with inverting input conected to I/O :hopampX.Init.PgaConnect = OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0.then the right configuration in my case is PAMP_PGA_CONNECT_INVERTINGINPUT_NO.and I found no way to configure with this define. I need to modify by hand after code generation to have the expected behavior.May be I missed something but for me, there is a small mistake on the Opamp mode selection on CubeMX
I already reported this bug up at previous versions of the STM32H7 firmware.Now I'm using STM32CubeMX 5.6.1STM32CubeIDE 1.3.1 (arm-none-eabi-gcc 7.3.1)STM32Cube FW_H7 V1.7.0For those who find SDMMC not working, there still is an obvious bug , the way the code is generated by STM32CubeMX. If we look at the below code: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 = 2; hsd1.Init.TranceiverPresent = SDMMC_TRANSCEIVER_NOT_PRESENT; }We seem to be missing a few lines in there. EDIT: DTK mentioned this, because the Init code was missing the initialization functions, I also changed the bits to 8 because of thinking of eMMC I also use. But this was for SD-cards, where I use 4-bit sofar, a slip of the pen. Now Clive just did show that 8-b
I have tried to use STM32CubeMX and STM32CubeIDE to generate code. But in CubeIDE I can't create a SPI2_RX DMA Request. And in CubeMX I can't generate a Master Clock Output.So I wonder if there is any handcrafted code anyone written to get this working? and how to accomplish this.Is it intentional that stm32h7xx_hal_i2s_ex.c is empty? or is it that they just not had the time to do it?If CubeMX or CubeIDE doesn't work. Is there any similar chip I can use instead, or can look how it's configuered to get this started?
What is new in STM32CubeMX V5.6.0? • Added the support of new part numbers in the STM32L0 Series: STM32L071C(B-Z)Ux, STM32L081CZUx, STM32L072C(B-Z)Ux, STM32L082CZUx, STM32L073C(B-Z)Ux, STM32L083CZUx, and STM32L073CZUx • Added the support of the new 800 MHz capable part numbers in the STM32MP1 Series: STM32MP151DAD, STM32MP151FAD, STM32MP151DAC, STM32MP151FAC, STM3MP151DAB, STM32MP151FAB, STM32MP151DAA, STM32MP151FAA, STM32MP153DAD, STM32MP153FAD, STM32MP153DAC, STM32MP153FAC, STM32MP153DAB, STM32MP153FAB, STM32MP153DAA, STM32MP153FAA, STM32MP157DAD, STM32MP157FAD, STM32MP157DAC, STM32MP157FAC, STM32MP157DAB, STM32MP157FAB, STM32MP157DAA, and STM32MP157FAA • Added the support of new part numbers in the STM32WB Series: STM32WB30CEUx, STM32WB35CCUx, STM32WB35CCYx, STM32WB35CEUx and STM32WB35CEYx • Added the support of OCTOSPI muxed mode for the STM32H7 Series and STM32L4+ Series • Added the support of linker files for 1-Mbyte Flash part numbers for STM32H7Axxxxx microcontrollers • Added t
I'm using an usart driver with DMA and for some reason it doesn't work on L4 since 1.14.0 has been released. The RX buffer is always empty, DMA doesn't write anything here. I already wasted a lot of time on it and still unable to figure out what is the problem. The problem might be with overrun detection since ESP32 at startup uses different baudrate after it's initialization, but this is only my idea.Here is my driver: https://pastebin.com/uus3ZGinAny ideas?
Hello, I am using STM32L4R9AI (attached the reference manual) with 128GB NAND flash (MT29F128G08CFABBWP-12IT:B TR) (attached its datasheet).1- This is 8bit NAND flash and according to page 104 in the reference manual the last signal is NWAIT/INT which goes to R/B# according to page 9 in the NAND datasheet, should I connect R/B# from memory to FMC_NWAIT (PD6) or FMC_INT (PG7) ?2- what are common/attrtibute space timing (in HCLK cycles) for (setup, wait, hold, hi-z) ?Thanks in advance.
I've noticed an ongoing problem with CubeMX hanging up during code generation. I typically store projects in a Dropbox folder, mirrored onto their cloud service. While the folder is local, it's copied up to the Dropbox servers. Most times, when I try to generate code, CubeMX gets as far as starting to generate user code and set up the folder structure, then hangs forever. I have to invoke Task Manager (I'm on a Win7 box) to force-close the program. Running the same .ioc file in a local temp directory, it works fine. I've tried running CubeMX in administrator mode, with no improvement. This has been an ongoing problem for as long as I've been using CubeMX, at least three years.
This just looks like a comment but it seems a code outside these comment have different affect./* USER CODE BEGIN 1 *//* USER CODE END 1 */
Not a big bug but I wanted to mention it as it tripped me up.I am using STM32CubeMX 5.6.1 with IDE System Workbench 2.9.1I have found that when I setup SPI DMA synchronization the request number doesn't change from 1 when I generate the code or save, regardless of what the value is set too. These are my CubeMX SPI settingsSPI3.CLKPhase=SPI_PHASE_1EDGE SPI3.CRCCalculation=SPI_CRCCALCULATION_ENABLE SPI3.CRCLength=SPI_CRC_LENGTH_8BIT SPI3.DataSize=SPI_DATASIZE_8BIT SPI3.Direction=SPI_DIRECTION_2LINES SPI3.IPParameters=VirtualType,Mode,Direction,DataSize,CLKPhase,CRCCalculation,CRCLength SPI3.Mode=SPI_MODE_SLAVE SPI3.VirtualType=VM_SLAVEand these are my DMA settingsDma.Request0=SPI3_RX Dma.Request1=SPI3_TX Dma.RequestsNb=2 Dma.SPI3_RX.0.Direction=DMA_PERIPH_TO_MEMORY Dma.SPI3_RX.0.EventEnable=DISABLE Dma.SPI3_RX.0.Instance=DMA1_Channel1 Dma.SPI3_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE Dma.SPI3_RX.0.MemInc=DMA_MINC_ENABLE Dma.SPI3_RX.0.Mode=DMA_CIRCULAR Dma.SPI3_RX.0.PeriphDataAlignment=D
I am using the NUCLEO-H743ZI board. And I'm using STM32CubeIDE Version: 1.3.1Build: 6291_20200406_0752 (UTC) It has 3 16-bit ADCs, none of the three seem to have DMAContinuousRequests in the ADC settings:The DMA Settings tab is populated as follows:I would like to enable DMA for multichannel sampling from the ADC. I was able use polling and set up the ADC is discontinuous mode to sample from the 2 ADC channels I need to use. But I would rather use DMA.Anyone knows what the problem is?
Hi,I have found a bug in the instructions order in code generated by STM32CubeIDE v1.3.0 for the IWDG (STM32G474) with LL drivers. The code itself pads the watchdog outside the acceptance window as soon as the window is set to a value sufficiently far from the default.An example code for auto-generated function is:void MX_IWDG_Init(void) { LL_IWDG_Enable(IWDG); LL_IWDG_EnableWriteAccess(IWDG); LL_IWDG_SetPrescaler(IWDG, LL_IWDG_PRESCALER_4); LL_IWDG_SetWindow(IWDG, 100); LL_IWDG_SetReloadCounter(IWDG, 120); while (LL_IWDG_IsReady(IWDG) != 1) { } LL_IWDG_ReloadCounter(IWDG); }Explanation: Problematic here is what happens starting from the call to "LL_IWDG_SetWindow". LL_IWDG_SetWindow sets the window and also triggers a reload of the default value of 4095. The counter starts down-counting from 4095. A new reload value is set and awaited to be transferred. The call to "LL_IWDG_ReloadCounter" resets the counter to the new value, but actually does this outside the predefined windo
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.