Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on April 12, 2018 at 19:25CubeMX is a great tool but there is something I am not understanding. I am using System Workbench to write my project. If I go back to CubeMX to make a change it tend to wipe out the code I've added to main.c. Should I put all my code in a separate source file and leave main.c as unchanged as possible? What is the right way to do this?#system-workbench #cubemx #workflow
Posted on September 01, 2015 at 19:13Hi to every one,It's the first time that I use the STM32CubeMX + SWSTM32 to program a stm32f401RE board. I have done already some example project but I can't use the printf() function to communicate with a terminal ( Tera Term) on the PC. Somebody can explain me how I can do it?Thank you in advance!!
Posted on April 12, 2018 at 21:08I want to use I2S for single MP45DT02 MEMS microphone, for which I2S WS pin is not needed. CubeMX forces WS pin when enabling I2S peripherial, but I need to use this pin as GPIO for something else. Is this a bug in CubeMX and can I reassign this pin as GPIO in project, or is it not possible and it has to be WS pin even when it is not used?#cubemx-v4.25.0 #stm32-f7
Posted on February 04, 2017 at 19:00Hi,I used to use cubemx with 1.5.1 firmware. I am using NUCLEO-F767ZI board. After formatting my computer, I realize that there is something new in timer configuration lines. It comes as:htim(anyofthem).Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;After cubemx, I am adding configuration files to the mbed OS and it returns error for that lines.If I just delete that line, is the board works properly?#cube-mx #nucleo-f767zi
Posted on March 15, 2017 at 09:59 I discovered CubeMX 4.20 always generates code where VBUS sensing is enabled, no matter if it is ticked in CubeMX or not. This caused enumeration fails in several projects where PA9 is not used by me (I use it in CDC Virtual Com Port mode) Affected code file is usbd_conf.c line 299 (line 18 in snippet) USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev) { /* Init USB_IP */ if (pdev->id == DEVICE_FS) { /* Link The driver to the stack */ hpcd_USB_OTG_FS.pData = pdev; pdev->pData = &hpcd_USB_OTG_FS; hpcd_USB_OTG_FS.Instance = USB_OTG_FS; hpcd_USB_OTG_FS.Init.dev_endpoints = 4; hpcd_USB_OTG_FS.Init.speed = PCD_SPEED_FULL; hpcd_USB_OTG_FS.Init.dma_enable = DISABLE; hpcd_USB_OTG_FS.Init.ep0_mps = DEP0CTL_MPS_64; hpcd_USB_OTG_FS.Init.phy_itface = PCD_PHY_EMBEDDED; hpcd_USB_OTG_FS.Init.Sof_enable = DISABLE; hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE; hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE; hpcd_USB_OTG_FS.Init
Posted on April 12, 2018 at 11:26Hi guys.I'm working on a STM32L433RCTP based project with STM32CubeMX.It's probably not the best idea to use CubeMX as a reference, if you have the datasheet / ref manual....It took some hours for me to figure out, why there are some pins not responding to what I've done with them. Here is the reason: I located the pins by looking at the CubeMX drawing. But in STM32CubeMX there are some pins wrong.I took two screenshots. On the right side, there is a screenshot from the datasheet and on the left side you can see a screenshot from CubeMX. The CubeMX screenshot is overlayed by the pin names, extracted from the datasheet screener. So you can compare the pins in CubeMX with the pins in the datasheet.As you can see, the pins in the red boxes doesn't match with the ones from the datasheet.However, the generated code and the pin functionality seems to be working.I wonder if this is an issue for other controllers, too.#pin-mapping #stm32cubemx-4.25.0
Posted on January 24, 2018 at 19:28Hello,There were questions similar to this before, but not exactly. This is applicable to STM32CubeMX V4.24.0 with STM32CubeL4 fw package V1.11.0 (latest at this time).Previously code generated by STM32CubeMX for configuration of SDMMC+FATFS+DMA+RTOS was not working. Some workarounds were found on the discussion boards which required modification of code generated by STM32CubeMX (i.e. these modifications would be erased by following code regenerations). The code generated by STM32CubeMX did not match code from the STM32CubeL4 package (STM32Cube_FW_L4_V1.11.0\Projects\32L496GDISCOVERY\Applications\FatFs\FatFs_uSD_DMA_RTOS). For example, SD_initialize() function from sd_diskio.c was missing initialization of queue SDQueueID (compared to the same function in sd_diskio_dma_rtos.c from the STM32CubeL4 example). Essentially, the queue was left uninitialized at all (should this have been done by user?). Right now, in
Posted on February 13, 2018 at 23:38Hi There,I've just switched to using Atollic (from System Workbench) and am having issues with the code generation in STM32CubeMX. When I build a project using 'generate under root', the code will not compile with undefined references to all the HAL functions.e.g. errors like..\STM32_workspace_9.0\TEST_PROJECT_UNDERROOT\Debug/..\Src/hrtim.c:69: undefined reference to `HAL_HRTIM_Init'If I generate with this box unticked then there are no problems.I am using: STM32CubeMX V4.24STM32Cube FW_F3 V1.9.0Atollic TrueStudio V9.0.0#atollic-truestudio #stm32cubemx
Posted on June 25, 2017 at 23:49I am using STM32CubeMX 4.21.0 for STM32L4. When using FreeRTOS with tickless support, the freertos.c file is generated with functions decleared __weak, but this macro is not defined. I am generating for GCC. I am running on Linux.__weak void PostSleepProcessing(uint32_t *ulExpectedIdleTime){/* place for user code */}I am getting annoyed at having to add/* USER CODE BEGIN Includes */ &sharpdefine __weak __attribute__((weak))/* USER CODE END Includes */Can you reproduce the problem?#freertos #stm32cubemx #linux #gcc
Posted on March 11, 2017 at 19:02Sometimes, STM32CubeMX just stuck at generating code, and i am not able to do anything. Just end the process from Task Manager. What does happen?P.S. Jawaw.exe in the Task Manager not load my CPU at all.#stm32cubemx
Posted on April 06, 2018 at 21:47Now that encoder mode seems to be missing from CubeMX, at least for STM32F070 and STM32F407 devices, what is the most 'CubeMX-friendly' way to use it? The idea is to generate a CubeMX project, then run a script to make it a project for the IDE we're using. Both devices have encoder mode capable timers.And why is it, that I've seen F7xx devices configured to use encoder mode with CubeMX? Is the CubeMX itself different or what's the thing?#cube-mx #encoder-mode #quadrature-encoder
Posted on March 26, 2018 at 17:00Hey guys,i am right now working on the Nucleo L476 RG Board. I generated source code with STM32CubeMX (v4.25). I am using the internal opamp in 'Follower' mode and reading the output with the on-board adc. VCC is 3.3 V.When applying different voltage levels to the input of the internal opamp i have seen that the opamp output never goes below 1.4 V even when i directly short the input to GND. Above 1.4 V everything works like expected.Does anyone have a clue what is going wrong/missing in the code to make it work over the full spectrum?Thank you and best regards,Alex
Posted on April 06, 2018 at 00:55I'm using an STM32L462 and HAL CubeMX all quite successfully. This question concerns USB Device mode handling and how to proprerly implement VDDUSB detection using EXTI_Line35. I need to be able to dynamically detect the insertion and removal of a USB cable to (a) execute port vs dedicated charger and (b) wake from sleep on USB connection to either a host or a dedicated charger. When connected to a host I'm running a CDC serial port using the streaming usart driver mod I posted earlier (which works perfectly). I'm familiar with GPIO EXTI handling and use it frequently to detect events and for external wakeup. That also works perfectly.Now to the problem. VDDUSB voltage on that pin detection is a signal defined as PVM1 which uses EXTI_Line35. This line mapping and code generation is NOT supported in HAL or the CubeMX configuration application (it should be) My issue is that, using HAL, I'm a bit
Posted on April 05, 2018 at 17:09I've generated code with CubeMX, but it doesn't compile. I'll go through the steps I've taken.1. CubeMX projectStarting a new project, I selected the board NUCLEO-F746ZG. Upon the question 'Initialize all peripherals with their default Mode?' I answered 'Yes'.I did not change anything in the pinout, clock settings, configuration, ... I only opened the Project Settings dialog, and entered a Project Name, Project Location and Toolchain:Project Name: nucleo_f746zg_demoProject Location: C:\CubeMX_test\Toolchain / IDE: MakefileNext, I clicked on 'Generate Code' and closed CubeMX.2. Compilation attemptBecause I've selected 'Makefile' as my Toolchain of choice, I open the Windows CMD terminal and navigate to the project folder 'C:\CubeMX_tests\nucleo_f746zg_demo'.I issue the following command: > make allI get the following output, indicating that the compilation failed: The system cannot find the path specified. mkd
Posted on April 05, 2018 at 19:40I created a new project with cubemx. MCU's has 8 KB flash and cubemx fulfill the code space with unnecessary libraries. How to remove unnecessary libraries from my project?#cubemx
Posted on April 04, 2018 at 15:31Hello, I want to use LwIP in server mode. After a client has connected, I want to send data periodically to the client. My device, 'STM32F4' is the server and the PC is the client. By using the 'tcp_echoserver' example, I can only send data from the server side to the client side, When I get data from client. Can somebody recommend a solution or share a code ?Best Regards#cubemx-stm32 #lwip-cube
Posted on March 29, 2018 at 22:28There is a bug in CubeMX version 4.25 in ADC configuration. I'm using STM32F746 MCU. In ADC2 configuration window there is one more rank displayed than number of conversion and for ADC3 there is one less. In generated file for ADC3, one channel is missing. #adc #cubemx
Posted on March 13, 2017 at 14:18Hi all,can I ask you how to turn on ignoring warning windows of STM32CubeMX.I am using it by command line interface:java -jar STM32CubeMX.exe -q <script name>I need to ignore it because my automatic build server cannot interract with this windows.ThanksRegardsMarek#cube-mx #stm32cubemx #stm32cubemx-warning
Posted on April 01, 2018 at 00:54Hello,I just faced a problem in STMCube MX for STM32L053R8T6, there is no option to select alternative function OPEN DRAIN output for LPUART1.I see the option for USART1 or USART2 GPIO settings but not for LPUART1.I First thought that option is not available for LPUART peripheral, so checked all datasheet's related pages ... but didn't find any note about it.Finally i changed the generated code (LPUART1 MspInit part) manually and set the TX pin of LPUART1 output mode to GPIO_MODE_AF_OD, then it worked.I just wanted to inform you to correct this bug in the software for future.The Installed package for L0 series in STMCube is V1.10.0 (The last update).Thanks & Regards.#push-pull-output-or-open-drain-output #lpuart #stmcube-mx #stm32l0-lpuart-output-mode
Posted on March 28, 2018 at 18:33Keil 5 uVision V5.14.0.0''void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle){if(rtcHandle->Instance==RTC) { /* USER CODE BEGIN RTC_MspInit 0 *//* USER CODE END RTC_MspInit 0 */ LL_PWR_EnableBkUpAccess(); /* Enable BKP CLK enable for backup registers */ &n
Posted on March 29, 2018 at 11:34I am trying to separate the code generated by CubeMX from the code I wrote, and mainly, I want to move the pins definitions from the main.h file to my own file.I know there is a template file that can be loaded in the Cube, but I am not sure if there is an option for generating code to a specific file.Does anybody know a way how to do it? I want to have the pin definitions in my own file (io_mapping.h).Thanks a lot!#template #stm32cubemx #code-generation #pin-mapping #customize
Posted on March 28, 2018 at 22:42Hi everyone,I use Keil v5.23STM32Cube 4.25I always worked with stdperiph lib and I would like to switch to HALI tried to start a simple project with my STM32F103C8T6 but when I want to compile a project from cube, I have a lot of errors in Keil and can't manage to get rid of them.Here is my setup:and the bunch of error messageswhat is strange is that I changed nothing to the original setup so it should work...Any idea?Cube setup:Thank you for your help#stm32cubemx-4.25
Posted on January 22, 2018 at 21:49I am currently building a project with a STM32F103RCT6 (shouldn't matter) and I ran into a problem.CubeMX does initialize the SWD-Pins for programming. The problem seems to occur when I enable a timer peripheral on the same Port (PA8 in my case). My workaround atm is to include a second call to '__HAL_AFIO_REMAP_SWJ_NOJTAG();' in the ' /* USER CODE BEGIN 2 */' after CubeMX is finished initializing.I found some information in the web pointing towards this being a problem with CubeMX doing invalid read/modify/write operations on the write-only MAPR register.I didn't find an official way to report bugs with the CubeMX tool (like github os something like that), therefore I am writing into this forum.#stm32f103-swd-swclk-afio-mapr #cubemx-4.23 #bug?
Posted on March 20, 2018 at 08:30Hi every one. I useing the CUBE MX for generate code. I would like to know when I use CSS(Enable the Clock Security system). After external clock fail MCU. Will it switch to internal clock. I attach file please see that and tell me How to use CSS.#cubemx
Posted on March 20, 2018 at 22:57Hi everybody, I am back here because two weeks ago, I started to try to add a SD card on my nucleo F411re. I used SPI connexion. I tested the wiring with a mbed software called Nucleo_L476RG_SDCard_WorkingSample. I just changed the pin to match my SPI1 on nucleo F411re :// MOSI, MISO, SCLK, CS, nameSDFileSystem sd(PB_5, PB_4, PB_3, PA_10, 'sd');I tried a lot of things using cubeMX to get this working using SW4STM32. I added FatFS, but since I not using SDIO, CubeMX do not allow to tick SDcard in FatFS. I ticked 'user defined', but after generating the project, I am not able to move forward. I tested every library/tutorial available on the first two pages of a famous web browser. Now I still stucked, with nothing new to try.Does somebody here could share a project that I could start with ( open it and compile at less using sw4stm32? generated with cubemx ? using Hal? and finaly using a stm32F411?).Thanks in advanceBaptiste#stm32f411 #fatfs #sdcard
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.