Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi. I am using NUCLE-F439ZI board STM32CubeIDE Version: 1.16.0Build: 21983_20240628_1741 (UTC) Lately I am experiencing problem, when I make changes in .IOC file and save and generate code it is messing my main.c file. It is copying big portion of main.c lines and adding them again in main.c file. It is impossible to continue working. Is this a setting problem or a bug in the software? Please help. Thank you. Rasem
Hi, I am using an H743 coupled to W9825G6KH-6 (256MBit SDRAM) Everything works fine on my 1024x600x16bit (RGB565) display with a single buffer held at 0xC0000000, however when I enable double buffering with the second buffer at 0xC012C000 (1024x600x2 added to first buffer address), I get the following error handle occur from the DMA: DMA2D Xfer ErrorCallbackAnd obviously Touch GFX doesn't continue. Anyone else come across this, or where I could start looking? Thanks n advance, Matt
I want to create a flexible signal shape that can be viewed using an oscilloscope by making a program. I am using an array to form the signal, such as {2048, 4026, 2048, 0}, where 2048 represents the flat line I want to adjust, 4026 represents the peak, and 0 represents the valley. I want to adjust the value of 2048 flexibly; for example, if I input x=3, it should output {2048, 4026, 2048, 2048, 2048, 0}. However, I am confused about how to use the for loop or if statements because I want to place the value in the middle. I need help with my code; please provide suggestions or possibly an example code. That is the description of what I want to create, and here is my code.The code that I commented on is the part that I want to make flexible. #define NS 333 uint32_t Wave_LUT[NS] = { 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048,
I installed STM32CubeMX under macOS (11.6.6). When I click "about STM32CubMX" a box pops up:javaVersion 1.0 (11.0.10)When I click "Generate code" I'm getting a box saying "/Users: permission denied"
I am trying to get dual 500kbps CAN working on the STM32F105R8T6. I am using CubeMX with HAL V1.6.1. CAN1 receive works and CAN2 transmit works but I cannot seem to get the CAN2 Rx interrupt to trigger.I have probed the Rx pin on the transceiver (MCP2562) and the frames are present but still no interrupt.Here is the setup code for both modules:/* CAN1 init function */ void MX_CAN1_Init(void) { hcan1.Instance = CAN1; hcan1.Init.Prescaler = 1; hcan1.Init.Mode = CAN_MODE_NORMAL; hcan1.Init.SJW = CAN_SJW_1TQ; hcan1.Init.BS1 = CAN_BS1_13TQ; hcan1.Init.BS2 = CAN_BS2_2TQ; hcan1.Init.TTCM = DISABLE; hcan1.Init.ABOM = DISABLE; hcan1.Init.AWUM = DISABLE; hcan1.Init.NART = DISABLE; hcan1.Init.RFLM = DISABLE; hcan1.Init.TXFP = DISABLE; if (HAL_CAN_Init(&hcan1) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } // Configure the filter for CAN 1 CAN_FilterConfTypeDef sFilterConfig; sFilterConfig.FilterNumber = 0; sFilterConfig.BankNumber = 14; sFilterConfig.Fil
STM32CubeMX and STM32Cube_FW_H7RS_V1.1.0 has some issue, when I configure USB HS Device, the code mix some functions, such as GPIO config code etc, when I add the GPIO config it can't work either.when the issue could be fixed??
Using STMCubeMX 6.12.0We're hoping to setup a CI pipeline using the CubeMX command line functionality and are having problems downloading and installing FW packages among other things.I've followed the connection setup instructions and get the green check mark saying it works.I've found that interactive mode described in the manual does not work. As suggested in this post it does in fact launch into the CubeMX application/IDE. As I understand the following command should result in a MX> prompt but does not.& "$env:STM32CubeMX_PATH\jre\bin\java" -jar "$env:STM32CubeMX_PATH\STM32CubeMX.exe" -i The manuals suggest using the following commands to download and install FW packages:I've placed those commands in a scriptswmgr install stm32cube_f4_1.28.0 askexitand executed the scrip via PowerShell:& "$env:STM32CubeMX_PATH\jre\bin\java" -jar "$env:STM32CubeMX_PATH\STM32CubeMX.exe" -q .\myscriptWhich results in the following error:..... [Lots of noise omitted]swmgr install stm32c
Hi guys,I am trying to run a demo on STM32U083C-DK board. This demo consists of LPTIMER generating PWM that is used for synchronization of I2C read from on-board temperature sensor. Rising edge writes the addres of read and falling edge reads data. The main issue I have encountered is that my synchronization setup works perfectly with UART transmit but with I2C no matter what I try I don't ever get transmit on the I2C bus.What I checked:- LPTIMER NVIC is on and is able to start UART synchronization- I2C DMA works when software triggered. (with synchronization disabled)DMA setup for I2C DMA:LPTIMER config:Logic analyzer output:Where D0 is SDA, D1 is SCL and D2 is LPTIMER outputThis is the main and initialisation of I2C:I2C_HandleTypeDef hi2c1; DMA_HandleTypeDef hdma_i2c1_tx; DMA_HandleTypeDef hdma_i2c1_rx; LPTIM_HandleTypeDef hlptim1; union { uint8_t temp_raw_8[2]; int16_t temp_raw_16; }temp_raw; uint8_t stts22h_temp_l_out = STTS22H_TEMP_L_OUT; STTS22H_IO_t stts22h_io; STTS22H_O
I am considering using MbedTLS in a project. My concern is that the version in STM32CubeMX is 2.16.2 which is quite old (Jun 2019). They just released v3.0.0 last month which I believe supports TLS1.3. How long does it take for ST to update the version in CubeMX?How would I go about using a newer version of MbedTLS? Seems I have 2 choices. One would be to build the project with the ST version, then update the files manually with the new version of MbedTLS - and quit using CubeMX. Or I could just add the new version of MbedTLS to my project without using the Middleware in CubeMX. Then presumably, I could keep using CubeMX as needed. Anything I'm missing?Thanks,Mike.
Hi,I'm trying to combine the SPI and GPDMA on STM32U5. In the various SPI transfer APIs with suffix '_DMA', I can see the code below: /* Enable the Tx DMA Stream/Channel */ if ((hspi->hdmatx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) { if (hspi->hdmatx->LinkedListQueue != NULL) { /* Set DMA data size */ hspi->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hspi->TxXferCount; /* Set DMA source address */ hspi->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)hspi->pTxBuffPtr; /* Set DMA destination address */ hspi->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)&hspi->Instance->TXDR; status = HAL_DMAEx_List_Start_IT(hspi->hdmatx); } else { status = HAL_ERROR; } } else { status = HAL_DMA_Start_IT(hspi->hdmatx, (uint32_t)hspi->pTxBuffPtr, (uint32_t)&hspi->Instance->TXDR, hspi->TxXfer
Target Board: STM32H743ZI2 NucleoSTM32CubeMX: V6.11.0 Hallo community,I'm encountering an issue about migration. When I migrated my STM32CubeMX project from V6.10.0 to V6.11.0, the setting for ADC3 was disabled in the new *.ioc files. In my old ADC3 settings, I was using the Temperature Sensor Channel on the chip. But after the update to V6.11.0, the setting for Temperature Sensor Channel in the ADC3 is missing. All the settings of ADC3 for the temperature sensor are missing, and there is no ADC channel 18 under ADC3 to set (The inner temperature sensor is connected to ADC channel 18).I've also checked the STM32CubeMX 6.11.0 release note and errata. There is no such an issue reported.I put the two screenshots in the attached files. Best wishes,
Hi,I'm using STM32G473 ADC and trying to feed its clock from the PLL P clock. I am not able to select a clock divider of 1 or 2 even when the PLL P clock is set rather low (11.2 Mhz). This is my clock configuration: This shows CubeMx not allowing an async clock with divider of 1 or 2, only 4 and higher: For reference, these are the frequency limits of the ADC from the datasheet:Specifically, I'm at the 52 MHz max spec (single ended, multiple ADC's) but whatever CubeMX thinks my limit is, I'm not sure why I can't divide-by-1 a 11.2MHz clock! Is this a bug and I should use manual lines of code overriding what CubeMX does? or am I missing something in my understanding of the ADC clock?p.s. my goal is to get as close to my limit of 52 MHz as possible. The 11.2 MHz setting shown above was just to debug CubeMX's weird behavior. Thanks!
When generating a new project for an STM32H573RIT6 MCU with Trustzone enabled and boot path STiROT -> STuROT -> non secure app, I get this warning:"The provisioning scripts are only supported for DK boards (Or custom boards with the same flash and same pin mapping. Are you sure to have this kind of board?"There is no dev board for this MCU, so I wonder if the provisioning script produce actually something useful.Can you highlight when this message can actually be ignored? Obviously the pinout will be different in a custom project. How does this affect the provisioning scripts, though? Could the scripts be manually adjusted in some file if needed?STM32CubeMX version: 6.12.0 Update:Another question: When generating the project type "cmake", I get this error in addition:"- CMAKE is not supported for a project with any configured boot path."Will this change in the future? This would simplify integration into pipelines a lot.
Hi,I’m encountering an issue with linker file generation in STM32CubeMX for the STM32H56VGTX MCU. When I generate the code using CubeMX, it produces linker files configured for the STM32H563xx family, which has 2048 kBytes of Flash memory. However, the STM32H56VGTX has only 1024 kBytes of Flash memory.I’ve attached the linker files in .txt format that CubeMX generates for reference. Does anyone know why this happens? I understand that I can manually adjust the linker file to resolve the issue, but I’d prefer to fix the problem with the automatic generation to avoid potential issues and errors in the future. Thank you in advance.
如题,在我使用H743XIH6时,我想使用FMC外设,但是我不太想用默认的PF0,PF1作为地址线,我想使用PG0、PG1作为地址线,但是我在MX中无法修改满足上述需求,在最后的代码生成中,他们是叠加在一起初始化的。而我取消PG0、PG1的话,则FMC外设也一起被取消了
Hi,I am using the STM32L031F6 MCU and have configured the internal clock, which is working properly. However, I need to configure the external clock. We observed a pin conflict when changing to the external clock configuration because we are using the PA0 pin for another purpose. In this situation, is it possible to configure the external clock?Below is the RCC configuration:Clock configuration
Hi Testing CubeMX 6.12.0 and found a bug. This may exist in other editions. The code generator improperly places the user code comments in the final while(1) loop. This causes MX (and its integration into IDE) to delete all user code. While testing in IDE, the correct comments will prevent the code from getting deleted. Please see a snip from CubeMX code generator below: ========THIS IS WHAT CUBEMX 6.12.0 GENERATES ========= /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ ===========THIS IS WHAT IT *should* GENERATE ======== /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE BEGIN 3 */ /* USER CODE END 3 */ } /* USER CODE END WHILE */ ================== Can you please address this ASAP? Thank you!
Hi, I'm giwon KIM in South Korea. I'm using NUCLEO-401RE board. In STM32F401RE datasheet and reference manual, It is said to be capable of operating at up to 30 MHz.So its conversion time was set by calculating (12+3) / 30 MHz = 500 nsec.I generated a sine wave of 250Hz and advertised it, but as calculated, I had to get 8000 samples per cycle, but I only got about 1300.Is there a reason for this?Below is actually a waveform drawn with Excel by acquiring a cycle sample. And this is my ADC1 init function. /*** @brief ADC1 Initialization Function* @param None* @retval None*/static void MX_ADC1_Init(void){ /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)*/hadc1.Instance = ADC1;hadc1.Init.ClockPrescaler = ADC_CLOC
Hello, I have a custom board with STM32F407 CPU, LSM6DSV16XTR accelerometer+gyroscope and LIS2MDLTR magnetometer.I aim to get board inclination and the position of the north using the magnetometer for a telescope. Using CubeMX, I have enabled the LSM6DSV16B and the LIS2MDLTR in the Middleware package. When generating, CubeMX removes the I2C1 initialization from main. But I need the I2C1 peripheral for other devices in the board, not only for MEMS. What is the correct way to manage this? Thank you.
Hello, my team and I are using STM32CubeMX v6.10.0 to generate a Keil project and hardware initialisation code for our embedded project. We've been using it for about six months and it mostly works fine.But recently, I made some configuration changes in the .ioc, regenerates the Keil project, and I noticed a LOT of modified XML tags in the Keil .uvprojx file with a git diff:I thought I've done something wrong so I tried different things but I always ended up with the same result. Here is a non-exhaustive list of my attempts:- discard all changes in the git repository to get back to a clean state, and generate code- install more recent versions of STM3CubeMX (6.11.1 and 6.12.0) and generate code- delete .mxproject file and generate codeNone of these works. We also have our toolchain folder in a custom location, shared between developpers, and for some reason CubeMX nows adds those file to the Keil project sources, while it used to completly ignore them (we had to add them by hand).
I am looking at the STM32G431K6T6 and on the web page:STM32G431K6 - Mainstream Arm Cortex-M4 MCU 170 MHz with 32 Kbytes of Flash memory, Math Accelerator, Medium Analog level integration - STMicroelectronicsIt has which package to download: STM32CubeG4 - STM32Cube MCU Package for STM32G4 series (HAL, Low-Layer APIs and CMSIS, USB, File system, RTOS, Graphic - and examples running on ST boards) - STMicroelectronics I'm planning on using the STM32Cube IDE. Can you please help me find the instructions on how to install this package? Thank you very much,Joe
I want to generate an interrupt on the rising edge of PI0 on the M4 CPU.Unfortunately, when I program the GPIO With ARM Cortex-M4 pin context assignment, the code generated is as follows in gpio.c: EXTI_InitStruct.Line_0_31 = LL_EXTI_LINE_0; EXTI_InitStruct.Line_32_63 = LL_EXTI_LINE_NONE; EXTI_InitStruct.Line_64_95 = LL_EXTI_LINE_NONE; EXTI_InitStruct.LineCommand = ENABLE; EXTI_InitStruct.Mode = LL_EXTI_MODE_IT; EXTI_InitStruct.Trigger = LL_EXTI_TRIGGER_RISING; LL_EXTI_Init(&EXTI_InitStruct);and in stm32h7xx_it.c:void EXTI0_IRQHandler(void) { ... if (LL_EXTI_IsActiveFlag_0_31(LL_EXTI_LINE_0) != RESET) { LL_EXTI_ClearFlag_0_31(LL_EXTI_LINE_0); ...But this is incorrect because while both init + IRQ executes on the M4, it programs the M7 interrupts delivery.The correct way to make it work is to replace the following is the code above:LL_EXTI_MODE_IT => LL_EXTI_MODE_C2_ITLL_EXTI_IsActiveFlag_0_31() => LL_C2_EXTI_IsActiveFlag_0_31LL_EXTI_ClearFlag_0_31 =>&n
Hello dear community,I'm interested in the en.x-cube-gnss1 middleware package as I'm developping a solution based on a custom GPS module.For me, this ST package is a good starting point to write my own package. More over, I would want to use it with Azure RTOS.So,In a first attempt, I configured a sort of "generic" project around the STM32U5A9J-DK / en.x-cube-gnss1 and generate the code to see how it works. In my case, the GPS module is wired to STM32 thought LPUART1As I understood, when starting the app creates 3 threads:190: ret = tx_thread_create(&teseoConsumerTaskHandle, "TeseoConsumerTask", TeseoConsumerTask, 0,211: ret = tx_thread_create(&backgroundTaskHandle, "BackgroundTask", BackgroundTask, 0, 231: ret = tx_thread_create(&consoleParseTaskHandle, "ConsoleParseTask", ConsoleParseTask, 0,In a trial purpose, I just added one extra menu in the CLI (located in /GNSS/App/app_gnss.c)static void AppCmdProcess(char *com) to have the hability to send one c
An Stm32 ide project was made in our company. The person who did it left the company. We can't find the ioc file (as we want to change some things in the mx project). Is there a way to recreate the ioc from the existing CubeIDE project? Thanks in advance.
I have been trying to get the CMSIS DSP FFT function to work on my NUCLEO-F446RE and have a confusing observation after hours of troubleshooting: when I try to use 128 points for the FFT data I get a Hard Fault, but change the number of points to 256 or 512 and it works as expected. I'm only using sample data of a sin wave so no changes other than number of points.Has anyone seen this before? As I step through trying to debug why 128 points doesn't work it looks like the arm_rfft_fast_init_f32() call is the issue. No doubt related, but when I try to Step Into the rfft_fast_init() call I get the following error:Can't find a source file at "C:\Users\clamar01\fork3\CMSIS_5\CMSIS\DSP\Projects\GCC/../../Source/TransformFunctions/arm_rfft_fast_init_f32.c" Locate the file or edit the source lookup path to include its location.Funny thing is I don't know who user clamar01 is...no user on my computer. I added the DSP module from X-CUBE-ALGOBUILD.Snippet below of key statements in my sample
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.