Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello.I'm experimenting with the Discovery board STM32F411E. The project is generated with CubeMX v5.0.0 + STM32F4-Package v1.23.0 and compiled with TrueStudio.After some experiments with timers, interrupts, LEDs and so on i tried to toggle an LED in a one-second period. I inserted the necessary values in the timer properties page. After compile and flash the LED toggled, but with a 24 second period instead of the wished 1-second period.After much google-research, trial and error i tried the HSI clock, instead of the default HSE clock. This finally produced the whished LED toggle period. After some further research i find out the "solution". The CubeMX property page for the RCC-module has as default setting for the HSE clock - "BYPASS clock source". After correcting this to "crystal/ceramic resonator", which i have on the STM32F411E-Discovery board - the combination HSE/PLL began to work and i got the right period of the LED-toggling.I'm not sure if the default setting "BYPASS..." is b
I am not sure if there is another place to submit this, some may have suggestions to solve this that I don't see.But these are the issues I have had with stm32cubeMX right out of the box, still haven't used it to a full extent, I was just testing the GUI.I am trying this now in my 720p 15.6" laptop. Next I am gonna test in a 24" 1080p screen. Everything being in the same window makes it so cluttered together.And so many time I try to minimize the peripheral configuration and end up with the image belowThen there are so many scroll bars in each window because they are so tiny!The independent windows were so useful for me. These aren't detachable.Plus they are hard to manage, the arrows (with the red ball draw) are so tiny that, as I said, I keep opening/closing stuff that I don't want. Once I closed the peripheral configuration window and it didn't open it again when I pressed a peripheral in "system view" - I had to maximize the peripheral config window manually.Btw, the shift+scroll w
Hello,Currently, with 4.26.1 version, it is not possible to use special functions in FreeRTOS about the Memory Protection Unit (MPU).I use the STM32F207VCT chipset with MPU functionality. Unfortunately, STM32CubeMX don't give me a way to use this functionality like, for example, MPU_xTaskCreateRestricted function.There is the function header, but no code present.It is too bad that have a important feature but I can't use it ...Thanks in advance for the information.Best regards.
Hello, As I am working on analog inputs I require ADC. STM32F334 Nucleo board has 12-bit ADC (2) with 21 channels, I am using ADC1 Channel 1.After programming without applying any input to the pin (PA0) I am getting some values through USART2.Can anybody help me out.Thanks in advance.
Dear STM32 community,I have an understanding problem with clock calculation for ADC unit.The ADC1 will be used with DMA by STM32F411 CPU.HSE_CLK = 8MHz, HCLK = 96 MHz, PCLK2 = HCLK/4 => 24MHz (for ADC clock).There are two ADC channel in use: 12 Bit, 480 sampling time => 12 + 480 = 492 clock per each channel.The ADC run in scan mode , continuous conversion mode. DMA interrupt is activated (DMA2_Stream0_IRQHandler)Therefore calculated ADC coversion period contain (1/24MHz) x 492 x 2 = 41usFor measuring purpose in DMA interrupt an LED is toggled. Surprisingly, if your meassuring time with osciloscope, the pulse or pause time contain 82us !!! (x2 from calculated time) Ok, in CubeMX settings for ADC DMA you can clear checkbox "use FiFo".In thhis case you will be surprised too, because on the osciloscope screen your will see the pulse time of 20,5us (1/2 from calculated time) Can anyone, please, explain this phenomenon ? What I do wrong ?Many thanks in advance !!!
I would like to add a wish list to STM32CubeMX. I recently installed the latest version 5.0.The user preferences menu has only the option send usage data. Can an option to change font and font size be added? Some of the pages have small fonts. Changing the display properties does not always provide an easily readable font size.
USSUE: RTC STM32F767 / STMCube verion 4.27.0 / STM32Cube FW_F7 V1.12.0Time and date are reset when the ARM is started.if I compare the code with the STM32F405 and the STM32F767, then I see a difference:the row "if(HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR0) != 0x32F2){" is missing by the stm32f767Have I not set the settings of cubeMX something correctly or is this a mistake in cubeMX ?-----------------------STM32F405----------------------------/* RTC init function */void MX_RTC_Init(void){ RTC_TimeTypeDef sTime; RTC_DateTypeDef sDate; /**Initialize RTC Only */ hrtc.Instance = RTC;if(HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR0) != 0x32F2){ hrtc.Init.HourFormat = RTC_HOURFORMAT_24; hrtc.Init.AsynchPrediv = 127; hrtc.Init.SynchPrediv = 255; hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; hrtc.Init.OutPutType = RTC_OUTPU
Hey guys,I have a very big problem. For a reason I don't understand, my CubeMX project which worked really fine and had no problem at all did now get the following error as I was regenerating code (I did this a hundreds of times without problem but since last thursday I get this error) : "The code has successfully been generated under ... but STUDIOproject generation have a problem".Since then my project is not working correctly anymore. For example my UART is not transmitting any data correctly but receiving. I tried to just save the project new and generate new code but the problem is the same and no TrueStudio project is generated.I noticed that STM made an update for CubeMX (5.00) and so I installed it and updated all the firmware packages and migrated my project in hope that this might correct the error but nothing changed.Now I don't know what to do. How do I get my project to work normal again? I also tried to make a new empty project with True Studio and just copy the generated
I have same trouble with this link --> https://community.st.com/s/question/0D50X00009XkYPHSA3/stm32cubemx-blank-new-project-page?t=1543518688382I have trouble with cubeMX when i try to create new project cannot see anything only white,blank and emty window, Java run time enviroment & cubeMX different version i tried but nothing.What am i do now? cannot use cubeMX anymore.
I started out with an example bare-metal project for the B-L475W-IOT1A Discovery board, that reads the HTS221 temperature and humidity, and LPS22HB pressure. Very straight forward. For ex, api to read temp: float HTS221_T_ReadTemp(uint16_t DeviceAddr). Only need to provide I2C ID to function call. NOTE: the api's came out of STM32LCube\STM_Discovery_STM32Cube\STM32Cube_FW_L4_V1.13.0\Projects\B-L475E-IOT01A\Examples\Lab2_PTH_FreeRTOS\Drivers\BSP\Components.Next, ran STM32CubeMX tool, created a new project set up to read same sensors (this process was not really straight forward - the GUI has weird nooks/crannies you need to dig thru to get the I2C set up). This project also included FreeRTOS. When CubeMX created the project, a new api was installed on my drive, C:\...\STM32Cube\Repository\STM32Cube_FW_L4_V1.13.0\Drivers\BSP\B-L475E-IOT01.This api is completely different than the one above. There is a huge gaping hole in the documentation for this new(?) api - there is no info on now to
Generated code not contains hcrc declaration.MX_CRC_Init func is empty (contains only comments)Сonditions:STM32L011D4 is used as mcucrc module in enabled in cube mxp.s.Please make version 4.x available for download from the site as an option.Forced beta testing can be very unpleasant.thank.
Pretty much the code is generated by Cube.I am reading 11 adc's some on adc1 and some on adc2. If I put the pins to 0 gnd i have consistent reading 0. All pins to 3.3v I have But reading in a looppa7,pa7,pa7,pa7,pa7,pa7pa7 4095pa7 4095pa7 4031pa7 4031pa7 4032the value varied from 4032 to 4095Now in a 3.3v/2 divisor varies from 1965 to 1929pa7 1929pa7 1929pa7 1930pa7 1950pa7 1965pa7 1964pa7 1965then all pins to 0 pa7 0 for gndpa1 0pa0 0pa5 0pa6 0pc0 0pc1 0pc2 0pc3 03.3v all pins reads different valuespa7 4028 for 3.3vpa1 4020pa0 4017pa5 4032pa6 4026pc0 4020pc1 4013pc2 4018pc3 4017I have a termistor and calc formula gives temp errors in orders of 10 degressMy adc init is for both adc's:static void myInit_Adc(ADC_HandleTypeDef* hadc) { hadc->Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; hadc->Init.Resolution = ADC_RESOLUTION_12B; hadc->Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc->Init.ScanConvMode = ADC_SCAN_DISABLE; hadc->Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc-&g
In version 4, it was selected for each peripheral under Project > Settings > Advanced SettingsIn version 5, I can't figure out where it is?!? The docs haven't been updated, they still show the version 4 screenshots.
There used to be a checkbox "use fifo" where i could chose duble buffer dma, but now there is no such function. (see screenshot) Why? Can anybody say me please, you havent this too?PS: New CubeMX 5.0.0 design is so terrible ((
Hello,I'm generating code for a project targeting the stm32767zi Nucleo. When I run the generated code, I encounter an assert_failed due to the PLLR not being configure to the correct value. If I look at the generated SystemClock_Config() function in main.c, there is no code generated to configure the PLLR, but there is code to configure other aspects of the PLL such as PLLM,Q, etc. So I believe that this is the cause of the failure.I'm using the default clock configuration, and using the latest version of CubeMX and the HAL.Is there a reason that the PLLR is not being configured? Is this a bug, or is there a setting somewhere I need to change?Thanks
I beleive that I have discovered a bug where CubeMX v4.27.0 generates incorrect code for GPIO initialisation.Here is the story:Pins have been preconfigured via Pin Configuration menu in the CubeMX app the following way:PC14 as Input with Pull-UpPC15 as Output (push-pull) with Low Initial StateHere is the code generated for MX_GPIO_Init() function with my comments added: /**/ LL_GPIO_ResetOutputPin(GPIOC, DO_5V_ENABLE_Pin); // DO_5V_ENABLE_Pin is set to be LOW here /* ... skipped ... */ /**/ GPIO_InitStruct.Pin = DI_5V_FUSE_STAT_Pin; GPIO_InitStruct.Mode = LL_GPIO_MODE_INPUT; GPIO_InitStruct.Pull = LL_GPIO_PULL_UP; LL_GPIO_Init(DI_5V_FUSE_STAT_GPIO_Port, &GPIO_InitStruct); /**/ GPIO_InitStruct.Pin = DO_5V_ENABLE_Pin; GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT; GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; LL_GPIO_Init(DO_5V_ENABLE_GPIO_Port, &GPIO_InitStruct); // DO_5V_ENABLE_Pin goes HIGH
Where to download the new version of STM32CubeMX release 4.27.0?Currently the official seems to only downloadSTM32CubeMX release 4.26.1
Posted on January 29, 2018 at 20:33Hello!I am using KEIL MDK 5 and it is compiling very very slow.CubeMX v4.24STM32CubeF4 v4.19.Any ideas ??ThanksSasha#cubemx-4.24 #keil-mdk5
I need to get data from 2/4 regular channels of ADC1 at every TIM4_CC4 event and save it with DMA. But always every time I receive ADC OVR error.When I start ADC with HAL_ADC_Start_DMA I receive 1 immediate conversion with transfer. Then I start TIM and with the fisrt event receive ADC_OVR, then conversion starts at every event, but DMA doesn't work.I've tried a lot of combinations of ADC and DMA settings (Cont./discont. modes, circular/normal, EOC at every conversion/at the whole conversion). I've also tried to configure DMA manually, then to start ADC with HAL_ADC_Start and HAL_ADC_Start_IT commands. But none worked.How to configure it right due my goal?
Each time I add __FPU_PRESENT and AMR_MATH_CM4 to symbols to get project compile properly, yet getting 30 warning about __FPU_PRESENT redefined.Project is made straight-forward: configure pins, select TrueStuido, pressing "generate code". Opening project in TrueStudio, build. Getting errors, adding __FPU_PRESENT and AMR_MATH_CM4 to symbols, building again with warnings.
Posted on December 19, 2016 at 22:17I'm using CubeMX 4.18 to generate my code for an STM32F407VG for the System Workbench using the arm-gcc. Works great, except for in socket.h it complains about redefinion of struct timeval.When I manually set&sharpdefine LWIP_TIMEVAL_PRIVATE 0in socket.hand do a&sharpinclude <sys/time.h>in cc.h as suggested, it builds.But of course every time I make changes to my CubeMX project, it gets overwritten and I have manually edit again.Please fix this in the next release!Otherwise great tool!Markus#code-generation #lwip #cubemx-bug #cube
Hello I'm testing implementation of sdcard / FatFS on F446.First I started with the example. It works.Now, I'm trying to implement a basic test app created from scratch with CubeMx.I configured a simple project with fatFS, SDIO, no DMA, no OS.int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_SDIO_SD_Init(); MX_FATFS_Init(); /* USER CODE BEGIN 2 */ testSD(); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER C
..
Hi all,I am using stm32l486 MCU and trying to use stmcube internal flash example code. As i see we have API "HAL_FLASH_Program" to program word or double word. Is it possible to write byte data by doing type casting and increasing the address by 1?Could anyone help on this.Thanks,John
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.