Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I were trying to get data continues from a sensor and didnt find any flag that will acknowledge when a data is received . Only thing is there is HAL_UART_Receive_IT(),HAL_UART_Receive() functions.i need to seperate my data from Uart interupt handler.
I have to configure OCTOSPI2 in Single Mode and only three pins managed directly from peripheral: SI, SO anche CLK.The code generated from MX is the following:static void MX_OCTOSPI2_Init(void) { ... OSPIM_CfgTypeDef OSPIM_Cfg_Struct = {0}; ... OSPIM_Cfg_Struct.ClkPort = 1; OSPIM_Cfg_Struct.IOLowPort = HAL_OSPIM_IOPORT_2_LOW; if (HAL_OSPIM_Config(&hospi2, &OSPIM_Cfg_Struct, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { Error_Handler(); }The function HAL_OSPIM_Config() checks validity of all members of OSPIM_Cfg_Struct:HAL_StatusTypeDef HAL_OSPIM_Config(OSPI_HandleTypeDef *hospi, OSPIM_CfgTypeDef *cfg, uint32_t Timeout) { ... /* Check the parameters of the OctoSPI IO Manager configuration structure */ assert_param(IS_OSPIM_PORT(cfg->ClkPort)); assert_param(IS_OSPIM_PORT(cfg->DQSPort)); assert_param(IS_OSPIM_PORT(cfg->NCSPort)); assert_param(IS_OSPIM_IO_PORT(cfg->IOLowPort)); assert_param(IS_OSPIM_IO_PORT(cfg->IOHighPort));So this function fires an a
..
Hi,I am finding difficulties of importing a project generated by STM32CubeMX.Can any one help?Regards,Suresh.
Hello, I'm using Discovery board for STM32H747XIHx, STM32CubeMX 5.5.0 and so far I wasn't able to find a way how to enable support for RTOS in USB_HOST_M7 menu in CubeMX. There is only "Disable" and it's missing "Enable". I'm not sure if I setup something incorrectly or this is a bug. I'm using FreeRTOS for M7 core and if I set "#define USBH_USE_OS" to "1U" manually in usbh_conf.h, everything works correctly. Does anybody know why CubeMX doesn't allow me to Enable the support? I tried to find out dependency in CubeMX database and templates, but wasn't able to figure it out.Thanks,Petr
Hello all!When generating a project for ARM Keilv5 with CubeMX Version 5.1.0, the file system_stm32f4xx.c ist added twice to the project under Drivers/CMSIS heading. This leads to Keil compiling the file twice and results in linker errors as some symbols are present twice, an issue the linker cannot resolve. One has to manually remove one occurance of the file in the project, then everything works fine.Is this issue konw by others here and is there a bugfix/workaround besides manually removing the entry every time?Kind regardsHerbert
Stm427 uses CUBE MX to generate LWIP code, if define MEM_USE_POOLS 1 compile error, how to solve?
I set up several pins as EXTI in the CubeMX configurator, but STM32CubeIDE doesn't recognize the EXTI_InitTypeDef and NVIC_InitTypeDef datatypes. Based on the configuration I would expect the correct libraries to be included, but when compiling I get the error "unknown type name".I get the error when I use the following code, which was originally written for some STM32F4, then adjusted for application on the STM32F303CC.void Configure_PA3(void) { /* Set variables used */ GPIO_InitTypeDef GPIO_InitStruct; EXTI_InitTypeDef EXTI_InitStruct; // <- NVIC_InitTypeDef NVIC_InitStruct; // <- /* Enable clock for GPIOA */ RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE); /* Enable clock for SYSCFG */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); /* Set pin as input */ GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN;&n
Both VREFINT and TEMPSENSOR ADC channels enabled. CubeMX generates following init code: /** Configure Regular Channel */ LL_ADC_REG_SetSequencerChAdd(ADC1, LL_ADC_CHANNEL_TEMPSENSOR); LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_PATH_INTERNAL_TEMPSENSOR); /** Configure Regular Channel */ LL_ADC_REG_SetSequencerChAdd(ADC1, LL_ADC_CHANNEL_VREFINT); LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_PATH_INTERNAL_VREFINT); Second call to LL_ADC_SetCommonPathInternalCh overwrites first call and only VREFINT remains, not both.Should be LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_PATH_INTERNAL_VREFINT | LL_ADC_PATH_INTERNAL_TEMPSENSOR);
Hello. I am working with the STM32F7, using FreeRTOS version 10.0.1, with CMSIS-RTOS version 1.02. The issue in question has been prevalent within my project for months, and the temporary workarounds I had previously designed aren't quite up to the project's standards anymore.The device I work with has many different peripherals, and with that I have a variety of tasks that are expected to run in FreeRTOS, one of which is dedicated to interfacing with the FatFs library for opening, reading, and writing to files on an SD Card. However, SD Card failures are not an uncommon sight to see within this project. It seems that there at least a couple different things that can contribute to this communication failure:When the total data written to an SD card approaches or surpasses about 2 GB (on a 32 GB card)When a file is attempted to be created/opened when there are many other files of a similar name in the root FatFs directoryNormally, the SD card will operate as expected. When referring to
Dear friends,I'm Using STM32Cube_FW_H7_V1.4.0 with TrueStudio 9.3.0, on an STM32H753.Has anybody got an micro-SD card working on the SDMMC1 peripheral for an STM32H7?For my it, seems to come with a Timeout error.I initialized it like:void MX_SDMMC1_SD_Init(void) { HAL_StatusTypeDef status; hsd1.Instance = SDMMC1; hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING; hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE; hsd1.Init.BusWide = SDMMC_BUS_WIDE_1B; hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE; hsd1.Init.ClockDiv = 2; // 0 - 1023 status = HAL_SD_Init(&hsd1); if (status != HAL_OK) { dmc_puts("!HAL_OK\n"); _Error_Handler2(__FILE__, __LINE__, status); // Error_Handler(); } } void HAL_SD_MspInit(SD_HandleTypeDef* sdHandle) { GPIO_InitTypeDef GPIO_InitStruct = {0}; if(sdHandle->Instance==SDMMC1) { /* USER CODE BEGIN SDMMC1_MspInit 0 */ /* USER CODE END SDMMC1_MspInit 0 */ /* SDMMC1 clock enable */ __HAL_RCC_
/** * @brief Transmit an amount of data in blocking mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pData: pointer to data buffer * @param Size: amount of data to be sent * @param Timeout: Timeout duration * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout)/* Init tickstart for timeout management*/ tickstart = HAL_GetTick();/* Timeout management */ if((Timeout == 0U) || ((Timeout != HAL_MAX_DELAY) && ((HAL_GetTick()-tickstart) >= Timeout))) { errorcode = HAL_TIMEOUT; goto error; }Setteing the timeout to 1ms, the actual value is <1ms. Some times the value is very close to 0, and leads to error.The value of timeout should be >= 2ms, but the instructions for use are not special. This issue still exists in the latest version STMCUBEMX V5.5.0. Hope to fix it in a future release.An effective solutio
Hi,There is same post available in the community but there is no solution available yet. When we generate code with 1bit wide SD card interface then we are able to successfully mount the card. Same thing with 4 bit we are not able to.If anyone have solution please share it.Regards,Suresh.
I am successfully generating init code with the Cube IDE tool. However, it gives me names like "MX_USART3_UART_Init" for example. I would like this to be something intuitive to the application like "Motor1_UART_Init". I have searched but can't find any way to change this. Can anyone help? Thanks, Jamie
While I was getting my USB CDC VCP working using CubeMX, and thanks to everyone who gave feedback, I ran across a statement regarding a bug in the USB stack. The issue was with the handling of a disconnect / reconnect event and device manager not recognizing the port anymore. Up until now, I have seen no evidence of this. I've tested a variate of scenarios, everything from a cold start of the target to a hardware reset , to disconnecting then reconnecting the cable, to restarting the PC while the target is still running. All of these scenarios resulted in a proper connection. I'm just trying to see if there is some oddball corner case that I have not anticipated. Has anyone run across something like this, and if so, how did you address it?Regards,Mark
When I2C interface is enabled no I2C GPIOs are displayed in the GPIO section. I was forced to assign them manually in the pinout view.
Upgraded STM32CubeMX from 5.4.0 to 5.5.0 and H7 firmware package to V1.6.0 and migrated. When generating code it tells me the code is successfully generated but STM32CubeIDEproject generation have a problem.Building the project fails: make: *** No rule to make target 'C:/git/ELS/sbc_bootloader/CM7/Src/sys.c', needed by 'Application/User/sys.o'. Stop.The same thing happens if I start a new project.I'm using the STM32H745ZITx.STM32CubeIDEproject generation have a problem, what problem?Please fix :)
Hello,Are there any plans to support CMSIS_RTOS V2 for SD card with FatFs.I am using CubeMX 5.5 with STM32H7Cube 1.6
i using the cubmx and generate the code. I add the code in main function below ,(sur_dma_data[100] is arry and uint16_t size send i defined them before). but it is dose not work. can not see the any data from serilas port of my board . i check data with computer serials tools and also does not stop the brakerpoint at call back function. the DMA setings in cubmx are ok, i set the breakpoint in call back function as below.//*****within Mina() HAL_UART_Transmit_DMA(&huart1,sur_dma_data,size_send);//******** if i write this code HAL_UART_Transmit_IT(&huart1,Pdata,1); to replace above DMA. anything is ok - I can see data at serials tools and also the call back function is called.// -------call backe function void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { //pro_counter++; led_data=receive_data[0]; }//------------any one can help me to settle the probelem ? thank you very much.
The configuration for the Timer 20 TRGO2 setting is not included in the generated source code. I verified using "git diff" that when changing the setting the only modified file is the .ioc.I'm using the low level library for this timer. I haven't verifed if it happens with HAL as well.CubeIDE:Version: 1.2.1Build: 5190_20200115_1224 (UTC)STM32CubeG4 Firmware Package V1.1.0 / 28-June-2019
Board: NUCLEO-F446RE, STM32F446RECubeMX: 5.4.0If you configure ADC1 with DMA, some configuration code for the DMA is placed into the ADC configuration code (stm32f4xx_hal_msp.c, line 152: if (HAL_DMA_Init(&hdma_adc1) != HAL_OK)). But in the generated main.c, the DMA clock is switched on after this function is called, i.e. the function MX_DMA_Init() is called after MX_ADC1_Init(). So the configuration of the DMA is not applied, as the DMA is not clocked yet.A workaround is to swap MX_DMA_Init and MX_ADC1_Init everytime you re-generate the code in CubeMX.
I am getting a CAN message with the function `HAL_CAN_GetRxMessage`.The struct `CAN_RxHeaderTypeDef` has a field called `RTR`.The doc string says: "This parameter can be a value of @ref CAN_remote_transmission_request".`CAN_remote_transmission_request` consists of two macros: #define CAN_RTR_DATA (0x00000000U) /*!< Data frame */ #define CAN_RTR_REMOTE (0x00000002U) /*!< Remote frame */The received CAN message, however, has a RTR value of 1 because it is shifted by `CAN_RI0R_RTR_Pos` to result in a boolean value.When sending the message with `HAL_CAN_AddTxMessage` it is checked with `assert_param(IS_CAN_RTR(pHeader->RTR));` that RTR is indeed either `CAN_RTR_DATA` or `CAN_RTR_REMOTE` and not 1.
Hello,I have a STM32L552E Evaluation Board, and I see that the Examples and Applications folders have projects for IAR, KEIL and CubeIDE. Previusly I used System Workbench for STM32, so I installed CubeIDE and I tried to run and debug some code in the evaluation Board.I can build and using a STLinkV2 and the JTAG Connector CN10 I can load the binary in the evaluation board and I can debug the programs but I found one problem.PROBLEM 1:There are not CubeIDE project available for de Demostration code in STM32Cube_FW_L5_V1.1.0 , and there are not a generated binary to load this firmware neither, so, How can I test all the board functionality without paid for an IAR or KEIL LICENSE?PROBLEM 2: (RESOLVED)When I build and load GPIO_IOToggle Example the HAL_Delay funtion does not return. I try with other examples codes that uses HAL_Delay and the result is the same.Do I need to modify something to make works fine the HAL_Delay function in these examples? In the Examples there are these No
I'm using STM32CubeMX 5.2.0MCU: STM32L053R8TxFirmware: STM32Cube FW_L0 V1.11.2Toolchain/IDE: MDK-ARM V5Tested with 3 different boards, even with a default code (as generated by CubeMX) in debug mode, and also with a simple UART transmitter program (transmits a message every few seconds to check if the program is still alive) without the debugger.
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.