Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi there, I have been developing a CubeMX generated project in TrueStudio for the STM32H7 EVAL board.I would like to get the same project running on the H7 Nucleo board, and then eventually on my own hardware. I'd like to keep configurations for all three boards in a single project and select the configuration I want to compile for. Is it possible to have multiple configurations in a single CubeMX project?Is it possible to have multiple configurations like this in TrueStudio, and if so, what is the easiest / best way?Many thanks!Matt
I want to send 10 bytes of data through UART loopback by interrupt mode. Though I'm able to receive the data, I don't understand why my HAL_UART_RxCpltCallback() is not getting executed. But my HAL_UART_TxCpltCallback(), is getting executed every time after a byte of data is transferred. I've generated code through cubeMX. I've enabled the USART2 global interrupt. My Control Register(CR1) for my USART2 is 0x300c. That is, UE,M,TE,RE bits are only set. The TXIE, TCIE bits are NOT set in the CR1 Register. Now, What does "global" in global interrupt mean here? Does that mean an interrupt is generated from any one of the 10 sources(mentioned in the data sheet like, Tx complete, Rx buffer full etc)?None of the bits corresponding to interrupts are enabled in CR1 register. But the control is going to HAL_UART_TxCpltCallback() every time it transfers a byte of data. Why does this happen?Please unveil the mystery.Below is my code.UART_HandleTypeDef huart2;void SystemClock_Config(void);static vo
Hello,I downloaded the new CubeMX from the ST site, launched the installer (as the root user) and started the application. It can't start, it hangs at startup. Here are the logs obtained at app startup:chdir /home/kacper/STM32CubeMX/.current dir /home/kacper/STM32CubeMXlog4j user configuration file not found: /home/kacper/.stm32cubemx/log4j.propertiesConfigure log4j with default settings from jar:file:/home/kacper/STM32CubeMX/STM32CubeMX!/log4j/log4j.stm32cubemx.properties2018-12-20 14:38:09,772 [INFO] MicroXplorer:486 - Detected Java Version = 1.8.0_1912018-12-20 14:38:09,778 [INFO] ApplicationProperties:181 - Using Application install path: /home/kacper/STM32CubeMX2018-12-20 14:38:09,790 [INFO] DbMcusXml:68 - Set database path to: /home/kacper/STM32CubeMX//db//mcu/2018-12-20 14:38:09,796 [INFO] DbBoardsPdsc:54 - Set plugin database path to: /home/kacper/STM32CubeMX//db//plugins/boardmanager/2018-12-20 14:38:09,796 [INFO] DbMcus:262 - Set plugin images path to: /home/kacper/STM32CubeM
I have a fairly simple project defined in CubeMX based on one of the H7-series of STM32 parts. This project utilizes a number of peripherals and DMA channels, including the MDMA and RTC peripherals.As I configured an additional DMA channel for a USART, CubeMX seemed to "break down" at this, and began overlapping several function calls when they were generated. It also began to leave one call in main() out each time I regenerated code. Upon further inspection, I realized that each time I save my project, even without any changes to my project settings, I can cause CubeMX to reorder the items in the "Project Manager"->"Advanced Settings" page. Additionally, it doesn't contain a "3" rank item, and it continually swaps between showing any two of the "MX_DMA_Init", "MX_MDMA_Init", or "MX_RTC_Init" functions.It's extremely bizarre behavior, and it's giving me far less confidence in my generated code if there's weird faults going on during the process that are seemingly uncontrollable by m
..
Hi, everyoneI am using the STM32CubeMX for the first time.I have a problem with clock configuration on it.But I do not know why the problem is occurring.I need help.Best regards,
The base software was set up using CubeMX. On an STM32L433, I have the ADC configured to read 4 channels into a DMA. The sampling is ADC_SAMPLETIME_6CYCLES_5 for all channels. The DMA is set up for a WORD transfer into a buffer: uint32_t dmaBuffer[4];and a callback is set up to copy the dma buffer to another buffer . The DMA is started with this:HAL_ADC_Start_DMA(&hadc1, (uint32_t*)dmaBuffer, 4);This is the ADC setup parameters: hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc1.Init.LowPowerAutoWait = DISABLE; hadc1.Init.ContinuousConvMode = ENABLE; hadc1.Init.NbrOfConversion = 4; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALT
Hi everyone,On my system, there is cloud station backup working in background, so each file that is modified is back-up on distant synology server.This works very fine...Problem is, if starting code generation of STM32CubeMX, code generation starts and STM32CubeMx hangs up... and even task manager can not shut it down. It needs to restart PC.After many trials, I found out that I need to pause cloud station backup while code generation.Cloud station backup as no option to delay backup. All my other programs work fine, also compilers, ...Is there any possibility in STM32CubeMX to avoid the crash ?Thanks in advance, Alexandre
In the generated GPDSC file the path "..\..\Drivers\CMSIS\Include" is missing. Is there a special reason for this issue?
The project was create in CubeMX of earlier verson 4.29.0 , and it can easily to generate code. But a couple of days earlier, I need to add a new pin to the project. So I added the pin configure in CubeMx of Verson 5.0.0. When I generate codes, tips above happens. So how to solve the problem.
Hello:I am using the STM32L433 device.In CubeMX, I am using ADC1 channels 5,6,9 and 15. Other than the yellow highlights, there are no conflicts. Under ADC Settings, for ScanConvMode, it only has "Disable" in the drop-down list. Why is this? Another setting needs to be first changed?
Hi,I am setting the Nucleo-H743ZI board with STM32 CumbeMX and when trying to compile the code with Atolli I am getting ..\Drivers\CMSIS\DSP\Source\BasicMathFunctions\arm_dot_prod_q7.c:29:22: fatal error: arm_math.h: No such file or directoryI see other users having this issue for long time but didn't find a clear working solution for this issue.I added some packs (not sure which one is needed but the problem still exists).The .IOC is attached.
My environment is Nucleo-F446RE with STM32CubeMX 5.1 / TrueSTUDIO 9.3.I created an I2S master transmit test program. [Full project archive is here]Transmission Mode / Mode Master TransmitCommunication Standard / LSB First(Right Justified)Data and Frame Format / 16 Bits Data on 16 Bits FrameSelected Audio Frequency / 48KHz(*I2S cloks is 61.44(8MHz /5 * 192 /5)MHz)/* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ #define I2S_CODE 0b1010110011110000 #define I2S_BUFFER_SIZE 64 #define I2S_BUFFER_HALF_SIZE (I2S_BUFFER_SIZE / 2) uint16_t buffer[I2S_BUFFER_SIZE]; void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s) { uint16_t *sp = buffer; for(int i = 0; i < I2S_BUFFER_HALF_SIZE; i++) *(sp++) = I2S_CODE; } void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s) { uint16_t *sp = buffer + I2S_BUFFER_HALF_SIZE; for(int i = 0; i < I2S_BUFFER_HALF_SIZE; i++) *(sp++) = 0x00; } void StartI2STransfer() {
18:03:10 **** Rebuild of configuration Debug for project 190320_STM32_motor_test_1shunt ****Info: Internal Builder is used for buildarm-atollic-eabi-gcc -c -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=gnu11 -DARM_MATH_CM4 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F302x8 -I../Inc -I../Drivers/STM32F3xx_HAL_Driver/Inc -I../Drivers/STM32F3xx_HAL_Driver/Inc/Legacy -I../MCSDK_v5.3.3/MotorControl/MCSDK/MCLib/Any/Inc -I../MCSDK_v5.3.3/MotorControl/MCSDK/MCLib/F3xx/Inc -I../MCSDK_v5.3.3/MotorControl/MCSDK/UILibrary/Inc -I../MCSDK_v5.3.3/MotorControl/MCSDK/SystemDriveParams -I../Drivers/CMSIS/Device/ST/STM32F3xx/Include -I../Drivers/CMSIS/Include -IC:\Users\Mando\Atollic\TrueSTUDIO\STM32_workspace_9.3\190320_STM32_motor_test_1shunt\TrueSTUDIO\User -Ofast -ffunction-sections -fdata-sections -g -fstack-usage -Wall -specs=nano.specs -o Drivers\CMSIS\DSP_Lib\Source\MatrixFunctions\arm_mat_mult_fast_q15.o ..\Drivers\CMSIS\DSP_Lib
Hello,Using STM32H753VITx with STM32CubeMX 5.1.0, I would like to use SAI1-A as 'Master with MCO' and external synchro out, and SAI4-A as synchronous slave.SAI4-A doesn't show the synchronous slave option.Alternatively I could do it the other way round, with SAI1-A slaving synchronously to SAI4, but that doesn't appear as an option either.With the LQFP144 and LQFP176 packages I can select these options.I don't believe there is a pinmux issue, as the SAI1/4 data pin is not used by any other SAI.Is this just a problem with CubeMX or is there an underlying limitation of the LQFP100 package that is causing this?Thanks and best regards,Kieran.
Hi,I have stm3241g-eval board and I created very simple project with it using CubeMX, the latest version. Just USB HS and FreeRTOS enabled and created code. Then Started TrueStudio, also latest version, and opened project from file system.Now when I try to build the project at first I get fatal error: arm_math.h: No such file or directory.The arm_math.h is under the project at \Drivers\CMSIS\DSP\Include\. The problem occures from arm_convolve_HWC_q7_basic_nonsquare.c and if I change the include path to absolut path it works. After that I get another similar error, and again if I fix that I get another error. The same goes on and on.I have rebuild the index and when I do the error changes from one header to another.What should I do? With google I found that others have similar problems but didn't found the solution yet.
STM32CubeMX Board Selector does NOT show NUCLEO-G071RB, so I select MCU Selector and search STM32G071RB. STM32CubeMX shows NUCLEO-G071RB on Board Colum.I click NUCLEO-G071RB and I Start Project, Initializing all peripherals with their default Mode YES.Pinout & Configuration is shown but there is NO GPIO such as LD4 (PA5), SW4 (PC13).Question: Is this NO GPIO correct or BUG?My Environment is, STM32CubeMX: 5.1.0, STM32G0 package: 1.1.0, TrueSTUDIO: 9.3.0.
New interface of CubeMX is fancy, but how am I supposed to use it on the screen with resolution lower than full hd? The idea that all the information should be on the screen simultaneously is so useful on small resolution screen. Is there a way to switch it back to windowed interface?
After generating code for STM32F031K6 in MDK v5 Cube sets target as STM32F031K6Tx, but in CMSIS pack it is just STM32F031K6Similar problem is with 334 seriesYou have to change the target every time you regenerate code. Previously there was no problems with this
Hello, The problem below has been solved.There is no problem with the attached source code and the individual environment.The problem was the board itself that I had.Thank you for your interest.Best regards.Song===========================================================================Hello.I have a problem initializing CAN communication through the HAL library on STM32CubeMX, so I'd like to ask you about a related issue.First of all, the development environment that I use is:- MCU: STM32L443CCT6- Computer: IAR EW ARM 8.32.1.18631- Initialize CAN communication: 500 Kpbs- Code generation tool: STM32CubeMX (HAL STM32Cube FW_L4 V1.13.0)I have already successfully initialized CAN communication on the STM32F303CC chip without difficulty and data transmission in the same development environment as above.Based on the above successful example, I generated an initialization code for CAN communication on the STM32L443CCT6 chip currently being developed.This generated code is a simple cod
I'm running MacOS Mojave 10.14.3, trying to install STMcubeMX 5.1.0. I had to install Java 6 legacy and also JRE 8 build 201. When I try to install from the "en" directory created by the STM32cubeMX download using a terminal, here's what I get: (tried <return> as password the first time which was clearly wrong)What am I doing wrong ?computer-name:en userid$ sudo java -jar SetupSTM32CubeMX-5.1.0.exePassword:Sorry, try again.Password:Exception in thread "main" java.lang.UnsupportedClassVersionError: com/st/microxplorer/install/Main : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLo
Hello.I work on Windows on a network drive.The file server is samba which, by default, for files whose name starts with a dot, gives the hidden attribute.After generating the TrueStudio project, the .project and .cproject files are thus given a hidden attribute.When re-generating the project using CubeMX, the following error appears: '' The Code is fully generated under (mypathname), but TrueSTUDIO project generation have a problem. ''I can not change file server settings, therefore I am unable to remove the attribute hidden from the .project and .cproject file.Is it possible the STM32CubeMX will work with the TrueSTUDIO project files that have hidden attributes?
When i generate a project with STM32CubeMx 5.1.0, codes are comes up but the folder below is always empty. Why? I was using the previous version before.\Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates
I've adapted the DAC signal generation example from the HAL samples to my project, but I cannot get any signal from DAC2.Using CubeMX, I configured TIM6 and DMA1 like this:/* Includes ------------------------------------------------------------------*/ #include "dac.h" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ DAC_HandleTypeDef hdac; DMA_HandleTypeDef hdma_dac2; /* DAC init function */ void MX_DAC_Init(void) { DAC_ChannelConfTypeDef sConfig = {0}; /**DAC Initialization */ hdac.Instance = DAC; if (HAL_DAC_Init(&hdac) != HAL_OK) { Error_Handler(); } /**DAC channel OUT2 config */ sConfig.DAC_Trigger = DAC_TRIGGER_T6_TRGO; sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE; if (HAL_DAC_ConfigChannel(&hdac, &sConfig, DAC_CHANNEL_2) != HAL_OK) { Error_Handler(); } } void HAL_DAC_MspInit(DAC_HandleTypeDef* dacHandle) { GPIO_InitTypeDef GPIO_InitStruct = {0}; if(dacHandle->Instance==DAC) { /* USER
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.