Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I have been using STM32CubeIDE (Version: 1.10.1) with STM32CubeMX - STM32 Device Configuration Tool Version: 6.6.1-RC2.But when i do some modification in device configuration and then try to generate the code , it does not generate the code. But when i create the new project using same device configuration file (project.ioc) it does generate the code with new changes , just popup appears for less than a second saying "device configuration Tool updating code .." and then just disappears without updating the code or any error.What could be the problem?
i was tried with cubemx 5.4 and fw 1.5.0 ethernet ping is successfully done. but now im trying to ping with cubemx 6.11.1 and FW 1.10.0 but im not able ping . so anybody done with cubemx 6.1.0 and above version. plzz help me on this.... thanks,,,,,,, and main problem when i use 6.1.0 version and above . i need to tap the run button 3 to 5 times to start the execute the program . and another one after some time control goes to hard fault.
Hi,I am trying to configure DHCP on my STM32F746G-DISCO board, but despite several attempts and even after setting up my DHCP server or configuring my router, I can't get a dynamic IP for my MCU. I can make it work with a static IP, but I would like to test it with a dynamic IP.The project is simple: just a UDP server. I am not using an OS, just a small piece of code that initializes and waits for the DHCP to assign an IP before continuing. However, on Wireshark, I see that the DHCP Discover message is sent repeatedly without ever receiving a DHCP Offer or DHCP Request response.There aren't even any tutorials showing how to configure just DHCP on CubeMX, I can't find anything on this topic. Most examples use a static IP.This is the part of the code where we notice the DHCP anomaly void udpServer_init(void) { struct udp_pcb *upcb; upcb = udp_new(); if (upcb == NULL) { printf("Error creating UDP PCB!\n"); return; } if (udp_bind(upcb, IP_ADDR_ANY, 5555) !
I have a project using nucleo stm32f334.With the way it worksI get the adc value from the 12 bit potentiometer. Then I want to display the value using dac and see the frequency, period and voltage from the oscilloscope.I want the magnitude of the frequency of 200 hz with the period as fast as possible. I have used the formula to find the frequency, namelyf = CLOCK SOURCE / ((prescaler + 1) x (period + 1)) but the frequency produced by the oscilloscope is not 200 hz but between 35-40 hz.I want to ask, are there other factors that I should calculate, or is there any influence from the clock configuration on stm32cubeMX?Please help me, I really need your direction and help. Does anyone have a sample program or can anyone explain how I do it so that I don't get lost working on it? Thank you.
hallocan anyone help me about how to program for convert adc to dac ini stm32cubemx with program keil U5, have you guys can help to bring me an example of your code or tips and step. i used the potentiometer for adc value and the value used to dac and read by osciloscopcan you help me? thanks
I use stm32CubeMX to generate usb code with HSI clock.Though I can config with usb clock to 48MHz, But stm32CubeMX software display there is clock issue as below:So I wonder can stm32f103cbt6 usb work under HSI clock?
Hi, I'm new to STM32. I have an STM32L4RI-DISCO board and would like to add an IR receiver and decode RC5 signals. According to AN4834, IRTIM can be used on STM32L4. I have downloaded en.x-cube-irremote.zip.Firstly it is not recognized by Cube MX.Secondly when I look inside the zip file there is no mention of STM32L4, only STMM32F0 or3 and STM32GHow do I access the IRTIM functionality on STM32L4?On the disco board I have set up TM3 to have a PWM Input on CH2, which I have allocated to PA7 which in turn appears on CN17 Pin 1. Is this OK?apologies if this is obvious, but it is not to me.Thanks in advance, Lance.
Hello, I wanted to create a project using X-CUBE-AI and the quantized tiny yolo from model zoo (which is dedicated for deployment on STM32H747-DISCO) : https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/object_detection/pretrained_models/tiny_yolo_v2/ST_pretrainedmodel_public_dataset/coco_2017_person/tiny_yolo_v2_224Though, when I analyze the project through CubeMX, the flash that will be used is too high, despite the model being already quantized.Is there a proper way to reduce the flash?I attached the .ioc file of my project.
Dear ST-Developer,i have discovered that the ADC configuration with cube takes only effect for one channel instead of every enabled channel. In the reference Manual and HAL_ADC documentation i have understood that each ADC-Channel of the G474 series are independent configurable from each other. The problem is that the generated code by CubeMX seems to not generate the configuration for enabled channels.I have expected that ALL ADC-Configuration for ALL enabled channels will be generated. So i faced the problem that only one ADC-Channel (independent from ADC1,2,3,4 and 5) was configured correctly.I don't want to check the code generated by CubeMX for correctness because then i can write it by my own from scratch. And i don't want to insert missing channel configuration by hand because i use CubeMX that should do it for me. Thats why we use it to simplify our work. Our code uses the Hardware configurations from CubeMX as single point of truth so that we have only t
Hi all.Working with the Pack Creator I know I can create a header file that contains defines that are editable in the CubeMX view.I'd like to know if it's possible to have a pack that places defines in the project settings instead of a header file?
Hi all!I'm creating a pack using the Pack Creator. My pack uses a BSP template. I've tried creating projects using the pack for a selection of boards. In all cases bar the H5 the pack template successfully creates the right #include for the platform BSP.I.e. the template uses:#include "${BoardName}_bus.h"That creates the following:BoardCreated #includeL4 Nucleo32 #include "stm32l4xx_nucleo_bus.h"H7 Nucleo144#include "stm32h7xx_nucleo_bus.h"H5 Discovery Kit#include "stm32h573i_dk_bus.h"U5 IoT Discovery Kit#include "b_u585i_iot02a_bus.h The correct #include for the H5 board should be:"stm32h573i_discovery_conf.h" Short of writing an exception within my template specifically for the H5 discovery board, is there a mistake I'm making with using `BoardName` for my template?Second question, are there other boards for which `BoardName` wouldn't work?
Hello,because of my mistake, I had assigned the same label for two different pins within CubeMX 6.12. It seems, CubeMX recognize this, but send not an error oder a warning message about it. What happen, CubeMX is attaching the port- and pinname to the label and renames silent the label. I would expect, a message box is popping up to select, what should be done, e.g.a. accept the new name or rejectb. correct the label with a new own namec. inform about the things, went in the backgroundSection from main.h #define P5VINT_ENAE7_Pin GPIO_PIN_7 #define P5VINT_ENAE7_GPIO_Port GPIOE #define P5VINT_ENA_Pin GPIO_PIN_13 #define P5VINT_ENA_GPIO_Port GPIOI Thanks,Jan
Hello I'm using STM32F030C8.I'm writing the code because I want to use the internal flash memory like rom.Is there a set number of times I can write in internal flash memory? If there is a related document, I would like to see it.Thank you.
I have been using STM32F767zi for long time.I know some of the pin feature by heart.Last night, I enabled ETH for a moment and to see what pin it uses, then I disable it and then all the chaos happened.I realized that many of frequently used USART 2, USART3, UART5, USART6 pins are changed to other pins....I was like okay, then I follow to wire to the new pins, but it doesn't work well... weird.Then I reopen some other project of the same board and realized that using same UART5, for exmaple, and saw that it was not that 2 pins as TX and RX.... Why and how is this happen?I tried to open new project, then pick the same Nucleo board, and immediately see the UART5 again, and WTF! another new pin?no, UART5 was all the while PB12 and PB13, USART3 is at PB10,PB11.... I have been using it for a year plus... Where come this PCx PDx and other new allocation that not actually working??Is this new update bug?Can anyone help how to load the really true working .ioc back?
Hello,I have an issue when compiling a makefile from a project using an STM32H5 and ThreadX with NetXduo library.this is the error i have:make[1]: arm-none-eabi-gcc: Argument list too long make[1]: *** [Makefile:1119: build/TheBlueBox-v2_AZURE_NS.elf] Error 127 make[1]: Leaving directory '/cygdrive/c/TheBlueBox/FW/TheBlueBox_AZURE/TheBlueBox-v2_AZURE/Makefile/NonSecure' make: *** [Makefile:88: all] Error 2Argument list is too long... What should i do?i am compiling with windows 10.I've attached the makefile (All has been generated with cubemx 6.12.0).
Hi STM community!I am new to STM microcontrollers and this is my first post :)My board is a tiny STM42F401CCU6 @ 84MHz. I already have made some first steps with CubeMX and CubeIDE, after I came from the arduino IDE which was a bit too simple (reading some ADC voltages, driving a 7-Segment Display with a shift register).Some day I want connect a HIFI DAC (PCM5102) to I2S in order to build a VA synthesizer, using a Half Duplex DMA Transfer. This is a challange for me, because there are so many things to configure in the CubeMX. The programming itself seems quite smooth thanks to the CubeIDE and CMSIS.My current focus is the clock configuration, which is quite complex stuff for MC beginners. I have watched some YouTube vids from STM but I wondered, why the I2S clock ist so high, when I configure a I2S interface. At any sample rates it is set to 96MHz, even when the HCLK is only 16MHz.I thought, the I2S clock is calculated by sampleRate*BitsPerSample*Channels, which is only 128kHz on
Could not install ARM CMSIS 6.12.0 Pack Got these errors
Hi all!Thanks again for the help so far.Just another question, is it possible (or normal?) when creating a pack to have it insert snippets of code into main.c just like the code snippets that get inserted by the cube when you change peripherals etc? Thanks again.
Hello,I am developing on the STM32H7A3ZGT and I am trying to use both OCTOSPI instances that are on the microcontrollerI am able to use both of them separately (only initialising one instance) but when I do both the initialization only the last initialised instance is working fine.I get no errors codes from any function on the first octospi instance that is initialised, but the data that I receive are all "0".If I switch the init order it switches the instance that is working.I am working on cube MX V6.6.1 but I tried generating a new project on the latest version and I get the same resultTank you for your help,Best regardsAugustin
im using stm32h743zi2 ethernet with udp . so i generated code and running in Kiel and ping working fine . BUT how to i re initialize lwip at run time .i tried to reinitialize at run time but the ping is stopping after reinitializing . any body does this , hope u suggest me . thanks
hello,I have a very simple question, I have asked a FAE,but not solved.I am using STM32CubeMX to config a project. I used an external 32.768khz crystal. I want to set the RTC clock to the external crystal. below is my setting.I think i have enabled HSE and LSE. the clock to RTC is fixed to LSI RC, but I want to use LSE, not LSI, how can I setting? Thanks,dqsh06
Hi, My one microsecond timer configured by CubeMx running on NUCLEO-C031C6 (STM32C031C6) is 3 times slower than it should be. The code is attached below. the call "delay_us(60000000);" takes 3+ minutes to complete - it should be done in one minute. The LL timer (TIM3) init and interrupt code is generated by CubeMx..The system clock is 48 MHZ in CubeMx. How to fix it? Thanks, Rong void MX_TIM3_Init(void) { LL_TIM_InitTypeDef TIM_InitStruct = {0}; /* Peripheral clock enable */ LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM3); /* TIM3 interrupt Init */ NVIC_SetPriority(TIM3_IRQn, 0); NVIC_EnableIRQ(TIM3_IRQn); /* USER CODE BEGIN TIM3_Init 1 */ /* USER CODE END TIM3_Init 1 */ TIM_InitStruct.Prescaler = 0; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_InitStruct.Autoreload = 48; TIM_InitStruct.ClockDi
This bug is present in ethernetif.c files for lwIP generated by CubeMX for the newer reworked ETH drivers.ProblemWhen using CMSIS-RTOSv2, CubeMX generates the following code in the function low_level_output(): pbuf_ref(p); HAL_ETH_Transmit_IT(&heth, &TxConfig); while(osSemaphoreAcquire(TxPktSemaphore, TIME_WAITING_FOR_INPUT)!=osOK) { } HAL_ETH_ReleaseTxPacket(&heth); The TxPktSemaphore is initialized with both maximum and (wrongly) initial count of 1. Because the semaphore count is already 1, the osSemaphoreAcquire() call returns immediately and the HAL_ETH_ReleaseTxPacket() can release the packet before the transmission has actually been completed. While the Tx complete interrupt happens after the osSemaphoreAcquire() call, the code continues running in this crippled mode, corrupting packets and driver/stack state.When the Tx complete interrupt happens before the osSemaphoreAcquire() call, the osSemaphoreRelease() call in the Tx complete interrupt tries to increa
I have to interface an STM32U575 microcontroller with a very specialized SPI device for which the market offers no alternatives. According to the spec sheet, the chip select must be pulsed between every 2 bytes, for at least 154 ns. I have to read 34 bytes from this chip every 50 us. The chip allows a maximum SPI clock rate of 24 MHz.Although I can talk to the device, the SPI controller seems to not be fast enough.SPI Configuration:However, in my attempts to speed these transactions up, I have ditched the HAL for writing/reading to/from the SPI peripheral during the steady state program flow.SPI functions:void SPIM3_INIT(int len) { SPI3->CFG2 &= ~SPI_CFG2_COMM; // Set Full-Duplex mode SPI3->CR2 = len >> 1; // Set the number of data at current transfer SPI3->CR1 |= 1; // enable } int8_t SPIM3_XFER(uint8_t *txb, uint8_t *rxb, int len) { volatile uint16_t *ptxdr_16bits = (volatile uint16_t *)&SPI3->TXDR; volatile uint16_t *prxdr_16bits = (volatile uin
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.