Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Having some issues with CubeMX not showing properly the DevKit hardware features. For example:The devkit has an ST-LINK V3 chip (per documentation and according to silk screen) yet CubeMX has the ST-LINK V2 setting available only, ST-LINK V3 is greyed out ?!?The crypto engine per documentation supports e.g. HMAC, yet it is greyed out in CubeMXExternal Flash shows as 1152 Mbit in CubeMX which is incorrect, yet it is fixed/unchangeable.Don't see the SDRAM (8Mx32bit) and SRAM (1M x 16bit) as a separate item in CubeMX Both the STM32CubeMX and the H7 package has the latest version on my computer 6.21.1 & 1.11.2 respectively. Running under Win11 Pro.Any help is appreciated.Thanks
I am using STM32H743VIT6 revision V.The processor is configured using the latest version of CubeMX.The program works with a debugger, but does not start without a debugger.I don't understand what I'm doing wrong. Help me please.
Hi all, I am now using SYM32F103RE to read data from codec via I2S & write into SD card. I use the HAL library in STM32CubeMX w/ Chen's fatfs & I2S DMA. Unlucky, f_write will sometime return FR_DISK_ERR. According to fatfs, I can only f_close the file in this case. But it only return FR_INVAILD_OBJECT no matter what I do. If I add a 1ms polling delay (HAL_Delay(1)) between each f_write, it works fine. So is there any way to avoid or recover from the problem?Here is my code:FRESULT u8_sd_fat_status = FR_DISK_ERR; // 0 = SD card FAT file system is ok, otherwise 1. uint16_t u32_array_codec_in[512]; f_mount(&SDFatFS, (TCHAR const*)SDPath, 0); f_unlink("record.wav"); u8_sd_fat_status = f_open(&SDFile, "record.wav", FA_CREATE_NEW | FA_READ | FA_WRITE); for(unsigned char i = 0; i < 10 && u8_sd_fat_status != FR_OK; i++) { HAL_Delay(100); u8_sd_fat_status = f_open(&SDFile, "record.wav", FA_CREATE_NEW | FA_READ | FA_WRITE); } if(u8_sd_fat_status ==
It is a very common practice the source files go in pairs: a .h file with the interface, and a .c file with the implementation.This is acknowledged in CubeMX - which has an option to do exactly that: But, with CubeIDE (in fact, Eclipse), it requires a 2-step process:New > Source File;New > Header File. Feature Request: add an option to create a pair of files - .c and .h - in one go.
Downloading a selected version of STM32CubeMX does not work.Download link:https://www.st.com/en/development-tools/stm32cubemx.htmlWhen I select 6.11.1, and login, nothing happens.I can downlad the latest version 6.12.0.Am I doing it wrong?
Hello everyone,I'm currently developing an application that uses the pdm2pcm library to convert digital audio from a MEMS microphone. I'm working in STM32CubeIDE, where I manually linked this library. I have access to both GCC and IAR pre-compiled versions of the library.Currently, I'm using the GCC version, but it's taking up a substantial amount of flash memory—over 47 KB. According to the library's documentation, the expected flash usage is around 7 KB when compiled with IAR.Does anyone know how to optimize flash usage for this library in GCC? Are there specific GCC flags or settings that could help reduce the memory footprint?Thank you all in advance for your help!
I'm using an STM32F427 and no RTOS, along with a custom PHY. However, I’ve encountered issues configuring a custom PHY address in STM32CubeIDE 1.14.1:Custom PHY Address SetupMy setup requires a specific PHY address, such as 0x80, but STM32CubeIDE 1.14.1 only lists options for LAN8742 and DP83848. Selecting "Undefined PHY" triggers a warning, which limits proper configuration. In STM32CubeIDE 1.8.0, I was able to configure a custom PHY without any issues.Could you please provide guidance on how to set up and configure a custom PHY in version 1.14.1? Any information on handling this in the latest versions to avoid warnings and allow for custom PHY addresses would be greatly appreciated.Thank you.
When STM32MX (6.12.1) is used to generate a CMake project it puts the following logic into cmake/stm32cubemx/CMakeLists.txt: # Validate that STM32CubeMX code is compatible with C standard if(CMAKE_C_STANDARD LESS 11) message(ERROR "Generated code requires C11 or higher") endif() At present the valid values for CMAKE_C_STANDARD are 90, 99, 11, 17, and 23. Therefore this comparison will always resolve to true and the message will not be printed if C90 or C99 are being used which is no doubt the intent. The following conditional is guaranteed to work until at least 2099: if((CMAKE_C_STANDARD EQUAL 90) OR (CMAKE_C_STANDARD EQUAL 99))
Hello everyone,we are currently developing a new product based on the new STM32C071G8U. Unfortunately, we found some Bugs in the CubeIDE 16.1 CubeMX extension when configuring the peripheral of the microcontroller. 1. All Packages smaller than 48 pins are missing the HSE oscillator option. According to the datasheet, it should be possible to route the HSE to the OSCX pins. You can also verify this overwriting the automatically generated code to force the use of the HSE. 2. The settings in the clock configuration aren't applied and always default to divide by 1. 3. The STM32C071G8 has only 64 kB of flash, but the automatically generated linker script defines the flash size as 128 kB. It would be nice if you could address these bugs in your next software version.Kind regardsDominik Schmid
When I try setting up to use an external 10MHz reference clock on the HSE with a divisor of 1 and a multiplier of 25 it insist the frequency will be 255MHz but shouldn't it be 250MHz, Similarly for every multiplier I have tried the frequency is 5MHz off.See attached screen shot from CubeMX. ThanksChris.
I want to use L4R9's OSPI interface.I only have a microcontroller board, and I want to test whether it can send data.During the test, I found that the HAL_OSPI_Transmit() function never sends data,and the oscilloscope cannot pick up the waveform.It is speculated that the reason is that the NCS film selection cannot be lowered.My board is in the OSPI_READY state after powering on, and even though I added the write enable function,there is no way to realize data transmission. Even if the chip select line is forcibly set to GPIO type and manually pulled low in the program,the HAL_OSPI_Transmit() function still cannot work. My cube configuration and test program are as follows:HELP ME,PLEASE!!!In addition to the failure of the microcontroller, are there any other unreasonable configurations that may cause data transmission to fail?
Hello,I recently noticed an issue with the CMake project generated by CubeMX targeting the STM32G4CETx MCU.The generated gcc-arm-none-eabi.cmake sets the optimization flags using `CMAKE_C_FLAGS`, which are then overwritten by the default optimization flags used by CMake.I've attached the compile_commands.json (though I've had to rename it to `.json.txt`) from a Release build, which is generated by CMake by using `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`. As you can see, the optimization flag `-Os` is immediately overwritten by `-O3`, which is the default for CMake.It appears that projects for the STM32H7 do not have this issue, as they correctly use CMAKE_<LANG>_FLAGS_<CONFIG> (https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS_CONFIG.html#variable:CMAKE_%3CLANG%3E_FLAGS_%3CCONFIG%3E) Also, as a side note, it appears that -Og should be used for debug builds, as that is preferred for the typical debug experience (per https://gcc.gnu.org/onlinedocs/gcc/O
Hi everyone,I'm trying to manage the writing and reading of files on the SD card of the STEVAL-STWINKT1B board, but when I run an f_open it gives me FR_NOT_READY, I've tried with different SD cards but the result doesn't change, I ask if anyone has any suggestions on what it could be,I'm working with stmcubeIDE v 1.16.1 and stmcubeMX v 6.12.1the configuration on cubeMX is the following:On stmcubeIDE in main project I only entered the function f_mount and f_open:with the debugger I saw that f_open returns me FR_NOT_READY.
I am trying to create a project with Ethernet and LwIP on M4 core of NUCLEO-H745ZI-Q, but when generating code with CubeMX the LwIP directory is included in both cores' projects. This leads to an error when building the M7 core code. I am using 6.10.0 version of CubeMX. Below you can see the errors that occur. fatal error: lwip/debug.h: No such file or directoryfatal error: netif/ppp/ppp_opts.h: No such file or directoryfatal error: netif/ppp/ppp_opts.h: No such file or directorymake: *** [Middlewares/Third_Party/LwIP/src/netif/ppp/subdir.mk:91: Middlewares/Third_Party/LwIP/src/netif/ppp/auth.o] Error 1make: *** [Middlewares/Third_Party/LwIP/src/netif/ppp/subdir.mk:93: Middlewares/Third_Party/LwIP/src/netif/ppp/ccp.o] Error 1make: *** [Middlewares/Third_Party/LwIP/system/OS/subdir.mk:19: Middlewares/Third_Party/LwIP/system/OS/sys_arch.o] Error 1make: *** Waiting for unfinished jobs....
Hello,I've noticed that the generated CMake projects (specifically, in the toolchain gcc-arm-none-eabi.cmake file), a now-deprecated (since version 3.6!) macro is used https://cmake.org/cmake/help/latest/module/CMakeForceCompiler.htmlI have to remove/comment out the use of these macros in my code due to it causing issues with other CMake libraries that I use in my project, which somewhat defeats the purpose of the CubeMX generated code to begin with.Hopefully this is seen by the right person and this issue is addressed. Thanks!
EMB1428QSQ/NOPB is used which has the frequency of the 1.1MHz fclk and the SPI2 of STM32F469BIT7 is going as a clock to it. I need the minimum value of the SPI2 master that can be fed to the EMB1428QSQ/NOPB. Also, where can I find the minimum frequency of the communication interfaces , I have used the USART and SPI2.
I am programing the STM32L4S9AII6 using the STM32L4R9I-EVAL board. My application requires the use of 5 different SPI buses, but the STM32L4S9AII6 only has 3 standard SPIs. However, it has 2 Octospi buses that I understand can be configured to be standard SPIs. Is this true or have I been mislead? Can someone shed some light on how to configure an Octospi as a standard full-duplex spi? Preferably using MxCube. More specifically, I want it to be equivalent to this standard SPI configuration:
I created a new project for my Nucleo board using STM32CubeMx 6.12.1. In the project manager settings, I have chosen STM32CubeIDE. Generate Under Root option is checked. When I click on "Generate Code", the .cproject file is not created. But .mxproject and .osx project files are created. I do get an error pop up during code generation saying "The Eclipse executable launcher was unable to locate itscompanion shared library."Is this popup the cause of the error ?
Hi I am using STM32 CubeMX and am trying to add the LoRaWAN package but have this message ( see below). I am not sure how to fix ?Any one have any guidence on this?
Hi!My goal is connection of STM32 mcu to Amazone web service.I was wonderful bu Cube and generate a first application (freertos with lwip) for nucleo-f767zi board. There are function like mqtt_client_connect and mqtt_publish in code that was generated and I can connect to local broker (mosquito).But what about TLS? Is there some kind of instruction on how to enable it for my project?At now, I'm just enable this checkbox in Cube but I see that there is no any integration with MQTT demo.Also, some options from IDE don't affected to source generated, like debug log for mbedtls or LWIP_ALTCP_TLS_MBEDTLS flag.From many comments on web I found, that I need something like altcp_tls_create_config_client_2wayauth function with thread protection, but what's the right way for this project generation?Sergey
I like to configure IWDG (with early interrupt), but the UI in STM32CubeMX for IWDG lacks the NVIC settings tab compared to WWDG. I know that both units share the same ISR "WWDG_IWDG_IRQHandler", but why do I need to activate WWDG to get the Interrupt code generated? I really just like to use the IWDG due to its low power (stop 2) capabilities, I don't want the WWDG at all. How can I activate the interrupt code generation for IWDG without activating WWDG? Is this intentionally or is this a bug in STM32CubeU0 MCU package in STM32CubeMx?ps. latest available versions installed (6.12.1 + STM32CubeU0 Firmware Package V1.1.0 / 05-June-2024)
I am using stm32f407zg board with DP83848 ethernet PHY chip. CubeMX generates code with LWIP for FreeRTOS. App used to answer ping successfully when it starts with connected eth cable only and stops after its reconnecting. After some investigation i have noticed some suspicious place in code(see below). After adding "_IT" postfix it started to work, so looks like cube used wrong handler to stop/start ETH periphery(see lines 7 and 30). So my question is: is it a CubeMX bug or i just missed some delails?Here is a cycle from ethernet_link_thread entry in ethernetif.c file:for(;;) { PHYLinkState = DP83848_GetLinkState(&DP83848); if(netif_is_link_up(netif) && (PHYLinkState <= DP83848_STATUS_LINK_DOWN)) { HAL_ETH_Stop_IT(&heth); //Here we stop ETH netif_set_down(netif); netif_set_link_down(netif); } else if(!netif_is_link_up(netif) && (PHYLinkState > DP83848_STATUS_LINK_DOWN)) { switch (PHYLinkState) { case DP83848_STATUS_100MBITS_FULLDUPLEX
I am desperately trying to seed a production project involving multiple engineers (and across multiple companies) and am having great difficulty getting the project to build once it has been pushed to a git repository. The difficulty involves the creation of empty directories that git ignores, but eclipse does not. My preference is to force the code to be copied into the project rather than linking it into STM32CubeMX libraries which get updated all the time. For us this creates risk and is something that I would like to avoid.This is a blocking issue as we now need to build it out to include new features and functions. Currently we are using the USBX HS CDC ACM as our base and will soon add to it SPI and possibly multiple UARTS. How can I get this project seeded? How can I successfully distribute the source code across multiple platforms/engineers?
Does stm32cubeMX 5.2.1 has the correct pin_out for RTC_OUT signal for part STM32H750VBT6?Here is from data-sheet say RTC_OUT is located PB2and cubeMX say it on pin PC13 (winch other F series used to be):
Hi People, for the since start of year i've been setting up boards with Texas C2000 , and for the past 6 months infineon tri-core processors. I may be changing jobs and it involves STM32 so i'm getting a head start. I have a STM32373C-EVAL , as i need TFT display and CAN. i have attempted to make a 'blinky ' project. Compiles fine but when it runs it hangs on the oscilator start up . Fresh install of STM32CubeIDE so used the config tool and let it do all the defaults.. The dev kit has solder bridges for crystal - they are open , but i've let it use the PLL. it wont let me When running in debug it 'hangs' on stopping the code , its in the error handler from the system clock settings , if i comment out the error handler it runs . void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; /** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDe
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.