Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi,I've generated a code using CubeMx 5.1.0On MCU STM32F103C8T (Blue pill)I want to controll PWM duty pulses thru DMA in Circular mode.I want to use circular buffer and on half transfer I want to update half of an array that I sent thru DMA to TIMer for PWM.I was able to setup TIM with PWM and DMA. Now PWM is generated according to my array of dutys. Now I want to update array content on half and full transfer bu I don't hnow how to setup callback on such event./* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the
Hi, I'm new with stm32 and I want to get a simple 1Hz square wave in a NUCLEO-F446RE using CubeMX for the initial config. The code is so simple that I can't figure out where the problem is.I just do: while (1) { HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_8); HAL_Delay(500); }and my GPIO configuration:static void MX_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOA, LD2_Pin|GPIO_PIN_8, GPIO_PIN_RESET); /*Configure GPIO pin : B1_Pin */ GPIO_InitStruct.Pin = B1_Pin; GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct); /*Configure GPIO pins : LD2_Pin PA8 */ GPIO_InitStruct.Pin = LD2_Pin|GPIO_PIN_8; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStru
STMcubeIDE 1.1.0: I'm using J-Link base to debug an STM32F413CG over SWD, which works well, but:The launch configuration dialog is missing the "Connect to running target" option:It should be included here like this:When I create a launch profile using the Segger tool the launch fails with an error "Error while launching command: gdb --version" when I try to debug, though the GDB path, application folder, ELF, etc. all appear to be set OK.@Markus GIRDLAND (ST Employee) - any idea how to work around these problems?I do need to connect to a running target...Please confirm the problem is understood and a ticket filed,Thanks,Best Regards, DavePS: If this isn't clear please see:https://mcuoneclipse.com/2015/03/20/attaching-to-a-running-target-with-segger-j-link-gdb-and-eclipse/
I am trying to make UART printf work with STM32F746-DISCO board.I tried running printf successfully with a default clock (whatever it is--I am not sure).I was doing it without using STM32CubeMX code generator.Now I found the code generator to be useful, I tried using the SystemClock_Config() function it generated for my board, which increases the clock speed up to 200MHz from my understanding.However, when I increase the clock speed with the SystemClock_Config() function, my printf does not work.Specifically, by using a logic analyzer, I figured that the baud rate becomes too fast, around 359689 (when I set it to 115200).I am attaching my main code below -- it is mostly just a stripped-down version of what STM32CubeMX gave me.If I comment out SystemClock_Config() from the code, the printf works fine.Can anyone help me with what is happening?Thank you
Using Segger j-link on F437. STM32CubeIDE Version: 1.1.0Build: 4551_20191014-1140 (UTC)OS: Windows 10, v.10.0, x86_64 / win32Java version: 1.8.0_202When debugging, clicking on the "Detach" icon hangs the IDE, and I have to then kill it with Task Manager. It does this typically after asking about scalability or similar as below (image captured prior killing IDE with task manager).The previous version had a different slightly less annoying bug:Please confirm you can reproduce and a ticket created,Thanks,Best Regards, Dave
I use the CubeMX command-line interface. Normally I put my script in a file, and run it like this:java -jar "C:\path\to\STM32CubeMX.exe" -q "C:\path\to\myscript.txt"But before doing that, I test the script commands one-by-one in the interactive mode. That means, I start up CubeMX with the command line interface and I can see visually what happens upon each command I enter:java -jar "C:\path\to\STM32CubeMX.exe" -iThe first command I usually issue then is to load an existing `ioc-file`:config load "C:\path\to\my_cubemx_proj.ioc"Then I issue the following command:set mode FREERTOS EnabledThis works. I can see immediately the green checkmark appearing next to `FREERTOS` in the Middleware section. The next thing I do is changing the Timebase Source in SYS from `SysTick` to `TIM1`:set mode SYS TIM1 Timebase SourceThis used to work in the previous CubeMX version. But in CubeMX5 it doesn't have any effect. The following image illustrates what happens:
Latest CubeMXIDE, code for F437. IOC to reproduce bugs attached. Here's the clock configuration:MCO2 required is 50MHz (for LAN8742A).Clock diagram shows PLLI2S is used to generate 50MHz from external 12MHz crystal /8,using *100 / 3, then PLLI2SCLK is fed to MCO.Bug #1The generated SystemClock_Config routine contains the following:PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_PLLI2S; PeriphClkInitStruct.PLLI2S.PLLI2SN = 100; PeriphClkInitStruct.PLLI2S.PLLI2SR = 3; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)Unfortunately, with these inputs, the HAL_RCCEx_PeriphCLKConfig routine does absolutely nothing!PLLI2S is neither set up nor enabled. The idiotic function just happily returns HAL_OK after doing nothing.Bug #2:The CubeMX graphic does not show the output frequency of PLLI2S or PLLCLKBug #3:Updating the PLL2IS x value to 200 fails to update the derived values.@Markus GIRDLAND - Can you please confirm you can reproduce all 3 bugs and corresponding t
Hallo everyone, I have an Olimex Dev Board with the STM32F407ZGT6 on it. I implemented the USB Middleware as VCP (Virtual COM Port) and it worked perfectly well on my windows 7 PC. Since I migrated to windows 10 I've been unable to connect to the VCP. NB: I have not modified my code. I will be thankful if someone could hint me on how to solve this problem. Thanks in advance.
ADC DMA is not working after generated code using with stm32cubemx for keil. please suggest any way to work ADC DMA.
Hi,I'm trying to configure an I2C interface in SMBUS mode on an STM32F4. However, cubemx (v5.3.0) does not correctly generate code (missing include and file about HAL SMBUS, missing handle, empty init function, etc.). Compilation failed.Is there a plan to fix it?Thanks
I'm using the STM32Cube IDE latest version. The code generated for I2C doesn't work, hangs waiting for flag. My device is STM32F407VE, I'm using I2C1 (PB6, PB7). The slave sends a valid ACK but then everything goes quite with SDA SCL both low. I confirm that the slave and connection setup works fine with MCU from another vendor. I've read almost every solution I could find on this forum but so far nothing worked for me. I do not have much experience with ST products.
I try to get the Rx Can interrupt to work, but I only can receive Can-messages in polling mode not with any interrupt.Here is my Code from main.cCAN_FilterTypeDef sFilterConfig; sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK; sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT; sFilterConfig.FilterIdHigh = 0x0000; sFilterConfig.FilterIdLow = 0x0000; sFilterConfig.FilterMaskIdHigh = 0x0000; sFilterConfig.FilterMaskIdLow = 0x0000; sFilterConfig.FilterFIFOAssignment = CAN_FILTER_FIFO0; sFilterConfig.FilterActivation = ENABLE; sFilterConfig.FilterBank = 0; CAN_TxHeaderTypeDef MYtXhEADER; MYtXhEADER.DLC = 2; MYtXhEADER.ExtId = 0x0; MYtXhEADER.StdId = 0x666; MYtXhEADER.IDE = CAN_ID_STD; MYtXhEADER.RTR = CAN_RTR_DATA; CAN_RxHeaderTypeDef MyRxHeader; uint8_t data[10]; uint32_t testttt =0; CAN_FIFOMailBox_TypeDef MailBox[1]; __HAL_RCC_CAN1_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); HAL_CAN_RegisterCallb
I am using SW4STM32 as the toolchain in STM32CubeMX v5.4.0. The MCU I am using is the STM32H7 series.In order to transfer Toolchain to STM32CubeIDE v.1.1.0, like SW4STM32, STM32CubeIDE was selected in Toolchain and GENERATE CODE button was pressed.However, only Core and Driver codes are generated regardless of whether or not Generate Under Root is checked. Project files (.project, .cproject), .ld files, and startup code are not generated.As with other similar questions ( https://community.st.com/s/question/0D50X0000AlcdBSSQY/stm32cubeide-cant-compile-stm32cubemx-520-projects-for-stm32cubeide?t=1571237740185 ), I uninstalled Java and MX and did a fresh install with the 64-bit version, but that didn't fix the problem.Please let me know if there is a solution.
When I attemptC:\Users\Scott\AppData\Local\Temp\ccZvyICB.s:211: Error: selected processor does not support `dsb 0xF' in Thumb modeC:\Users\Scott\AppData\Local\Temp\ccZvyICB.s:222: Error: selected processor does not support `isb 0xF' in Thumb modeC:\Users\Scott\AppData\Local\Temp\ccZvyICB.s:266: Error: selected processor does not support `dsb 0xF' in Thumb modeC:\Users\Scott\AppData\Local\Temp\ccZvyICB.s:281: Error: selected processor does not support `dsb 0xF' in Thumb modeC:\Users\Scott\AppData\Local\Temp\ccZvyICB.s:749: Error: selected processor does not support `dsb 0xF' in Thumb modeC:\Users\Scott\AppData\Local\Temp\ccZvyICB.s:760: Error: selected processor does not support `isb 0xF' in Thumb modeC:\Users\Scott\AppData\Local\Temp\ccZvyICB.s:797: Error: selected processor does not support `dmb 0xF' in Thumb modeDrivers/STM32G0xx_HAL_Driver/Src/subdir.mk:69: recipe for target 'Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_cortex.o' failedmake: *** [Drivers/STM32G0xx_HAL_Driver/Src/s
I downloaded all 5 mx-cube libraries for the stm32h7 series, but it says "MCU not supported" when I clip on stm32745zi?it works with other H series.what am I missing?
Hi,When I generate a project and choose toolchain as Makefile, it only included libraries associated with setup configuration. I would like to add DSP and arm math libraries to the project. I found 'STM32F4xx_DSP_StdPeriph_Lib_V1.8.0' but I am not sure how to add to the project libraries.
..
When I build my project it doesn't generate the .elf file in the debug directory. Because of this I can't debug the program. Does anyone know how I can fix this?Thanks!
Dear experts,I'm new to M7 (and H7) so pardon me for a stupid question.Created a new .ioc file in CubeMX 5.3.0 for STM32H753 EVAL2 board.There I can select debug interface as JTAG 5 pins or Serial wire (at least).From the Cube report file, in Serial Wire mode it uses 2 pins: PA14 SWCLKPA13 SWDIOWhere is SWO ? It should be PB3, but the report file does not mention it.In JTAG 5 pins mode it uses PA14, PA15, PA13, PB3, PB4.Now, in a .ioc file made by my hardware engineer, for a custom board with same MCU,the debug mode is JTAG 5 pins.But I cannot change it to Serial wire or even to Disabled.Any reason, why?None of these 5 pins are hmm... pinned.Serial mode uses two (or three?) of JTAG 5 pins, so it should be possible to reuse them?Is the JTAG config locked by some other component or mode selection?Or can it be a "feature" of the Cube ?We both have Cube 5.3.0 on Linux, Ubuntu,Thanks in advancePavel A.
I am creating a project for the STM32F767ZI. The Fatfs library WITHOUT freeRTOS works well. When I include freeRTOS in my project, I cannot get past mounting the disk:retSD = f_mount(&SDFatFS, (TCHAR const*) SDPath, 1);From reading the forums, I found that some people have found a solution for certain MCUs. Is there a configuration where I can use FREERTOS + FATFS + SDIO + DMA?My cubemx settings are as follows: I am using SDIO 1 bit bus and DMA for RX and TX. I have set my stack size to 0x2000, my heap size to 0x4000. I'm using FatFS with the DMA template.
I have a fundamental situation I think we all in the ST Community should be concerned about and want to make better as we go forward. I have been working with the STM32 solution for about 4 months now, and making it my mission to learn and stay with ST and this product. This is important as ST has so many products that complement the STM32 solution.Nevertheless, here is what I am up against. I own several STM32 Eval boards, the one I want to talk about today is the STM32F303RE, and it is a good choice as it is a very simple board. My four months have allowed me to learn many things I want to share. I'm actually semi-stuck at this moment and here is my story, maybe we can all learn something.I have a project where I needed to create a system that can calculate external input frequency and duty-cycle using this STM32F303RE board. This is a simple design; there are actual examples in the STM32CubeF3 Repository. The tools I used are the STM32CubeMX and STM32CubeIDE. I would like to say a l
In DMA mode, the DMA block does copying. In normal mode the controller does the copying. So which block does copy in interrupt mode?
Posted on April 11, 2018 at 13:31Dear Cube team,Just noticed that STM32CubeMX v 4.24.0 does not show correct mode for GPIOs in pinout view (the main nice GUI).On the picture below, PF14 is GPIO input with pullup, but the flyout tip shows as (no mode).Would like to see the actual mode there.Thanks,-- pavel#stm32f4 #cubemx-v4.24
Hello,I'm using a STM32H743ZI on a custom designed board. I configured all 4 SAIs as pairs "Master with Master Clock Output" and "Synchronous Slave". I then wanted to add DMA requests, which worked fine for SAI1 to SAI3 under the DMA tab. When I added the requests for SAI4 under BDMA everything was fine until i closed and reopened the file. CubeMX as well as CubeIDE show an empty error msg and doesn't open the file.This is my system:Ubuntu 18.04.1 (all the latest updates as of today)STM32CubeMX V5.2.0STM32CubeIDE V1.0.0 Build 2872_20190423-2033(UTC)STM32CubeMX 5.2.0.201904230831STM32Cube MCU Package for STM32H7 Series V1.4.0This is not a one off. I have tried the following things:created a new project and configured everything (It broke.)created a new project and configured everything except the BDMA (It worked.)created a new project and configured everything step by step. After every step I closed CubeMX and tried to open it again. It worked until after I configured the BDMA. Then it
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.