Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I have a project, I'm in the Pinout & Configuration view, everything is serene and placid.I click on a pin and CubeMX brings up a list of possible configurations for a pin. Meanwhile, in the background, I hear my fans spin up. Click over to Activity Monitor and STM32CubeMX is taking 113% (1 full thread plus a bit) of CPU time.Click away and everything is sunshine and unicorns again.How did I notice this? Well I came in this morning to find my laptop with 7% left on the battery. My laptop will actually pull more current than the charger can provide, then it starts drawing down the battery. Eventually it will shut itself down. That's a lot of power being sucked to display a text picker. (no I don't need to bike shed or shave yaks about Apple's charging system)Just thought you'd like to know.Andrei from The Great White North
Hi i have configured adc in continuos mode as you can se in MX_ADC1_Init(); but it only reads on first time when goes in the while(1) and never reads new value.void MX_ADC1_Init(void) { ADC_ChannelConfTypeDef sConfig = {0}; /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.ScanConvMode = DISABLE; hadc1.Init.ContinuousConvMode = ENABLE; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.NbrOfConversion = 1; hadc1.Init.DMAContinuousRequests = DISABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; if (HAL_ADC_Init(&hadc1) != HAL_OK) { Error_Handler(); } /** Configure for the selected ADC regular channel its c
I am trying to send and receive data through the USB port on the Nucleo-L476RG, but am unable to see any data on Putty.I generated an initialization code with STM32CubeMX enabling the following:RCCUSB_OTGUSB_DEVICESYS Serial wireRTC clock sourceLet CubeMX solve the clock conflicts - the USB got a 48MHz signalIn the generated code, I included usbd_cdc_if.h in main.cinside while(1) - I am sending a uint8_t array ising CDC_Transmit() based on this https://microtechnics.ru/en/stm32cube-and-usb-virtual-com-port-2/I am able to see the COM port and am trying to read the data on Putty but I see nothing.I am attaching the CubeMX fileAm I missing something ?
I find it very impractical that CubeMX keeps regenerating entire project to update clock tree and/or adjust settings for some hw units and in so doing deletes the original folder by renaming it and creating a new one. It's job should be to aid in hal and similar abstractions and to assist in the configuration. Having it stay away from the main application and usercode would be good.Maybe an option to use it in library-mode would work?The way it is now, it is only useful for the initial setup and after that it is a huge liability and incompatible with version control systems like GIT...
Hello to everyone,I designed a paddle box control card with STM32F042K4T6. The scheme and information of the design are as follows.Power and Signal Button Read CodeI don't use Touch Sensing. I only use the TSC unit. I process the value I read later. I didn't add that part to avoid confusion. I leave it to the test when there is no blender. I encounter this error in 2 out of every 10 cards every 10-12 hours.If you have a useful idea or criticism, please tell me. I love the STMicroelectronics family.Thank you.
Im using an STM32L452RE dev. board. and Im trying to set an interrupt once after some time. I have the following subroutines.#define MICROSECOND_TICK_COUNT 80 //clock = 80 MHZ i.e. 1e-6/(1/80e6)=80 TIM_HandleTypeDef myTimer; void setupTimer(void){ TIM_ClockConfigTypeDef sClockSourceConfig = {0}; TIM_MasterConfigTypeDef sMasterConfig = {0}; myTimer.Instance = TIM2; myTimer.Init.Prescaler =0; myTimer.Init.CounterMode = TIM_COUNTERMODE_UP; myTimer.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; myTimer.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; myTimer.Init.Period = 0; HAL_TIM_Base_Init(&myTimer); sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; HAL_TIM_ConfigClockSource(&myTimer, &sClockSourceConfig) sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; HAL_TIMEx_MasterConfigSynchronization(&myTimer, &sMasterConfig) != HAL_OK } void startTimer(uint32_t microseco
I had STM32CubeMX 5.3 V and updated it to 5.6V.Now I can't generate MDK ToolChain. Please help
I'm new to CubeMX and I've read over the documentation a couple of times (speed reading) but can't quite find an answer.My question is what files exactly are generated by the tool and what files are simply copied?Is it the case that all files we find under the Drivers folder are copied files? copied from the installed HAL reference files?Is it the case that ONLY truly generated files are put into the Src/Inc folders (that is the Src/Inc folders in the project root).For example I see a file named stm32f4xx_hal_msp.c in the project root Src folder, if this was generated by CubeMX why does it not have some kind of comment block saying "generated by CubeMX v x.y.x on March 8 2020 at 1:01 pm as part of project ABC..." and so on? Or is it a copy of a HAL file that was customized in some way by CubeMX as part of the code generation phase?I'm trying hard to figure what code is generated for a project and what code is simply consumed as is.Thx
We made software and PCB for our product based on STM32F071V8.After erratic behavior I narrowed down the problem that in current CUBE MX for STM32F0there is no support for this chip. It compiles but macros are missing for USART3 and USART4 (peripherals not present in default STM32F071xB). It is disappointing that CubeMX does not generate any warning during code generation.But problem is that clock sources are set to unknown state baudrates and timers settings does not use correct values for clock in calckulations ...What is procedure to get support for this device?This can cause huge delay in product release.Is there any fast track?I can write macros myself based on similarity with other devices but it is time consuming and unprofessional.
The latest version of Cube and software packages for F4 does not have a board description for the STM32F439 Nucleo-144 board.Thanks,Andrei from The Great White North.
..
Hi, I've got some code that uses both ADC1 and ADC3 that I've generated with STM32CubeMX. For both ADCs I want to use interrupts. With this configuration however the CubeMX auto-generated code adds 2 separate calls to the same HAL interrupt handler, one for each ADC. How can I differentiate which ADC interrupt has actually triggered? And is there a way to get STM32CubeMX to not add multiple calls to the same function? This functionality that it's created if left in could definitely make the code misbehave. I noticed a similar thing with the auto-generated code for handling GPIO external interrupts on lines 5 to 15: if you have interrupts enabled for GPIOs on pins 5, 6 and 7, the interrupt service function will call the HAL interrupt handler 3 times, once for each GPIO even if only one interrupt has occurred.Thanks,Doug Burrell
Please can any one help me,,,,its important for me...my project is pending due to this problem.Thanks in advanced.
Hi,why it's not possible to copy all neccessary library files to my generated project for CubeIDE?When I choose EWARM, then this is possible...Thanks a lot,Ben
i would request imen to let us know if the STM32CubeMx 5.5.0 is addressing all the issues regarding SD card interface using SDMMC ( 4 bits and DMA). Since the code generated from CubeMX 5.5.0 for nucleo-l476rg BOARD for SD card interface does not work.if i program the same board with STM32Cube_FW_L4_V1.15.0\Projects\STM32L476G-EVAL\Applications\FatFs\FatFs_uSD_Standalone , the SD card can be written as well as read.
Dear customers, We are facing a little issue during the migration from the 5.4.0 to the 5.5.0 (reported in this thread https://community.st.com/s/question/0D50X0000BxzZV9SQM/upgraded-stm32cubemx-from-540-to-550-and-now-it-fails-to-generate-the-project)To avoid having this problem, please migrate to the 5.5.0 by installing the new package from the web and not updating from the tool. Best regards,STM32CubeMX team
Hi,Like indicated, I'm using CubeMX (5.6.0) to create dual CMSIS_V2 project for nucleo-H755.The code is generated for the selected IDE with no issues (I assume), but what is unclear to me is how much work is left for me to do?I have selected TIM6 for CM7 and TIM7 for CM4 as their timebase. I have tried running the code, but it just hangs. I debugged CM7 and it ends in a TIM6 interrupt and is stuck in there (there is no while(1) loop there though).Is there a proper guide on what are the missing the steps between a working project and the skeleton that comes from CubeMX? ( youtube series on FreeRTOS does not seem to touch this topic:https://www.youtube.com/watch?v=hbRcjzmv0wY&list=PLnMKNibPkDnFeFV4eBfDQ9e5IrGL_dx1QI know there are examples in the FW package, the problem is, I don't think they are generated with CubeMX, even though the project itself is done for a nucleo board. They seem to be hand-written.It would be better to generate even the examples using CubeMX, to give the idea
I have once activated CSS in CubeMX and then the LSE can no longer be started. Even if I change CSS to disabled in CubeMX and recompile this does not change. I have to say that I have buffered the RTC / LSE with a CAP at VBatt so it does not loose power even at main power down. Only if I remove the CAP I can reactivate the LSE.So are there any know problems with CSS activated for LSE? And is there a way do disable CSS after it was once activated even at battery powered systems?ThanksMB
Hi I'm trying to configure my project with STM32CubeIde 1.2.1I want to use ADC1 to perform temperature and vrefint measurement. So I configure my adc & dma :But I'm not enable in cube to enable the DMA option, only disable is possible. If I enable the flag manually in the code generated, I don't have any problem and the code is running as expected (continuous acquisition of both channel with an interrupt each time the acquisition is complete) Is there a reason this option isn't possible in cube ?
Currently I've got on DC->DC by PWM output voltage from 0.9 to 2.5 volt but I need a regulatable voltage by PWM from 0 to 2.5 volts.
Hi,There is a bug in the STM32CubeMX when you change the "Clock Prescaler" of the ADC for the STM32G474RE mcu.When i change the value of ADC1, the "Clock Prescaler" values of all the other ADC are also changed to the same value of ADC1.regards
I have followed scrupulously every step, but Tera Term (or other terminal emulators) does not show any sign of communication with my board. The board is a Discovery STM32F334C8T6: the tutorial is tailored to a Nucleo board, but the pinout of the two boards are very similar.Select Debug Serial Wire under SYS: done;Select Internal Clock as clock source under TIM2 peripheral: done;Select the Asynchronous mode for the USART2 peripheral: done;Check that the signals are properly assigned on pins: USART_RX on PA3, TCK on PA14, USART_TX on PA2, USART_RX on PA3, done. Although they have slightly different names on my board (for example, pin PA14 is assigned to SYS_JTCK-SWCLK, and pin PA13 is assigned to SYS_JTMS-SWDIO).Go to the Clock Configuration tab and leave the configuration untouched: done. The Nucleo-L073RZ has a default clock of 2.097 MHz: i have selected 2 MHz on mine to match as closely as possible.From the Configuration tab, click USART2 to open the peripheral Parameter Settings wind
Hi,Im developing a logger device with STM32F411CC processor. I use the latest Cube, DFP, Keil etc. I would like to use the USB to log datas to a flash drive. I developed a prototype software with an older usb msc host example and it worked on a F4 discovery board. Now i have the new hardware and i have several questions. The newest generated code's strusture was a bit different from the old one but it won't the problem. If i use an I2C device to enable the OTG voltage the cube won't generate it in the init section(won't call the MX_I2C1_Init()). - OK FIXEDMisstyped comment on MX_DriverVbusFS() function, 1 parameter should have a meaning to switch on the USB voltage. The code call it at start with TRUE(1) parameter, but comment shows: 1 : VBUS Inactive - OK FIXEDAfter several tries to log the file (what was worked in the old code with 407) something is changed in the USBH_UserProcess() function. Now its only working when i call the writeout in READY state (at the past worked in START st
We are designing a system where stm32f7xx will communicate with smart battery via SMBUS protocol, The code is as followsif (HAL_SMBUS_Init(&hsmbus1) != HAL_OK){ Error_Handler(); } if (HAL_SMBUS_Init(&hsmbus1) != HAL_OK) { Error_Handler(); } if (HAL_SMBUS_IsDeviceReady(&hsmbus1, (uint16_t)DEV_ADDRESS<<1, 2, 2) != HAL_OK){ Error_Handler(); } uint8_t buffertx[2] = {0,0}; uint8_t bufferrx[10] = {0x0}; buffertx[0] = 0x21; ret = HAL_SMBUS_Master_Transmit_IT(&hsmbus1, (uint16_t)DEV_ADDRESS << 1, &buffertx[0], 1, SMBUS_OTHER_FRAME_NO_PEC); if (ret != HAL_OK) { Error_Handler(); } uint32_t test; do{ test = HAL_SMBUS_GetState(&hsmbus1); }while(test != HAL_SMBUS_STATE_READY); ret = HAL_SMBUS_Master_Receive_IT(&hsmbus1,(uint16_t)DEV_ADDRESS<<1, &bufferrx[1], 7, SMBUS_LAST_FRAME_NO_PEC); if(ret != HAL_OK){ Error_Handler(); } uint32_t retval; d
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.