Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi, my Cubemx report the following error:Loading: D:\CubeMX_HAL\F429CubeMX.ioc projectInitializing: STM32F429IITx LogicalParser: syntax error detected in expression for DMA orignal expression: ((MemBurst=DMA_MBURST_SINGLE)|(MemDataAlignment=DMA_MDATAALIGN_BYTE&MemBurst=DMA_MBURST_INC4))&((PeriphDataAlignment=DMA_PDATAALIGN_WORD&PeriphBurst=DMA_PBURST_INC4)|(PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD&PeriphBurst=DMA_PBURST_INC8)|(PeriphDataAlignment=DMA_PDATAALIGN_BYTE&PeriphBurst=DMA_PBURST_INC16)) parser evaluation: ((1298.0=1298.0)|(1282.0=1282.0&1298.0=1299.0))&((1281.0=1281.0&1303.0=1303.0)|(1281.0=1280.0&1303.0=1304.0)|(1281.0=1279.0&1303.0=1305.0))
Hi,I'm using stm32CubeMX to configure my STM32F429IITx device but the generated driver doesn't work , I have to substitute by example's driver program. My board cannot call SVC handle so that my RTOS doesn't startup ,I have to use system_stm32f4xx.c‘ old driver instead (unknown version). My I2C, DMA,uart all of cannot work if I dont switch to example driver.Here is my Cubemx capture.
..
The datasheet says PA13 (SWDIO) and PA14 (SWCLK) but there is no "Trace and Debug" category in CubeMX for STM32G030F6.
I haven't checked other MCU, I just did a quick check for F0/F1/F2/F3, all are missing in the example selector in CubeMX.
HI,I set up STM32CubeMX to declare SystemClock_Config as static.However, SystemClock_Config is not declared static.The versions in question were STM32CubeMX 6.3 & STM32Cube FW_F4 V1.26.1.I also tried the latest version of STM32CubeMX 6.5 & STM32Cube FW_F4 V1.27.0, but it didn't solve the problem.Is there any documentation on this issue?
Hi everyone,I am using the NUCLEO-G474RE development board with STM32G474RE MCUThe ioc file is attached, and this is main function:int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG); LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR); /* System interrupt init*/ NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); /* SysTick_IRQn interrupt configuration */ NVIC_SetPriority(SysTick_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),15, 0)); /** Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */ LL_PWR_DisableUCPDDeadBattery(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ &
I'm using STM32CubeMX 6.5.0, MCU STM32L4A6ZGTx on NUCLEO-L4A6ZG, and an Adafruit 4682 Micro SD SPI or SDIO Card Breakout Board. On this board, the card detect line (DET) "is connected to GND internally when there's no card, but when one is inserted it is pulled up to 3V with a 4.7kΩ resistor. That means that when the pin's logic level is False there's no card and when it's True there is."However, the middleware seems to assume the inverse. FATFS\Target\fatfs_platform.c:uint8_t BSP_PlatformIsDetected(void) { uint8_t status = SD_PRESENT; /* Check SD card detect pin */ if(HAL_GPIO_ReadPin(SD_DETECT_GPIO_PORT, SD_DETECT_PIN) != GPIO_PIN_RESET) { status = SD_NOT_PRESENT; } /* USER CODE BEGIN 1 */ /* user code can be inserted here */ /* USER CODE END 1 */ return status; }What is the best way to solve this?For now, I just did this:uint8_t BSP_PlatformIsDetected(void) { uint8_t status = SD_PRESENT; /* Check SD card detect pin */ if(HAL_GPIO_ReadPin(SD_DETECT_GPIO_PORT, SD_DET
Hi, STM32CubeMX is not supporting Steval-mksbox1v1?
I am writing an I2C driver on STM32F407 for the following IC:https://www.ti.com/lit/ds/symlink/ads7828.pdfPage 12 describes how to properly communicate with the device. A1 = 1A0 = 1SD = 1C2 = 0C1 = 0C0 = 0PD1 = 1PD0 = 12 last X bits dont matter so I just set them both to 0.So according to the documentation and my configuration, I should transmit the following sequence to the I2C:1 0 0 1 0 A1 A0 W ACK SD C2 C1 C0 PD1 PD0 X X ACKSo I send:0b10010110 WAIT FOR ACK 0b10001100 WAIT FOR ACKIn my code, I call the following function:uint8_t address_byte = 150; uint8_t command_byte = 140; HAL_I2C_Master_Transmit(&hi2c2, address_byte, (uint8_t*)command_byte, 1, HAL_MAX_DELAY);As you can see from above, I hardcoded address and command byte just for testing purposes:I have connected logic analyzer to the I2C pins and see the following: Which is not correct. I expect to see 150+ack and 140+ack but instead I see 75+ack and 181 + ack.My I2C configuration on CubeMX:
I was having a problem getting the ADC to work in DMA mode on a STM32F103C8 using the default project created by your STM32CubeIDE. As soon as I called HAL_ADC_Start_DMA to start the conversion, the program would crash. The DMA1_Channel1_IRQHandler interrupt handler was never called and it seemed to be vectoring off to some invalid place.Fortunately I had an example project which did work (created by an older version) and by comparing the two I was finally able to isolate the problem. In the project that worked, the SystemInit function in the file system_stm32f1xx.c contained the line: SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */whereas that line was missing from the same file in my newly created project. Adding this line fixed the problem.I am assuming that this missing line caused the interrupt vector table to not be set up properly. The mystery to me is how other interrupt vectors seemed to work fine, just not the DMA interrupt.W
Hi, I'm trying to use IRQ Software calls with Nucleo-F4 boards in STMCubeMx 1.8 environment.The UM1725 - Rev 7, pag. 346, tells me to use the HAL_Generate_SWI.The call, included in stm32f4xx_hal_exti, requires you to define two simple structures: EXTI_HandleTypeDef and EXTI_ConfigTypeDef and the test program seems to work.I have noticed that when I generate the configuration code with MX, the NVIC libraries are still used for interrupts , present in stm32f4xx_hal_cortex. In the Cortex Library there in no SW IRQ generation call.The questions are these:for external interrupts, when to use the library in stm32f4xx_hal_exti and when to use those in stm32f4xx_hal_cortex? Anyone have an example of SWI interrupt handling for F4 models? (nothing in the web) Many Thanks.LV
I seem to be having an issue on my custom board. I upgraded my CubeMX app and now when I attempt to debug the application fails when HAL_RCC_OscConfig is called in method SystemClock_Config at startup. It's consistent every time. I've scoured the configuration files to no avail.
The function LL_CRS_ConfigSynchronization uses:MODIFY_REG(CRS->CR, CRS_CR_TRIM, HSI48CalibrationValue) ;But the delaration of LL_CRS_HSI48CALIBRATION_DEFAULT is:#define LL_CRS_HSI48CALIBRATION_DEFAULT ((uint32_t)0x40U)So the calibration value is set in the lower byte of CRS->CR.But CRS_CR_TRIM is in the high byteSo LL_CRS_ConfigSynchronization should use:MODIFY_REG(CRS->CR, CRS_CR_TRIM, HSI48CalibrationValue << CRS_CR_TRIM_Pos) ;
I am using STM32CubeIDE to build a freeRTOS project. I have put my tasks in their own .h and .c files. For example I have a default_task.c file. The problem is each time I open CubeMX and save my changes, the 'auto code update' feature does not see my default_task.c file and creates a function in main.c. Is there a doc showing how to configure STM32CubeIDE and CubeMX so that I can have it update my code correctly? If not, is there a way to see what changes CubeMX will be making so that I can make them manually?
I have an STM32F7 which I have configured RCC's HSE and LSE as Crystal Resonator and am using HSE as a clock source for my project PLL Source Mux and PLLCLK for System Clock Mux. The RCC configuration does show conflict warnings at Master Clock Output 2 and Audio Clock Input options, since I am using SDMMC1 and they conflict, but I don’t use those for my project so I'm not sure it is causing the error to be thrown. When using the debugger trying to step through the generated code just to see how it executes, my project is failing at the SystemClock_Config(), specifically: /* Check the HSI ready flag */ if (__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET) { return HAL_ERROR; } }I’ve done everything in the configurator and there are no errors in the pin configuration section. I have not added any code yet to the generated code, so I am not sure what is causing this error.
Hi,I have created project using the STM32CubeIDE with .ioc. And added new folder for application code. Problem statement: Any API defined in my application file which under the Application folder will not identified by the Core files.I have defined the path for my Application folder.I have also attached my project. Please let me know what is going wrong.ThanksNiranjan
We have project for STM32F405 configured and code generated with STM32Cube 5.x.x.x.After installing Version 6.0.0.0 and when project was migrated to STM32Cube Version 6.0.0.0 and code regenerated, all IRQ priorities for peripherals (UART, SPIs, I2C, USB, etc) were set to 0 instead to 5. Firmware compiled but it was crashing in various parts.Details from IOC file:Original File: MxCube.Version=5.6.1MxDb.Version=DB.5.0.60Migrated File:MxCube.Version=6.0.0MxDb.Version=DB.6.0.0All IRQ priorities set to 0. Had to manually change them to 5 in order to get firmware running again.We also have project for STM32L072 and on that MCU Version 6.0.0.0 also migrates all IRQ priorites to 0. Had to be fixed manually.This seems to be fairly serious fault that is pretty much show stopper for us.
I reckon that users should set the ideal value of ARR and PSC, not ARR-1 and PSC-1. Because ST should do this job in the program.
I can't find a summary of the colors used in CubeIDE Pinout View. What is the meaning of these different colors?Thanks,
I am trying to configure the Internal Flash (0x08000000, 128KB, cacheable), DTCM RAM (0x20000000, 128KB, non-cacheable), AXI SRAM (0x24000000, 512KB, cacheable), and QSPI (0x90000000, 4MB, cacheable).There is no indication of what parameters might be missing or incorrect in the below warning.CubeMX Warning: - Main Config: These peripherals still have some not configured or wrong parameter values:[CORTEX_M7]
Hi there!I am trying to create a lock-step synchronization between a timer that updates GPIO and a dac.As you can see from the below, the GPIO leads the DAC transitions by 1 cycle, and that's not what I want: My setup is as follows.TIM8 generates a TRGO that drives the DAC1 DMA.I also have a TIM8_UP DMA Request created through the DMA System Configuration.The problem is that the TIM8_UP and TIM8_TRGO events are not synchronous, and differ by one cycle.FYI I am using a Nucleo STM32G431KB.I was trying to use the DMA Request Synchronization Settings to ensure the two different signals (DMA and GPIO) are exactly synchronous, but I cannot get it to work.How could I do this through STM32CubeIDE?I also noticed that there is no TIM8_TRGO DMA Request signal available. The datasheets are pretty difficult to search on this topic also and provide no additional clues that I could find.Thank you.
H723ZGT6 Nucleo-144CubeMX 6.3.0AN209, Summer 2017, V 5.0An error occurred when writing a for loop process before SDRAM initialization.I know the solution, but I don't know why this is happening.(Add static or volatile or write a for loop after SDRAM initializationThen the problem can be solved)[AN209, Summer 2017, V 5.0]Using Cortex-M3/M4/M7 Fault ExceptionsI found this manual with details of hard faults.About UNALIGNED"There was an unaligned memory access," he said.What is the relationship between SDRAM initialization and for loops?Why do I get a hard fault error if I write a for loop before SDRAM initialization?If anyone knows please let me know.
I'm working on test code for a bare metal STM32G0C1 project. I'm using STM32CubeIDE 1.9.0 and created the project with the included STMCubeMX tool.When digging around in the generated code to understand I2C I found that the function HAL_I2C_MspInit(hi2c) is only weakly defined in stm32g0xx_hal_i2c.c. For other peripherals, such as UARTs, there's a HAL_***_MspInit() where the GPIO are configured. Even supplied sample projects have a HAL_I2C_MspInit(). Instead I find this heart stopping note in stm32g0xx_hal_i2c.c:"(+) User must Implement HAL_I2C_MspInit() function in which he configures all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC )."Whoa horse!! What's up with burying such an important little comment deep in the generated source code (that I'm not suppose to muck with and assume is good to go right out of the chute)? I hope you can tell me the error of my ways. Otherwise, I'm going to assign the dreaded "b" word (as in insect) to this ti
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.