Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I am using STM32L476VG and I want to write files to a SD card. In CubeMX I generate code for the FAT File System with the following settings:Moreover, I am using FreeRTOS with static memory allocation only:However, I have found two issues so far:Since the reentrancy setting for FATFS configuration must be enabled when using FreeRTOS, the function ff_cre_syncobj(...) (syscall.c) is called inside f_mount(...) (ff.c). However, since this function does not allocate memory dynamically oder statically, the execution fails. I think the lineosSemaphoreDef(...);is not correct, since there is a dedicated macro osSemaphoreStaticDef(...);for the static definition of a semaphore. Is this a bug in ff_cre_syncobj(...)?2. For some reason the setting for USE_LFN (Use Long Filename) is not accepted for code generation. This setting is disabled in CubeMX (see first screenshot) but in ffconf_template.h the lines#define _USE_LFN 3 #define _MAX_LFN 255 /* The _USE_LFN switches the support of long file name
HiI'm using STM32F407G-DISC1 with STM32F4DIS-BB expansion card for SD card. I've selected SDIO, SD1 bit and middleware as FatFs in cubeMX. I've generated code and added my custom code as follows:#include "main.h" #include "fatfs.h" SD_HandleTypeDef hsd; FATFS SDFatFs; /* File system object for SD card logical drive */ FIL MyFile; /* File object */ char SDPath[4]; /* SD card logical drive path */ static uint8_t buffer[_MAX_SS]; /* a work buffer for the f_mkfs() */ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_SDIO_SD_Init(void); int main(void) { volatile FRESULT res; /* FatFs function common result code */ uint32_t byteswritten, bytesread; /* File write/read counts */ uint8_t wtext[] = "This is STM32 working with FatFs"; /* File write buffer */ HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_SDIO_SD_Init(); MX_FATFS_Init(); /*##-1- Link the micro SD disk I/O driver ##################################*/ re
Hope someone that has implemented FreeRTOS with USB can provide advice on what specifically needs to be changed in the USB Host code to allow the USB to operate in the RTOS environment. I have USB functioning on the target board, without FreeRTOS. When I bring in FreeRTOS (using CubeMX), it breaks and does not operate. I have any user code protected in the delimited sections. I also tried in tick/tickless modes.Why would CubeMX add in FreeRTOS and break the perfectly good USB interface? I guess CubeMX will give you one or the other, not both.Any suggestions or references would be appreciated, thanks!
Bug Report STMCubeMX 5.1.0The tool does not load the timer configuration correctly when channel 4 is "Input Capture direct mode" and channel 3 is "Input Capture indirect mode".After loading a configuration with these settings channel 3 is set to "Disable". Happens for timer 2 and timer 3.Attached are a ioc file and a screenshot from the timer configuration.
Discovery with stm32F407VG t.Hi, after update I cant find place where I can configure usb/device/cdc like "BAUDRATE, STOP BITS"In old version this was under "configure" usb hf. Now I can only see 12Mhz full speed.Other issue I have is minor, CubeMX have problems with resolvinhg clocks. It really try to go as slow as possible. Setting usb clock to 48Mhz (ok), but system clock is forced to 25Mhz ... have to set all clocks manually.Thanks :)
Because SysTick_Handler is defined as weak, with a fallback to Default_Handler (which is a infinite while loop), this means the first time your program generates a SysTick event, your program crashes.Hopefully this post prevents others from wasting an hour trying to figure out why their code doesn't run.This is with STM32CubeMX v5.1.0 and the latest STM32F4 firmware.How the hell does this stuff make it through QA? Does ST even have QA?
Hello,I installed new STM32CubeMX 5.0.0 on my computer under Ubuntu 18.04. After start, program doesn't response. When I run it via terminal, I have some warns and error. Below I attached logs from terminal. After the last line of this log, I don't have even program GUI. Does anyone had problem like that?Thanks in advicePaweł2018-11-24 19:33:27,745 [INFO] MicroXplorer:486 - Detected Java Version = 11.0.1 2018-11-24 19:33:27,751 [INFO] ApplicationProperties:181 - Using Application install path: /home/pawel/STM32CubeMX 2018-11-24 19:33:27,762 [INFO] DbMcusXml:68 - Set database path to: /home/pawel/STM32CubeMX//db//mcu/ 2018-11-24 19:33:27,767 [INFO] DbBoardsPdsc:54 - Set plugin database path to: /home/pawel/STM32CubeMX//db//plugins/boardmanager/ 2018-11-24 19:33:27,768 [INFO] DbMcus:262 - Set plugin images path to: /home/pawel/STM32CubeMX//db//plugins/mcufinder/images/ 2018-11-24 19:33:27,768 [INFO] DbBoards:224 - Set plugin images path to: /home/pawel/STM32CubeMX//db//plugins/mcufinder/
Hello,I' using Windows 7/64, True Studio 9.2, STM32CubeMX 5.1 on a Nucleo-F401RE.After code generation (GENERATE CODE) , if I try to open the project from Cube, the system answers : " Please Install TrueStudio Toolchain to open the project". I solved the problem by an import . There are no errors, but where I do configurate the system?Many thanks.Luciano
Hello, I am using CubeMX 4.26.1:The bug scenario is the following:Configure project for FreeRTOS usage,Configure SysTick as system clock,Everything works, as FreeRTOS in port.c uses the SYstick registers.Change the timer to other one than Systick in sys configuration,FreeRTOS generated code will not be aware of that and still configure Systick registers at init instead of ie. TIM2.All port.c file is coded around systick, with hardcoded addressing and no overrides available to change the timer. Can anyone confirm or had a similar problem?
Hello:I was having a load of issues getting my receive DMA functioning. My device is an STM32L433CCU. I am also using ADC1 DMA, which was functioning good.To determine what might be going on, I started a fresh copy of Cube configurator, and started with LPUART and continued to check it's DMA functioning with each peripheral I added back in and checked. All other functions such as PWM worked OK. Before I started on the other function that uses DMA, the ADC, I made a copy of the CubeMX file. I then set up 5 ADC channels, and the DMA. The ADC DMA worked as expected. I then tested the UART and the receive DMA stopped transferring data. That is, the callback functions, but no data is coming in the buffer.I commented out these 3 lines:MX_ADC1_Init();HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED);HAL_ADC_Start_DMA(&hadc1, (uint32_t*)dmaBuffer, DMA_SIZE); and the receive DMA was working OK. I checked the adc.c and uart.c files, they are using different DMA channels and requ
I’ve attached a screen capture of the STCubeMX HRTIME configuration , and one showing the HETIME PWM capture on the oscilloscope. The code generation created a global interrupt for HRTIME. I inserted a toggle call �? HAL_GPIO_TogglePin(GPIOB,5);�? as the first statement in the interrupt to see if the interrupt gets triggered. It does not get triggered, and I have verified the pin toggle works when inserted in the while(1) loop. pTimerCfg.InterruptRequests = HRTIM_MASTER_IT_NONE; pTimerCfg.DMASrcAddress = 0x0000; pTimerCfg.DMADstAddress = 0x0000; pTimerCfg.DMASize = 0x1; pTimerCfg.HalfModeEnable = HRTIM_HALFMODE_DISABLED; pTimerCfg.PreloadEnable = HRTIM_PRELOAD_DISABLED; pTimerCfg.RepetitionUpdate = HRTIM_UPDATEONREPETITION_DISABLED; pTimerCfg.DelayedProtectionMode = HRTIM_TIMER_D_E_DELAYEDPROTECTION_DISABLED; pTimerCfg.UpdateTrigger = HRTIM_TIMUPDATETRIGGER_TIMER_E; if (HAL_HRTIM_WaveformTimerConfig(&hhrtim1, HRTIM_TIMERINDEX_TIMER_E, &pTimerCfg) != HAL_OK)
I am using nucleo-f429zi with stm32cubemx. I found the default system clock in stm32cubemx is 168MHz for nucleo-f429zi. when I add usb fs in my application, I can't change to system clock 180MHz because pll_q can't get 48MHz. anybody knows how to configure my usb application with 180MHz in stm32cubemx?
hello, after configuring the rtc in the cube the clock does not start. The initialization procedure calls the error handler. I checked that the RTC_EnterInitMode function is a problem. The INIT bit in the ICSR register is not set. Rule SET_BIT (hrtc-> Instance-> ICSR, RTC_ICSR_INIT); did not work. What could be the reason?
I'm trying to find out where CubeMX gets the "OPT = -O3" setting that keeps overriding my edits I have to make after (re)generating the code.I can't find a template anywhere!
Cubemx v5.1.0 , STMF7 v.1.15.0 ,USB CDC , device only, usb fsUSBD_StatusTypeDef USBD_Get_USB_Status(HAL_StatusTypeDef hal_status) static void SystemClockConfig_Resume(void)is not declaration. ANDhpcd->Init.speed = USB_OTG_SPEED_FULLvoid HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd){ USBD_SpeedTypeDef speed = USBD_SPEED_FULL; if ( hpcd->Init.speed == PCD_SPEED_HIGH) { speed = USBD_SPEED_HIGH; } else if ( hpcd->Init.speed == PCD_SPEED_FULL) { speed = USBD_SPEED_FULL; } else { Error_Handler(); } /* Set Speed. */ USBD_LL_SetSpeed((USBD_HandleTypeDef*)hpcd->pData, speed); /* Reset Device. */ USBD_LL_Reset((USBD_HandleTypeDef*)hpcd->pData);}USB_OTG_SPEED_FULL is 3PCD_SPEED_HIGH is 0PCD_SPEED_FULL is 1it always make go to Error_Handler()
Is the 4-Lines Bus for the SD Card supported now?Would be great to get an updated example on how to implement basic SD Card / FATFS support for STM32L4 devises. Like a SDCard "Hello World". Things change so rapidly, that non of the old examples work anymore!
Hi All,I recently updated the Codegenerator and now USB does not work on my STM32L468RG.I made a concept of proof that worked and investigated the changes.Icould see that in my complete Project the codegenerator initializes the RCC by HSI where it should use HSE.When I change that it seems to work.I post here the screenshot of my clockconfigurations of the projects as well as generated code snippet.Please ST fix this bug ASAP.regards, Adib.--
Doing R&D product development. I can't get the HRTIM interrupt to trigger when setting the Interrupt request source in STM32CubeMX. There is no difference in code generation and the interrupt parameter is not modified. Both releases use the same F3 firmware package. Looks like the code generation for this function is missing. Please look into it.
Hello,is it possible to know when will the 1.4 software version of STM32CubeH7 be released?Thanks in advance.
I am using an STM32F4xx processor. I just worked through and tracked down a logic inversion between CubeMX and the HAL implementation, that does not show up in any of my searches. It looks like it got introduced when the CAN libraries were upgraded. In the CubeMX CAN setup page the parameter "No-Automatic Retransmission" actually does the opposite. In the re-written driver, the structure member is "AutoRetransmission" (not No-Auto Retransmit). Looking into stm32f4xx_hal_can.c code, ENABLE for AutoRetransmission clears NART.
Hi all,I want to handle STM32F407 Disco via VCP. In the first case, i tried to configure UART but when i connect my USB TTL converter to my PC: it informs me that VCP error ''This device cannot start(code 10)''.I thought that the probem is related to my USB converterThen i tried to configure CDC USB: USB_OTG_FS on mode Device only activate USB_Device middelware in CDC modecheck the CubeMX file attached for more detailsbut the problem still exist!===> VCP error ''This device cannot start(code 10)''.and here is the define in "usbd_desc.c" file#define USBD_VID 1155#define USBD_LANGID_STRING 1033#define USBD_MANUFACTURER_STRING "STMicroelectronics"#define USBD_PID_FS 22336#define USBD_PRODUCT_STRING_FS "STM32 Virtual ComPort"#define USBD_SERIALNUMBER_STRING_FS "00000000001A"#define USBD_CONFIGURATION_STRING_FS "CDC Config"#define USBD_INTERFACE_STRING_FS &nb
I have designed STM32L412RBT6 board with USB FS connection. With CubeMX 5.0.0 and L4 firmware package V1.13.0, I generated USB MSC project for TrueStudio. But, it doesn't work at all.PC couldn't recognize my MCU. For test, I changed the MCU to STM32F070RBT6 and generated USB MSC project with CubeMX. Compiled with TrueSTUDIO. It works OK. Is there any known issue in my STM32L412RBT6 + CubeMX5.0 + L4_1.13.0 + TrueSTUDIO + USB FS MSC ?* I need to confirm the HW is okay or not. Is there any one who can upload any USB-ready firmware hex file for STM32L412RBT6 ? Then, I can check my hardware with it.
I could leave without commenting, but if I do not do this, they can not improve their tools and interaction with the client.It may even seem from my last posts, that I just want to speak badly. More if ST reads, and pay more attention to users' posts, someone would already be at home resting.I'm using version 5.1.0 of ST32CubeMX, and it seems to be the latest.Well I was wanting to organize the way the peripheral / middleware code calls are generated.Since I did not find anything that gave me this option in the Project Manager / advanced settings, I made the default to find an answer.Help / Manual.Here comes the best part, "or I would say, worse," the pdf opens UM1718- Rev 28, I go to page 124 - 4.7.3 Advanced Settings tab and I find this.Figure 98 shows the peripheral and / or middleware selected for the project.Ordering initialization function calls.By default, the generated code calls the peripheral / middleware initialization functions in the order in which peripherals and middlewar
After project setting, I want to make this setting TrueStudio project.So, I pushed generate code button, but it didn't work with error message pop up.I already installed the jre, jdk.How can I solve this problem?What is the ProjectBuilder below?2019-03-25 15:13:30,303 [INFO] ConfigFileManager:1281 - mx.scratch is deleted!2019-03-25 15:13:30,303 [INFO] ProjectBuilder:2035 - Time for Generating toolchain IDE Files: 17mS.2019-03-25 15:13:30,304 [ERROR] ProjectBuilder:2041 - Error in Project Generation2019-03-25 15:13:30,304 [ERROR] ProjectBuilder:588 - Error in Project Generation
Hi,I have a problem with connecting my STM32 F4 Discovery to USB. I use Eclipse with CubeMX and I configured USB as Device_Only, VBUS_activate and the rest I left as default. I also set in USB_DEVICE the Class for FS IP "Communication Device Class (Virtual Com Port)". I did everything as in tutorials, like: https://www.youtube.com/watch?v=7oED-m34EKkThe program is compiling, I use ST-LINK to downloading programs to stm via SWD and it seems it has no errors. I have the STSW-STM32102 Virtual COM Port Driver installed. I use Windows 7.The problem is when I plug in USB cable to stm nothing happens, it's not that the system can't recognize device as STM Virtual Port, it's just nothing appears. Can it be some hardware problem or something else? I will be very thankful for any advice.
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.