Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Figure 1: QUADSPI General ParametersFigure 2: QSPI GPIO SettingsOS: Linux Mint 64-bit Tessa (19.1)IDE: cubeMX IDE 1.0.1code generator: cubeMX 5.2.1MCU: STM32H743ZIT6UDevBoard: NUCLEO-H743ZI2Target: FPGA (Not assembled, currently prototyping the driver. FPGA Interface is being design parallel to my work. All work here is for the Saleae timing analysis.)Using cubeMX to initialize my system, I am unable to get QSPI to give me valid output. Steps to setup:Configure the clock so that QSPI is driven by HCLK3 at 240MHz (Should be scaled down to 48MHz after pre-scaler).Enable QSPI for Bank 1 using the following parameters (Figure 1).Enable NVIC for QSPI Interrupts.Set GPIO to 'Very High' maximum output speed (Figure 2). Once the code has been generated, I do the following to set up the QSPI command:Then, once in the main while loop, I do the following where I will get blocked on that while loop. Debugger reports that halStatus is HAL_ERROR. Note: txBuff is a buffer of size BUFFER_SIZE filled w
Hi,In current CubeMX (I had this problem for F0) when adding an IRDA interface there are some UART_ defines which are fogotten to be replaced by their IRDA_ counterparts in stm32f0xx_hal_irda.c.This results in a compilation error of the file stm32f0xx_hal_irda.c. In case another UART is added to the project this error will not come up since the UART_ defines will be known (and are in fact same as IRDA_ defines).Example:in file "stm32f0xx_hal_irda.c.": UART_PARITY_NONE (unknown), -> should be IRDA_PARITY_NONE...
Dear,In CubeMx I have 3 statically allocated tasks wit stack size 256 words for each one, and also I have some Heap for dynamic allocation.My Question:Why in Cube I can not set TOTAL_HEAP_SIZE for example to 1000 (for my dynamic allocation pvPortMalloc) and stacks with size 256? The TOTAL_HEAP_SIZE should not affect to stack size is not it?Also you can check problem on short video there: https://www.youtube.com/watch?v=ookcCYnF4k4&feature=youtu.be If I know statically allocated memory, by definition, does not come out of the heap. The amount of memory available for use as the heap is the total memory available, minus statically allocated memory (minus the .data section, etc.).
Hello,There is an error during code generation in new version of FW. I wanted back to previous version, but the new STM32CubeMX is not backward compatible.There is a problem with "CFG_RTC_SYNCH_PRESCALER".So I can not generate a project.How to solve this problem?Thanks for Your help.
CubeMX 5.3.0STM32L4 1.14.0Selected other toolchains (GPDSC)
I'm trying to get a custom F405 board (open hardware from stm32duino) to run a simple HID example (https://notes.iopush.net/stm32-custom-usb-hid-step-by-step-2/). I got it running on an F103 and am trying to get it running on the F405, but it doesn't connect (neither when debugging via SWD, nor when not debugging and simply connecting the the PC). From what I see, it remains in the "USBD_STATE_SUSPENDED" state.Trying to figure out the differences, I noticed the Clock configuration screen between the F103 and F405 is different, and as such also the generated code. The F103 has these settingswhich generates code like this:void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; /** Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEPredivValue =
In projects generated by CubeMX, the release build is missing predefined preprocessor symbol NDEBUG. This is part of the C/C++ standard for decades (implicitly in the assert.h specification). Lots of existing code depends on this symbol to exclude debug code for release builds...There, an easy one to fix!Please confirm when someone has written a ticket for this,Thanks,Best Regards, Dave
Code generated for F429 using CubeMXIDE:USB CDC code in usb_cdc_if.c does not save/echo line coding info,nor respond (and ignore by default) to setCtrlLineState.This prevents some OS and common utilities (ie PuTTY) from connecting via CDC.For information on what's required, see:http://janaxelson.com/usb_virtual_com_port.htmor Jan's excellent book on USB.FYI, your competitors I've used recently to create products do this correctly;namely USB stacks from Silicon Labs, Freescale/NXP, and Microchip.Also, CubeMX needs to provide options and generate working code for:USB OTGmultiple USB classesAgain, you're behind your competitors here.Thanks,Best Regards, Dave
Two bugs; would appreciate any work-around...Use attached IOC file to replicate problems.1) Serious bug: I need to configure OTG FS with:device mode CDChost mode mass storageIf I select USB-OTG the generated setup routine MX_USB_OTG_FS_USB_Init is empty!There is no way to select which classes are to be supported for host and device!No usable code output!2) CubeMX GUI gets into weird state when switching between connectivity devices and will not show details for USB OTG. The image below shows Ethernet at top, USB OTG in the middle, with details for Ethernet at the bottom!Yikes!Help!Thanks,Best Regards, Dave
Hello. I use STM32CubeMX 5.3.0. When I want to update "STM32Cube MCU Package" i get "Error downloading files stm32cube_fw_fo_v1100.zip (MD5 file checksum is not good)" I think the problem is in downloading file. It is possible that STM32CubeMX downloads files from http://www.ebuc23.com/s3/. ?In out company we have website www.ebuc23.com blocked for: "Web Categories: Violence".It is possible that is problem why i can not download updates ?Thx Dano
I use STM32H743 and STM32CubeMX.ADC1 operates in ADC_CONVERSIONDATA_DMA_ONESHOT mode.Writes 512 samples to memory (address 0x24003F20).After recording, I process the data and run DMA again.But the data in the memory area does not change (as if frozen).If you simply restart the DMA in a loop (without reading them in the program), then the data is written and changed.Why? And what needs to be done so that the data changes and there is access to them?Souce codein main:HAL_ADC_Start_DMA(&hadc1, (uint32_t *)&arcanbuff0[2], 512); // start ADC DMAHAL_TIM_Base_Start(&htim8); // Start trigger for ADC samplerate 2MSPSwhile(1){ if(IsIntADCDMA == 1) { // wait DMA IsIntADCDMA = 0; HAL_ADC_Start_DMA(&hadc1, (uint32_t *)&arcanbuff0[0], 512); // restart DMA }}; Handle DMA (only copy data):void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc){ if(hadc->Instance == ADC1) { if(IsIntADCDMA == 0) { IsIntADCDMA = 1; uint32_t *Src = (uint32_t *)&arcanbuff0[0]; uint32_t *
code is attached below
It was my hope that cubeMX bugs are constantly fixed with new releases. Unfortunately...In the latest cubeMX generated code in FreeRTOSConfig.h file this is defined for os tick:#define xPortSysTickHandler SysTick_Handlerwhich makes it jump into HardFault as there is nothing checks whether scheduler started or not.WTF????It was working correctly in previous release.It was properly commented in FreeRTOSConfig.h:/* IMPORTANT: This define MUST be commented when used with STM32Cube firmware, to prevent overwriting SysTick_Handler defined within STM32Cube HAL */ /* #define xPortSysTickHandler SysTick_Handler */Then in stm32f4xx_it.c it was an ISR:void SysTick_Handler(void) { /* USER CODE BEGIN SysTick_IRQn 0 */ /* USER CODE END SysTick_IRQn 0 */ osSystickHandler(); /* USER CODE BEGIN SysTick_IRQn 1 */ /* USER CODE END SysTick_IRQn 1 */ }And finally needed check:void osSystickHandler(void) { #if (INCLUDE_xTaskGetSchedulerState == 1 ) if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_S
HelloI get errors when I generate a project with CMSIS_V2, but when I generate a project with CMSIS_V1 there are no such errors ...Build started: Project: GPS_tracker_os*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'Build target 'GPS_tracker_os'compiling main.c...linking...GPS_tracker_os\GPS_tracker_os.axf: Error: L6218E: Undefined symbol eTaskGetState (referred from cmsis_os2.o).GPS_tracker_os\GPS_tracker_os.axf: Error: L6218E: Undefined symbol uxTaskGetStackHighWaterMark (referred from cmsis_os2.o).GPS_tracker_os\GPS_tracker_os.axf: Error: L6218E: Undefined symbol uxTaskGetSystemState (referred from cmsis_os2.o).GPS_tracker_os\GPS_tracker_os.axf: Error: L6218E: Undefined symbol vTaskDelayUntil (referred from cmsis_os2.o).GPS_tracker_os\GPS_tracker_os.axf: Error: L6218E: Undefined symbol xQueueGetMutexHolder (referred from cmsis_os2.o).GPS_tracker_os\GPS_tracker_os.axf: Error: L6218E: Undefined symbol xTimerPendFunctionCallFromISR (referred from cms
I'm using an stm32l476G-DISCO and i want to transmit a message using the usart, the code compiled with no error using the CubeMX but the terminal is not showing anything.i configured pin P5 as TX_USART2 and P6 as RX_USART2is it a usb driver problem? or should I use a PL2303 USB to serial ?
Hi,As the title says really. What do the dividers I have highlighted in the screengrab correspond to in the processor? The options in those boxes are "/1" and "/8" and the names "Cortex Div" and "Cortex2 Div" appear when you hover the mouse over them.The closest I could find was that the Systick divider in the core processor programming manual describes how to calculate the reload value and has either a divide by 1 or 8 depending on whether the source clock is HCLK or external, respectfully. If that is the case then the values I use should always be "/1", correct? Because they are only ever sourced from the same clock as the CPU.Thanks.
I found others have similar issue, but they are trying to work around it instead of putting in a bug report: https://community.st.com/s/question/0D50X0000AAIEWbSQP/stm32cubemx-generated-sbrk-in-syscallsc-not-working-with-freertosI was trying to do a basic cubemx generated project with freeRTOS and libc standard lib enabled. While blinking led went without issue... as soon as I called `putchar()` or `printf()`, _sbrk() said there was a stack collision with the heap.Inspecting the position of the stack pointer relative to the heap pointer... the stack pointer is behind the heap pointer. But the stackpointer can be behind the libc heap, as the stackpointer would be pointing to the freeRTOS's task stack pointer instead for each task.My stopgap solution is to ignore the check (at my own risk) for now for a practice project.caddr_t _sbrk(int incr) { extern char end asm("end"); static char *heap_end; char *prev_heap_end; if (heap_end == 0) heap_end = &end; prev_heap_e
CUBE version5.3.0 (latest)
I'm using CubeMX for code generation.I configured my MCU (STM32F103VET6) for PWM generation on Timer 2 Channel 2 using DMA (DMA 1 channel 7), Memory to Peripherial; PWM data stored in array.All works good, if I fill data array programmatically.When I read data to array from SPI flash (I checked readed array in debugger, it contains right data), I cannot start PWM DMA.For firmware versions before 1.8.0 (I've checked 1.6.1 and 1.7.0) call of HAL_SPI_Transmit() changes hdma->State to HAL_DMA_STATE_RESET (so HAL_TIM_PWM_Start_DMA() will not start at all). Firmware versions 1.8.0 keeps hdma->State value HAL_DMA_STATE_READY after HAL_SPI_Transmit(), but HAL_TIM_PWM_Start_DMA() falls into HardFault.Unfortunately, cannot check SPI2 and SPI3, only SPI1 is available on board.Is it normal behaviour for this MCU?
STM32F030, CubeIDE generated skeleton, TIM14 is at LL. After running MX_TIM14_Init() , TIM14_IRQHandler immediately invoked. I put a breakpoint into TIM14 IT routine, start debug, then F6 step from the beginning of main(). Please see attached video. I inserted two lines to disable timer update interrupt and clear the UPDATE flag into "USER CODE BEGIN SysInit" block while strugling...still IT fired.And it is before reaching "LL_TIM_EnableCounter(TIM14);"
..
I have problem with comp6 and 7 I try to enable bout cannot enable comp1 -5 work without problem may be must enable clock for comp6-7
I am trying to re-generate my project code as part of continuous integration. So far, so good, but i noticed one problem with it.The current workflow in STM32CubeMX interactive mode looks like> load config <path_to_ioc>> generate codee <path_to_code>In my .ioc, there is `ProjectManager.HalAssertFull=true`, but it appears that the command line version of STM32CubeMX is not using that information.Furthermore, why do we need to manually specify `project couplefilesbyip 0`? This information is also clearly in the .ioc file as seen in `ProjectManager.CoupleFile=false`. It seems to be that STM32CubeMX command line is simply not leveraging all the information in the .ioc file.
Hi Everyone, I need the installer for STM32CubeMX 4.23. It is not on the download page anymore. How can I obtain the installer?Thanks,
Im using the controller STM32F303K8T6 ... Im not able to put my controller in debug mode...It goes Directly to run mode...please help me with this
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.