Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Bug: CubeMX STM32F4 Keil project generation does not work with Java 14, where it works with Java 11I have a project that generates fine using CubeMX 6.0.1 STM32F4 1.25.1Now I upgraded to Java 14.The project generation has problems on the Keil Project file generation.When I go back to Java 8 it works. Same problem on ST32F4 1.25Please ST fix this bug.Adib.
CubeMX Version : 6.0.1.202008101643 com.st.stm32cube.common.feature.mxDevice: STM32H743I believe there may be an issue when setting the VREFBUF output voltage in CubeMX. The definitions for VREFOUT in CubeMX are inconsistent with the definitions given in the stm32H7xx_hal.c file.CubeMX uses the following in the dropdown:Scale 0 - 2.5VScale 1 - 2.048VScale 2 - 1.8VScale 3 - 1.5VHowever the function description for HAL_SYSCFG_VREFBUF_VoltageScalingConfig()in the stm32h7xx_hal.c indicates the following:SYSCFG_VREFBUF_VOLTAGE_SCALE0 = 2.048V SYSCFG_VREFBUF_VOLTAGE_SCALE1 = 2.5V SYSCFG_VREFBUF_VOLTAGE_SCALE2 = 1.5V SYSCFG_VREFBUF_VOLTAGE_SCALE3 = 1.8VThis issue leads to the incorrect voltage being present on VREF+ pin once the code is generated. I believe this is a similar issue to that reported on other STM32 devices. Setting of scale 0 in CubeMX results in scale 0 being used in the generated code, but the voltage is incorrect.I don't know which set of scales is ultimately correct, but the
Hello,I would like to experiment on the nucleo board with STM32H745 development kit (dual cores), butr I face some issues. I just downloaded the firmware package from CubeMX and integrated the example code with SystemWorkbench4STM32 as the project files are ready to be used.During compilation, when everything is integrated in SystemWorkbench4STM32, I get a lot of errors:C:/Users/***/STM32Cube/Repository/STM32Cube_FW_H7_V1.7.0/Projects/NUCLEO-H745ZI-Q/Examples/BSP/CM7/Src/stm32h7xx_it.c:140: multiple definition of `SysTick_Handler'Example/User/CM4/stm32h7xx_it.o:C:/Users/***/STM32Cube/Repository/STM32Cube_FW_H7_V1.7.0/Projects/NUCLEO-H745ZI-Q/Examples/BSP/CM4/Src/stm32h7xx_it.c:138: first defined hereThis happens to a lot of symbols. It looks like both compilations (CM7 +CM4) are affecting each other when generating the final 2 elf files. This is really strange..Because of this behaviour, I cannot even test the nucleo board at all. Is there any fix available for this issue in order to m
Can you change CubeMX so that each of the configured FreeRTOS tasks are put in their own .c/.h files? Clumping them all in freertos.c is just a bad idea.Thanks,Andrei from The Great White North
Using STM32CubeIDE to create a USART test project with default code generated, the USART is outputting garbage e.g. �)���?�+Ѵ# on a terminal (USB to PC).Yet using exactly the same default code generation process and same simple test code on two other Nucleo boards Nucleo-L432 and Nucleo-L073RZ a "hello world" test string is printing fine.Have tried various configuration changes, to clocks etc on the L433RC to no avail.Have checked the output with a logic analyzer, which shows the same garbage. Have played with baud rates, word length etc to no avail. Exactly the same problem with USART2 and with USART1. Strangly, carriage return and line feed are being output correctly as 0D and 0A (which is a pretty good indicator that baud rate etc is ok). The garbage ASCII is generally the same hex output but sometimes varies. The main test programme is very simple. Default setup code generated by STM32CubeIDE plus the following: #include <stdio.h>#include <string.h>char message[] = "Hel
I amusing STM32CubeMX version 6.0.1. My board is based on the STM32L071RBT6 MCU.I am using the IOC file attached to this post. The code generator is configured for KEIL MDK 5.27 (same with MDK v5).The code generator appears to complete successfully -- I get a pop up indicating the same. However, when I click on either of the two options (Open Folder, Close) I get the same error popup shown below. I also notice that there is no startup or scatter load descriptor either
Hello,I have found a difference between the PLL input frequency specification between the datasheet of the L4S5 :And CUBEMX data :Datasheet limit is at 16MHz, CUBEMX limit is at 8MHz.Is there any errata sheet tht specify this difference?Thank you for your answer,Sincerely,Guillaume
I am working on a project using STMCubeMX and an STM32G4 i would like to remap the MISO and MOSI pins, if I were to remap PB4 -> SPI_1_MISO to SPI_1_MOSI and viceversa with PB5 -> SPI_1_MOSI to SPI_1_MISO. I have a Custom PCB with two STM32G4 communicating over SPI, by mistake I have connected PB4 coming from the master device to PB5 on the slave device , and now I am just wondering if it is possible to remap those two pins, according to the datasheet it does not look promising. As shown here: PB4 has to be SPI_MISO and PB5 has to be SPI_MOSI. Does anyone know about a workaround for this ? Thanks
Hi,I'd like to report a bug in code generation of CubeMX when using encoder mode with remapping of CH1 and CH2 and LL drivers. I use STM32CubeIDE v1.4.1 and STM32G474.The problem is that the commands to configure the remapping of TI1 and TI2 are split into two calls to "LL_TIM_SetRemap" (example for TIM3):... LL_TIM_SetRemap(TIM3, LL_TIM_TIM3_TI1_RMP_COMP2); LL_TIM_SetRemap(TIM3, LL_TIM_TIM3_TI2_RMP_COMP3); ...The second call to "LL_TIM_SetRemap" erases the setting in the first command (since it uses "MODIFY_REG" under the hood, clearing all remap bits by default).The correct code would be combining the settings in a single command like so:... LL_TIM_SetRemap(TIM3, LL_TIM_TIM3_TI1_RMP_COMP2 | LL_TIM_TIM3_TI2_RMP_COMP3); ...A screenshot of CubeMX configuration example is attached.
I'm using CubeIDE 1.4.2 and created a new project with the setting "copy only the necessary library files".After creation, I see there are 21 header files in the project's subdirectory \Drivers\CMSIS\Include\ . Most of them are definitely not needed as they are CMSIS definitions for e.g. different ARM cores or compilers. When I delete the unnecessary ones, compilation still works fine.However, after every code generation from the .ioc file in the Device Configuration Tool, all those unneeded files are again created although they are never used. The IDE does have all the info to know which files are required, so what is the point in cluttering the project with all those headers? Can I somehow disable this?
Hello,it seems cube 5.3.0 generates broken code for the ADC config.the ADC_InitStruct.Clock is never written to CFGR2, and CFGR2 is never written.Any suggestion why ? is this a problem from Cube code generation ?in adc.c : in adc.c : ADC_InitStruct.Clock = LL_ADC_CLOCK_SYNC_PCLK_DIV4; .. LL_ADC_Init(ADC1, &ADC_InitStruct);then stm32f0xx_ll_adc.c :ErrorStatus LL_ADC_Init(ADC_TypeDef *ADCx, LL_ADC_InitTypeDef *ADC_InitStruct) { ErrorStatus status = SUCCESS; /* Check the parameters */ assert_param(IS_ADC_ALL_INSTANCE(ADCx)); assert_param(IS_LL_ADC_CLOCK(ADC_InitStruct->Clock)); assert_param(IS_LL_ADC_RESOLUTION(ADC_InitStruct->Resolution)); assert_param(IS_LL_ADC_DATA_ALIGN(ADC_InitStruct->DataAlignment)); assert_param(IS_LL_ADC_LOW_POWER(ADC_InitStruct->LowPowerMode)); /* Note: Hardware constraint (refer to description of this function): */ /* ADC instance must be disabled. */ if(LL_ADC_IsEnabled(ADCx) == 0U) { /* Configuration of ADC hierarchical
Hello,I updated to CubeMX 6.0.0 and CMSIS 5.7.0 today.The code containing FreeRTOS and LwIP, which I previously created with CubeMX 5.6.1, is no longer working.FreeRTOS gets stuck in vPortValidateInterruptPriority () function in port.c file in about 2 seconds.I made the priority of my own cuts 5 because it says there is a problem with cuts. but it has not improved.When I activated FreeRTOS before, interrupt priorities changed automatically. therefore I cannot be sure that all interrupts are at the right priority.Does anyone have an idea how to fix the problem?
Hello,I'm developping a software where some timers are totally configured through STM32CubeIDE and others totally configured through registers. I'm getting errors concerning the register configured timers. Here is an example :../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:649:31: error: expected identifier or '(' before 'TIM_TypeDef'I'm wondering if STM32CubeIDE code and register code is possible! Can someone help me?Regards,
I'm implementing a TCP/HTTP server on a custom board with a LAN8710A PHY. The board is connected to a PC via an ethernet cable with static IP assigned on both sides. I'm stuck at Netconn_accept() (when I enable LWIP_SO_RCVTIMEO I see that Netconn_accept times out). On Wireshark I can see ARP request from the PC and the correct ARP response from STM. I also see a SYN request from the PC, followed by TCP retransmissions of SYN, but STM never responds back with an ACK. I don't know for sure if the ACK request ever gets to STM. Unfortunately I haven't been able to get USB_OTG to work either so I can't see any LWIP debug messages other than setting breakpoints.I know this is not a new issue from all the online discussions I've come across, and it is a mystery to me why some get it to work and many don't, following essentially the STM examples. I'm hoping someone skilled with the art can give me some pointers given the symptoms I described above.
I have already enabled the LWIP but IGMP not able to enable.
CubeMX produces different results when re-running code generation without any changes applied.Steps to reproduce:Create a CubeMX project. I'm using all default settings, except for STM32CubeIDE as Toolchain / IDE.Run code generationSave commit output to gitRun code generation againObserve these differences:git diff --stat test1/.cproject | 2 +- test1/.mxproject | 16 ++++++++-------- test1/STM32F413ZHTX_FLASH.ld | 4 ++--The differences appear to just be due to shuffling things around and adding whitespace, but it would be best if the tool behaved more predictably and wouldn't introduce all this unnecessary noise into project history.System info:OS : Ubuntu 20.04STM32CubeMX version: 6.0.1
hi, Dear, how can I use usart + dma? I make the project by stm32cubeMx and add some code in main function as below: but it run fail and show a dma transfer error(Show as addition files: RunHere.png). Looking for your reply , Thank you! /* Infinite loop */ /* USER CODE BEGIN WHILE */ uint32_t ticko = 0; uint32_t t = 0; char buf[256]; while (1) { if (HAL_GetTick() - ticko > 1000) { ticko = HAL_GetTick(); sprintf(buf, "test uart and dma: time:%d\n", t++); HAL_UART_Transmit_DMA(&huart1, buf, strlen(buf)); //HAL_StatusTypeDef HAL_USART_Transmit_DMA(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size); //HAL_USART_Transmit_DMA(&huart1, buf, strlen(buf)); &nbs
Hi,I have a project using an H7 which is handling multiple tasks. One of them is to generate 3 pairs of PWM signals through TIM1. Everything is working fine, however I am not satisfied with the level of control I have on the system and I am looking at increasing the resolution of the PWM duty cycles.I first though of using the HRTIM built into the H7 but sadly, it would only double my resolution (basically from 0-5000 to 0-10000). So I ordered an F334R8 which has a DLL on top of its already decent HRTIM1.I am not discarding the H7 which I need for other tasks, so I will connecting both the H7 and the F334R8 through SPI (Eventually, they will be on the same PCB with short traces). I have good experience with SPI and feels like this will do the job fine.So I am looking at configuring the HRTIM1 on the F334R8 for 3 pairs of complementary PWM signals. These drive a DRV8301 3phase driver.Again I have everything working fine with the H7, however I am struggling a little with the HRTIM config
Hi,Currently I'm working with a CubeMX project in which STM32F105 acts as a USB Host and communicates with USB flash drives. The problem is after detecting attached device and getting device speed successfully the enumeration stage fails. Tracing down the problem I see that when the host try to send out a packet to get the description of max packet size the TX channel is halted and the transaction error code HC_XACTERR is returned in HCD_HC_OUT_IRQHandler(). I'm using a custom board which works well with an old USB library, so I conclude that the hardware is correct and the problem lies within the CubeMX setting or USB library. Can anyone suggests about this problem? Here is a few more details of my project and what I've tried so far:- Hardware: USB DP and DM are connected directly to the USB port without any pull-up resistor, the USB device is powered by a fixed 5V bus.- CubeMX version: 5.3.0. Firmware package version: STM32Cube FW_F1 V1.8.0. IDE: Keil v5.28.0. - Pinout&configurat
Hello,I am using DISCO-F469I, and stm32CubeMX, when I finished all setup, and generate code. I found there is no systick handler in stm32f4xx_it.c, then I checked the NVIC configuration in cubemx, the time base (system tick timer) doesn't selected. however this situation doesn't happened on other MCUs, like F767, it will be selected automatically. so is it normal, or it just happen on F469?thanks in advance.
Hi !I'm using the USB CDC IP as simple USB to serial converter but I don't want to implement the needed CDC functionalities.Under Linux this leads to a blocking of the virtual com port /dev/ttyACMx for several seconds due to the modem manager tries to interact with my "non-modem" TTY device.Don't know if this is really the right way to do but setting the descriptor value for /* bInterfaceProtocol: Common AT commands */from 0x01 to 0x00 "solves" this issue (e.g. https://github.com/solokeys/solo/issues/62#issuecomment-474178352)Therefore I'm looking for a way to overwrite the generated USB descriptors in Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.cBest regards,Michael.
If I natigate to "Pinout & Configuration > System Core > NVIC" I get a table of interrupts. This table shows those which have been enabled, their preemption priority and subpriority. Some of the priority entries have a note "Managed by RTOS". Yes I am using FreeRTOS Middleware.On the whole I am inpressed how integrated things are but to my dismay I cannot alter the Priorities from "0". This means there will be a failue if any FreeRTOS function is called during an interrupt such as giving a semaphore "xSemaphoreGiveFromISR()". FreeRTOS checks the priority of interrupt and if a higher priority than a set level will apply an assert.I can manually set the priority but that has to be done every time I run STM32CubeMX and not desirable.How can I enter the correct priority and more's the point why is it set to 0, when MX has already decided the highest allowed?One thing to note is that this project has been upgraded from earlier versions and I'm wondering if this is an associated is
I can't find out downloading STM32CubeMX for Mac OS. Where is it?
1) CubeMX create a usart type port, without opportunity to use UART_AdvFeatureConfig(); I implemented by myself the setting of MSBFIRST bit and works fine.2) using USART2 in synchronous mode, on the read operation tx and rx lines are exactly equal and on both ones I get wrong voltage level on (using oscilloscope)
In CubeIDE 1.4 in the graphical configurator, using a STM32F091, if you select the PA8 pin function as MCO,the generated code in main.c / GPIO init will configure the pin as AF0 with LOW speed.This should really be HIGH speed, it doesn't get any higher than the system clock frequency ;) And you won't see much on the scope with that limited analog bandwidth, when you configure this for the purpose of checking whether the MCU really runs at the desired clock speed.
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.