Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi All,I am working on a SCSI device read/write project.(Base on STM32CubeMX V6.4, Chip STM32F103)Now the windows can recognized this device as a pen driver and I can send data from Device to Host just like send data for read capacity.EXint8_t SCSI_ProcessCmd(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *cmd){ USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef *) pdev->pClassData; switch (cmd[0]) { …. case 0xF7: USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BO
Hello,As far as I understood, stm32cubeMx will be end of life within some days / months / years.Can you provide timeline for it?And will it be released as open source project at this moment?ThanksJulien
Hi, I enabled RTC and calendar on a STM32F746 CubeMX project, and I can gather correct time informations when using BCD mode from the HAL_RTC_GetTime function, but when using the other option the "binary" mode, the informations I´m getting from GetTime can be incorrect from time to time ("jumping" to incorrect values, for example from 12 to 22 seconds, then to 14 sec right after) but still switch minutes/hours at the right moment. From what I understand the RTC calendar is basically in BCD format, which is converted to a "classical" binary format with "RTC_Bcd2ToByte" function when the format in HAL_RTC_GetTime is precised as binary, I don't understand why it would have these issues. I was wondering if anyone had came across this issue before? Thank you in advance for your time.
Hello,I have come over this bug per coincidence:I am doing an evaluation project with the STM32F407G-DISC1 Board and want to utilize the DMA together with the I2S to feed the Audio data to the CS43L22 DAC.Since interrupt driven I2S transmit HAL functions work fine, I was really suprised that the DMA related functions did not work. An I neither got any error report nor was there a MCLK visible on the oscilloscope.Through my interent research I stumbled over the following video from Tripplikit Electronics:https://www.youtube.com/watch?v=ToRk2lOhydo&ab_channel=TripplikitElectronicsHe had the same problematic as I do observe and found the reason for the not working DMA.It is because of the intialization order when the peripherals get initalized via HAL. The following code snippets show the problem.If you program STMCubeMX in CubeIDE to use DMA together with the I2S (SPI3 peripheral) the following initialization sequence is created: /* Reset of all peripherals, Initializes the Flash int
Datasheet indicates DE is supported on all 4 USART interfaces, but attempting to enable it for USART4 in STM32Cube results in an error:Mode Conflict with USART4 : Hardware Flow Control (RS485)Steps to reproduce:Create new project based on STM32G081RBOpen the IOC fileNavigate to Connectivity -> USART4Set Mode to AsynchronousSelect Hardware Flow Control (RS485)Software in use:STM32CubeIDEVersion: 1.8.0Build: 11526_20211125_0815 (UTC)
Hello,I use the current tools: STM32CubeIDE 1.8.0, STM32CubeMX 6.4.0 and STM32Cube_FW_H7_V1.9.1.I have a couple of issues with current implementation of the connection between SDMMC and FATFS:The first problem in the platform driver "fatfs_platform.c, function" BSP_PlatformIsDetected ":This code queries if (HAL_GPIO_ReadPin(SD_DETECT_GPIO_PORT, SD_DETECT_PIN) != GPIO_PIN_RESET)but my card reader (direct connection between the card slot and the default pins of the SDMMC1 interface and 3.3V supply) returns "GPIO_PIN_SET" for this pin if the card is in the slot.I don't know if it is a specific fault of my card reader (Adafruit 4682 - “MicroSD SPI or SDIO Card Breakout Board�?), so I changed the code and don't want to investigate it any further.The second problem is much more serious. During the initialization the "SD_SendSDStatus" procedure is called (see attachment) and here it doesn't leave the status query loop ("stm32h7xx_hal_sd.c", lines 3258ff): /* Get status data */ while (!__HAL_
When running /opt/st/stm32cubeide_1.8.0/stm32cubeide under Ubuntu 20.04.3 LTS, I get the following NPE when double-clicking on the ioc file. Nothing happens at the UI level. I include the ioc file that makes the program crash in case it could be useful. Thank you. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.st.microxplorer.plugins.projectmanager.model.ProjectSettings.setM_mainLocation(ProjectSettings.java:457) at com.st.stm32cube.common.mx.editor.CubeMxEditor.getMxTabbedPaneInstance(CubeMxEditor.java:1111) at com.st.stm32cube.common.mx.editor.CubeMxEditor$11$1.createSwingComponent(CubeMxEditor.java:1025) at com.st.stm32cube.common.mx.oss.core.awtswtbridge.EmbeddedSwingComposite.doComponentCreation(EmbeddedSwingComposite.java:492) at com.st.stm32cube.common.mx.oss.core.awtswtbridge.EmbeddedSwingComposite$4.run(EmbeddedSwingComposite.java:291) at com.st.s
Hi all, I am newbie in this field.Using the STM32CubeMX V6.3 to create a virtual memory stick and working well under win7/10.Using the sample code I can easily to send data to host as followingfunction sendDataToHost(...){ USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef *)pdev->pClassData; hmsc->bot_data[0] = 0x01; hmsc->bot_data[1] = 0x02; hmsc->bot_data[2] = 0x03; hmsc->bot_data[3] = 0x03; hmsc->bot_data_length = 4U; return 0;}And I want to receive data from host, what should i do?My test code cause the timeout error and it seems like host don't know the data is received complete.PS. Host Will send 8 bytes to devicefunction(...){USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef *) pdev->pClassData;USBD_LL_PrepareReceive(pdev, MSC_EPOUT_ADDR, hmsc->bot_data, 8);}can anyone give me some idea?Thanks
can anyone help me with this problem cubemx is stuck at copying library file while i try to generate code for keil mdk version 5.28 cannot close the window and have to terminate the program using task manager i am using windows 10 system
I have a program which uses interrupts, but these are in a separate *_it.c file and not in the main.c. So given that MX places all defines, queue, thread, etc in the main.c rather than the main.h how am I supposed to give another file visibility to the item(s)?I already made the drastic mistake of setting up the *.h file with the information from the *.C, but on the next "Generate Code" everything I did is gone then recognition of the items are gone and I'm back to square 1.I have setup a queue and in the interrupt plan on sending a message via the queue to the main task. I hate to make everything global so all the files can see them, but I'm at the point where this is the only option I see to get this task done. Since the Queue is only visible to the main.c the queue will not work in the interrupt file. :(Any suggestions would be appreciated.void EXTI1_IRQHandler(void) { /* USER CODE BEGIN EXTI1_IRQn 0 */ SystemQueue_t SystemQueue; SystemQueue.Message = eMsgBumperFront; <
There is an issue in STM32G4 MCU FW package v1.5.0 in system_stm32g4xx.c ligne 189 :#if defined(USER_VECT_TAB_ADDRESS) SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ #endif /* USER_VECT_TAB_ADDRESS */there is no #else, so SCB->VTOR is not initialised if USER_VECT_TAB_ADDRESS is not defined. As a result, main.c stay blocked in HAL_Init() when setting systick IRQ, or systick IRQ (and none other IRQ) are called.To fixe that, code should be replaced by something like that : #ifdef USER_VECT_TAB_ADDRESS SCB->VTOR = USER_VECT_TAB_ADDRESS| VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ #else SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ #endif
Hello,I am trying to use circular DMA to transfer data from ADC1 into a buffer using CubeMX-generated code to configure the ADC and DMA. The DMA stream encounters a transfer error on transferring the first item.The device is an STM32H743.Using a debugger it can be seen that the program excute HAL_ADC_ConvCpltCallback()and right after it gets to HAL_ADC_ErrorCallback()Atatched are captures of the CubeMX configurations.I assumes that it is related to anouther DMA isue that I am experincing with the I2C:https://community.st.com/s/question/0D53W00001HbHIwSAN/stm32h743-i2c-dma-scl-stays-low-after-getting-slave-address-ackAny Ideas?
..
I have a Nucleo board https://www.st.com/en/evaluation-tools/nucleo-g491re.htmlI have configured USART1 on PC4 and PC5 in STM32CubeMX, with interrupts and RX DMAI can send but not receiveI was able to get it working on a discovery board before with the same code, but different processor: https://www.st.com/en/evaluation-tools/32l152cdiscovery.htmlI tested the sending with a USB-serial converter and I can see the MCU is sending. Looping back the TX signal to the RX on the board doesn't result in receiving data, nor does connecting the TX of the USB-serial converter. However I do get RX line error interrupts if I connect the wire, and if I enable idle line interrupt that works too.Here is my stripped down code:#include "app_main.h" #include "main.h" // includes correct STM32 HAL //RTOS includes #include "FreeRTOS.h" #include "task.h" #include "cmsis_os2.h" #include <stdio.h> #include <sys/unistd.h> #ifdef DEBUG extern "C" int _write(int file
Hi! I am working with the dual core STM32H745 nucleo board, currently on the M4 core.I am having trouble with configuring my wanted system clock frequency.I want the clock to be 200 MHz and accordingally i try to set it in the CubeMX clock config interface (a snapshot added) also i use the following power configurations: After the code is generated the system clock is 64Mhz.(checked with scope and HAL_RCC_GetHCLKFreq() function).Please help me understand how can i increase the sysclock frequency and what am i doing wrong in my configurations?thanks alot!
CubeMX 6.4.0 shows an invalid setting for ADC Continuous Conversion Mode.But this entry has to be disabled in this configuration for correct operation (one ADC channel is triggered by timer). It was also no problem in earlier CubeMX versions.@STM: Can you check this problem in CubeMX please (see attached IOC file)?Thank you in advance!
H723ZGT6 Nucleo-144CubeMX 6.3.0[ data sheet ] H723: DS13313 Rev2[NOR Flash] S25FL256L[Reference manual] H723: RM0488 Rev2 S25FL256L: 002-00124 Rev. * HI am currently using H723 to create a project to read and write NORFLASH.However, the read / write is not successful.I want to read and write with H723 as the master and external flash as the slave.1. Is the CubeMX setting incorrect?2. Is there a problem with the idea of SPI communication?I searched, but couldn't find much reference sample code that could be used to read and write the external flash.Please let me know if there is any sample code or site that you can refer to.
Hello,I'm generating code with CubeMx 6.4.0 with a command line.The generation ends with an error even if the files seems to be correctly generated. Here's the log and the ioc file.ThanksJulien
Posted on January 12, 2018 at 20:49Hello,I am trying to use SDMMC/SDIO with DMA + FATFS. When creating project on stm32f7, I can find and configure DMA streams for the sdmmc.I am working with cubeMX version 4.23.Screenshot from STM32F7 - DISCO cube configuration:Screenshot from STM32H7- NUCLEO cube configuration:Does the cube missing a DMA tab in SDMMC configuration? Maybe it defined in another place in the cube?Best regards,Marina#fatfs-sdio #cubemx-4.23 #dma
Hello, I'm attempting to use the SDMMC with an SD card, and with DMA. However, when I use the STM32CubeMX IDE, there is no option to enable or use the DMA. Using: STM32CubeMX version 5.3.0Here's the configuration for SDMMC1 on the STM32H743And here it is for SDMMC1on the STM32F7Notice that there is no DMA configuration option for the H7, but there is for the F7.Does this mean that ST doesn't have DMA based drivers on the H7? With the polling drivers, my performance is extremely slow -- something like 0.2MB/sec. Any idea how to get reasonably high write speeds on the SDMMC interface on the H7?BTW, I'm using a custom board without the transceiver.Thanks, -Caleb
Is there a way to reorder the peripheral initialization functions in the main.c auto code without opening the .ioc file? MX_DMA_Init() was getting called after MX_USART1_UART_Init() in my project, which was causing the DMA instance's registers to not update inside HAL_UART_MspInit(), and thus made the entire peripheral to fail (which I'm pretty sure is a bug).Using STM32CubeIDE Version: 1.8.0 (Build: 11526_20211125_0815 (UTC))For anyone else that runs into this kind of thing (assuming there isn't a proper fix), I manually reordered the functions by editing ProjectManager.functionlistsort in the project .ioc file.
HelloVersion 6.4.0 (and maybe some versions before) introduces an ugly dialog box when generating code. This dialog box breaks command line generation because it needs somebody to click.Can it be replaced by a warning in the logs?ThanksJulien
Hi, I am designing a project based on STM32G030F6P CPU, and I have stumbled upon a feature that I have not seen in older STM32 CPUs. In the CubeMX under the SYS peripheral configuration there are several checkboxes named like "Switch between PB7/PB8/PB9/PC14-OCS32_IN". I could not find any information anywhere what these option do and how to use them.I guess they are there to choose a particular port pin (and associated peripherals) on the physical pin, but I have no idea how to interpret switching between four values (pins) with a two-value selector (a checkbox). What do a checked state and unchecked state mean exactly?There are also "Pin PA9 instead of pin PA11" - kind of checkboxes, and these are obvious. There is a register bit to replace PA11 with PA9 in the SYSCFG_CFGR1 (PA11_RMP). But I could not find any registers or bits that could be associated with the "Switch between" options.
/** * @brief GPIO Initialization Function * @param None * @retval None */ static void MX_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(RFSW_GPIO_Port, RFSW_Pin, GPIO_PIN_RESET); /*Configure GPIO pin : RFSW_Pin */ GPIO_InitStruct.Pin = RFSW_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(RFSW_GPIO_Port, &GPIO_InitStruct); } /* USER CODE BEGIN 4 */ /* USER CODE END 4 */Users cannot add any modification due to 'user' section is out of function.
I want to use HSI, not external component to generate frequency. I generate code by CubeIDE only (pack 1.16.1), there is no my code. I only add define USE_FULL_ASSERT and implement void assert_failed. But CubeIDE's code fails on assert_param(IS_RCC_PLLR_VALUE(RCC_OscInitStruct->PLL.PLLR));why? Fails means that I am going to void assert_failed. I attach my proj.@Khouloud OTHMAN I suggest ST to test all HAL examples with define USE_FULL_ASSERT.
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.