Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
After the firmware is updated, it gets executed normally. When I want to update the firmware, I send a start or an ampersand to the target board through Terminal program from my PC. My firmware on receipt of this character will enable the WDT and go into an infinite loop allowing the WDT to Reset the controller. This way there is no need to keep changing the jumper and resetting the controller manually while development is going on. This method has been working fine. However, after an update in CubeMX and associated packages for the controllers (stm32f103 and stm32f407), my target boards started resetting immediately after the application firmware is loaded. If I change the Boot0 pin (execute mode) and then apply power the application firmware works ok. This is not happening with old projects/code. How can I resolve this issue which is really bothering? Thank you.
When I use a formula to set the prescaler instead of a specific value, an unexpected macro will appear in the generated code.This problem does not appear on STM32CubeMX. Is this a BUG?
With CubeIDE 1.10.1, CubeMX 6.61 and CubeFW_F0 1.11.3 (but is also true with previous version up to 2 years old), the value you key in into the 'Low threshold value' field of the ADC is not recorded. Thats a GUI issue.Then In the adc.c file generated by Cube, value is badly specified.You have to manually edit adc.c to set required value and not forget to do it every time you regenerate the project with cubeMX.Otherwise, the two threshold are operational.
Hello,I am trying to do this tutorial that I found online for measuring an ADC continuously and displaying the voltage read on an LCD Display:https://www.youtube.com/watch?v=EbWOv_0Lp-UI am not using the same board though. He is using STM32F746G-DISCO. I am using the STM32H7B3I-EVAL board, which has a built in potentiometer connected to ADC1 (PA0_C). It measures the 3.3V and changes the measured voltage based on the potentiometer position. I am trying to enable the ADC according to that tutorial (Starting at time stamp 5:15), he enables Scan Conversion Mode, then goes to DMA Settings, adds ADC1, makes it circular, then enables DMA Continuous Requests and sets End of Conversion Mode to "EOC Flag at the end of all conversions". This is also how his menu looks: Mine, however, is different. I cannot enable Scan Conversion Mode. Only option is disabled. Additionally, there is no "DMA Continuous Request." Finally, the End of Conversion Selection menu only has "End of sequence of convers
hi,I need to have a code example for understand how have a keyboard and mouse in one project, can you help me please!
I'm bringing up a new project using STM32F733, with code generated from CubeMX version 6.6.1, with difficulty. Looking for suggestions.1) When I change the HAL timebase source from the default SysTick to something else, I've tried TIM2 and TIM10, then the call to HAL_Init() never returns, it runs out of stack. I've increased stack from the default 0x200 up to 0x2000, still runs out of stack. This is before any of my own code is called, only cube generated code.2) Leaving the HAL timebase source set to SysTick, it steps through ok with the debugger (Segger J-Link). If I add a tight for loop doing nothing but incrementing a variable, stepping through, looking at the call stack, things look normal for a short while. The variable looks like it increments about 1,500 times when I let it run and then the micro starts stepping through unexpected code. The call stack showing nothing but __iar_SB + 0x1fcfed56, example, the offset from __iar_SB increments as it runs.Where should I be looking? Ha
I seem to be having issues with a basic CubeMX generated setup on my G0 board. I seem to end in nowhere land after any timer interrupt takes place, when i stop the debugger i am somewhere around (0x1fff1xxx)Even if try to run a basic timer setup with CubeMX doing all the code generation for SysTick on timer 16. As soon as the TIM16 interrupt is enabled in HAL_Init after it setups the timer this happens a random number of few instructions afterwards.Everything looks OK on the surface. -Fresh CubeMX setup. Default interrupt table location.-Bootmode0 is pulled low with 10k resistor (Flash boot)-Interrupt table has .word TIM16_IRQHandler /* TIM16 */-I have void TIM16_IRQHandler(void) to catch itHAL Init seems to set up the clock for the periheral, settings, etc.What am i missing?
Scenario: the configuration for the RTOS has the defalt task generation set as weak If USBH_USE_OS is Enabled the call to MX_USB_HOST_Init() is put in the weak implementation of the CMSIS default thread, suggesting to do this in the real implementation.During MX_USB_HOST_Init() execution a thread is configured, but was not registered when the RTOS has started.This happens also when the defauilt task generator is set as Default, the generated template for the default task leads to a task function which initializes another task.
1) STM32CubeMX Version 4.26.1, STM32Cube V1.0, using firmware package STM32Cube MCU Package for STM32L4 Series 1.12.0 (22 May 2018)2) New Project, STM32L476RE, USB Device, class for FS IP Audio Device class, configure RCC + 3 GPIO's because of how my development board is setup and thats it.3) Generate TrueStudio project and open with Atollic TrueSTUDIO for STM32 v9.14) Run / Debug5) Windows enumerates the USB Audio Device6) Click the Mute button on the Windows volume on the taskbar to send a SET_CURRENT request to mute the device, packet can be verified on the Device Monitoring Studio7) The first SET_CURRENT request arrives at USBD_AUDIO_Setup. However, if you put a breakpoint there, USBD_AUDIO_Setup never gets called again, even when clicking the mute again. You can see on Device Monitoring Studio that down packets are still sent.It looks like calling USBD_CtlPrepareRx (because of needing to receive the SET_REQUEST data stage via USBD_AUDIO_EP0_RxReady) messes up the default control p
..
Hi All.!!!I am working on STM32F103 and using its 4-wire SPI for communication with slave whose data is 32bit and addr is 16bit.What I am trying to do is to write and read slave but i could not below is the settings that I have done in STM cube MX.Mode:- Full Duplex MasterData Size 16 bitPre scaler 32 selected.For write operationuint8 WriteBronco(uint32 Data,uint16 Addr){ uint32_t data[2]; data[0] = Addr; // multibyte write enabled data[1] = Data; //32bit of data slave HAL_GPIO_WritePin (GPIOB, GPIO_PIN_6, GPIO_PIN_RESET); // pull the cs pin low to enable the slave HAL_SPI_Transmit (&hspi1, data, 2, 100); // transmit the address and data HAL_GPIO_WritePin (GPIOB, GPIO_PIN_6, GPIO_PIN_SET); // pull the cs pin high to disable the slave return 0;}For Read operationvoid adxl_read (uint16_t address){ address = 0x8000; // address = 0x4000; // HAL_GPIO_WritePin (GPIOB, GPIO_PIN_6, GPIO_PIN_RESET); // pull the cs pin low to enable
Hello guys,First of all I want to say that I don't like and don't use HAL library. Use LL_Library instead as long as possible.Now what brings me here is that currently I am manually porting FreeRTOS to an STM32469NI MCU. This force me to use a different time base other than the Systick. I have realized that when using another timebase source ( example TIM1), STM32Cube MX autogenerated code always includes and initialize the HAL library in mainMy question: is there a workaround to get rid of the HAL library in this case and work exclusively with LL?Any help or suggestion would be greatly appreciated
Hi ,I am trying to install CubeMX on MAC M1 . I have been getting this error Exe path is: /Applications/SetupSTM32CubeMX-6.6.1.app/Contents/MacOs Search java from relative path ---- Checking java in /Applications/SetupSTM32CubeMX-6.6.1.app/Contents/MacOs/./jre/bin/java Checking java in /Applications/SetupSTM32CubeMX-6.6.1.app/Contents/MacOs/../jre/bin/java Checking java in /Applications/SetupSTM32CubeMX-6.6.1.app/Contents/MacOs/../../jre/bin/java Checking java in /Applications/SetupSTM32CubeMX-6.6.1.app/Contents/MacOs/../../../jre/bin/java Checking java in /Applications/SetupSTM32CubeMX-6.6.1.app/Contents/MacOs/./jre/Contents/Home/bin/java Checking java in /Applications/SetupSTM32CubeMX-6.6.1.app/Contents/MacOs/../jre/Contents/Home/bin/java Checking java in /Applications/SetupSTM32CubeMX-6.6.1.app/Contents/MacOs/../../jre/Contents/Home/bin/java Checking java in /Applications/SetupSTM32CubeMX-6.6.1.app/Contents/MacOs/../../../jre/Contents/Home/bin/java Please install Java JDK 11.0.10 or
Hello, I am working with the STM32F429-DISC1 development board. I am trying to read two adc from one channel. I can't read the code that I could read in the past. The code that worked in the morning is not working now. I may have changed a little. Please help me. My code is at below:#include "main.h"#include "cmsis_os.h"#include "usb_host.h"ADC_HandleTypeDef hadc1;DMA_HandleTypeDef hdma_adc1;CRC_HandleTypeDef hcrc;DMA2D_HandleTypeDef hdma2d;I2C_HandleTypeDef hi2c3;LTDC_HandleTypeDef hltdc;SPI_HandleTypeDef hspi5;TIM_HandleTypeDef htim1;UART_HandleTypeDef huart1;SDRAM_HandleTypeDef hsdram1;osThreadId defaultTaskHandle;void SystemClock_Config(void);static void MX_GPIO_Init(void);static void MX_DMA_Init(void);static void MX_CRC_Init(void);static void MX_DMA2D_Init(void);static void MX_FMC_Init(void);static void MX_I2C3_Init(void);static void MX_LTDC_Init(void);static void MX_SPI5_Init(void);static void MX_TIM1_Init(void);static void MX_USART1_UART_Init(void);static void MX_ADC1_Init(void)
HiJust updated in my PC STMCubeMx and STMCubeIDE for last version, and at this moment the functionality "Ctrl + Click" on a pin to see possible alternate pins is no longer working.This started to happen after updating CubeMX to v6.1.1 (previous version I think was 6.0) and it was working. In CubeIDE after last update also stopped working, well it is using the same version v6.1.1 of CubeMx...Also tested in my Work PC, and same issue after updating from v6.0 to v6.1.1 the alternate pins no longer show.Is this a Bug? Or could it be some other thing...Thank You
hello, i'm using stm32h745 mcu. i want to using SAI interface to use MEMS MIC, ADAU7002 .this sensor transmit 20bit PCM , 22050 hz data.i used CUBEMX and SAI & DMA setting is here. i can't select SAI interface data size 20bit, so i fixed HAL Driver to set datasize 20bit, but i don't receive 20bit data.i can receive only 16bit data. if i try to read 3bytes from buffer to read 20 bit data, but cracked data.i try to read 2bytes from buffer, i can read data and save 16bit pcm .wav file.i can't understand why i can read correct data and create .wav file .where is lefted 4bit per pcm data??i think that occured problem by dma.can i fixed dma setting change half word to 4byte words??if you think dma has no problem, please tell me what you think to solve this problem??thankyou.
I regenerated files with latest CubeMX and the generated code fails to compile. Regeneration was done to incorporate a few settings changes and the latest pack for this processor; previously code generated was OK. Errors below, and I've attached the IOC file and the offending "C" source generated by CubeMX.Any ideas what's going on?Anybody at STM?? @Nawres GHARBI ? @Sara BEN HADJ YAHYA ?Are you able to rebuild the project from the IOC file and reproduce this bug?Thanks!Best Regards, Davearm-none-eabi-gcc "../FATFS/Target/sd_diskio.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32F407xx -DSTM32_THREAD_SAFE_STRATEGY=5 -c -I../Core/Inc -I../Drivers/Custom -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../Drivers/CMSIS/Include -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../FATFS/Target -I../FATFS/App
I have succeed download the file from your website containing the installation fileI used a JRE to lunch the .exe file because the Application file don't run as explain in the Readme. I don't get any error message during the installation of the app. It was place in a file in the Application directory.The problems starts now. When I open the app the opening page open as you can see on the next pictureAnd then the application cut without any message. Do you have any idea of where it come ?Thank you in advanceNathan Gadisseux
Dear all,Could you tell me how to get some samples of STM32F103C8T6 in STM32CubeIDE?ThanksBoone
This morning, I installed cubemx and created a project for STM32F767IGT6 using J-link v2 to download the hex file to the board, but it didn't work. The project have included the LTDC, but I cannot get any signal(DCLK/VSYNC/HSYNC) from the test pads on PCB. It looks like the system clock(216MHz) doesn't work orsomething wrong. The board is good and works fine with my the other project hex files.
Hello dear,I will use "STM32H735RGV6" with an external crystal. In the datasheet, it is stated that "External oscillators: 4-50 MHz HSE". However, in CubeIde I cannot assign 50MHz since it is limited to 48MHz. Could you help with this issue?
I have trouble reading from 17th channel of STM32G0B1 MCU, which is PC4 pin.I have to read from channel 0 and 17. If I configure ADC for single channel it reads fine from Ch0, but cannot read from Ch17 (I got value from Ch0 instead). If I configure it to read from Ch0 and Ch17 using DMA, values in DMA array are not changing at all.I share cube-generated MX_ADC1_Init belowstatic void MX_ADC1_Init(void) { /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** 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_DIV2; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.ScanConvMode = ADC_SCAN_SEQ_FIXED; hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV; had
Id like to write a program to read 2 main frequencies, first one from velocity sensor and second from ignition coil. Both of them to build a car gauge dashboard, (there'll be a few more analog signals to read tough).Given that i come from atmega 328 that has only one input capture module, id like to know if the stm bluepill has the capacity to read both frequencies in the same chip... I'll need to read 2 frequencies, read analog signals, writing steps bits to update gauges and display data in tft 2.4'' module, so im lookinf for advice about selecting the right chipRegardsJulian
Using the STM32Cube with a STM32F4, I set the SYSCLK to 96MhzWhich generates this code RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE|RCC_OSCILLATORTYPE_LSE; RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; RCC_OscInitStruct.LSEState = RCC_LSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLM = 4; RCC_OscInitStruct.PLL.PLLN = 96; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 4;However, if I call HAL_RCC_GetSysClockFreq directly after SystemClock_Config() e.g. SystemClock_Config(); clkF = HAL_RCC_GetSysClockFreq();clkF is 72000000 i.e 72MhzI've checked that HSE_VALUE is correctly defined as 8000000So I made a copy of HAL_RCC_GetSysClockFreq() and added some debugging, which produced these values{uint32_t pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM;uint32_t plln = (RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RC
STM32CubeIDE can update fine, but STM32CubeMX cannot.No, it is not a typo in the title.
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.