Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi! I changed usb hid.c file not in user code. After I change something in cubemx and regenerate code this file is also changed to its oryginal form. Is there a way to tell cubemx not to change this specyfic file?
Hi,I want to use STMCube generation tool for project generation. But I am getting the following error. I have installed the required gcc tool chain. Please let me know
I've created a new project just to send a string over UART3 TX via DMA. The non-DMA version workes fine...so I'm not sure what I'm doing wrong here. I think I had configured the cube correctly...so I'm stuck. Can someone help me take a look at the attached files please!?!?Thank you
NUCLEO BOARD
Hi,I am a new user of STM32cubeMX and I get the message the software cannot load the information for the MCU I selected. Could you please advise what to do?I see from the forum (for other MCUs) that it is either a matter of availability or an issue with the softwareThanks
Hi All,i'am beginner of using libary HAL, i use CubeMX to generate code. At first, I use usart1 to send message and i work, and then i try to use usart2 but i cant can't send any message.these two code is almost the same.
Any feedback how to create USB composite device ( CDC_USART1 + VCP )were we need to change on the CubeMX Code for STM32f042 ? were can see a good example ? Thanks for the help
Hi,DMA does not work, because the initialization order of the code generated by CubeMX is not correct.DMA setting is not valid, because DMA is initialized after the fuction that uses DMA.Please fix bugs.Best regards,incorrect order expample: MX_GPIO_Init(); MX_SPI1_Init(); MX_SPI2_Init(); MX_SPI3_Init(); MX_UART4_Init(); MX_UART5_Init(); MX_USART1_UART_Init(); MX_USART2_UART_Init(); MX_USART3_UART_Init(); MX_DMA_Init();correct order expample: MX_GPIO_Init(); MX_DMA_Init(); MX_SPI1_Init(); MX_SPI2_Init(); MX_SPI3_Init(); MX_UART4_Init(); MX_UART5_Init(); MX_USART1_UART_Init(); MX_USART2_UART_Init(); MX_USART3_UART_Init();My environments:・STM32CubeMX Ver. 5.4.0・STM32Cube MCU pacage for STM32L4 Series Ver1.14.0・Windows10・NUCLEO-L496ZG
Hello All,I am using Cube MX (4.24) and Atollic truestudio (9.2.0) and want to implement a USB based boot loader part for my application .Where i use STM32F777IITx MCU with "STM32Cube FW_F7 V1.9.0" firmware package.Currently i was implementing USB binary file reading part, However when i try the below given API's i am facing some issues which i have mentioned belowIssue 1.If i use "f_open(&myFile, "OPENBLINKYFILE.TXT", FA_READ);" api i get error saying "FR_INVALID_NAME". whereas, If i Use same api as follows "f_open(&SDFile, "BLINKY.TXT", FA_READ);"I do not get any error it works i am able to open file and read data.Issue 2. If i use "f_stat("/TEST/BIN.TXT", &myFileinfo);" api i get error saying "FR_INVALID_NAME" also if i am not able to read file status.whereas, If i Use same api as follows "f_open("/TEST/BLINKYOPEN.TXT", &myFileinfo);"I do not get any error it works i am able to open file and read data.I face such issue for many more api's whenever i want to access fi
The latest version (5.4.0) of CubeMX (and who knows... maybe every version before) generates DMA initialization code out of order, and it's kind of hard to diagnose until you single step through all the HAL code.I am using an STM32H743 and setting up circular DMA for the SAI port. The code generated in main.c looks like this: /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_SAI1_Init(); MX_SAI2_Init(); MX_I2C2_Init(); MX_SPI2_Init(); MX_USB_DEVICE_Init(); MX_I2S1_Init(); MX_SDMMC2_SD_Init(); MX_DMA_Init();The DMA for the SAI ports gets configured in MX_SAI1_Init() and MX_SAI2_Init(). Unfortunately, since MX_DMA_Init() is called AFTER the MX_SAIx_Init(), none of the SAI DMA settings get configured right, and it just doesn't work, and you spend a day or two debugging the CubeMX code. Ugh. So, the solution is to go to Project Manager->Advanced Settings, and disable the init calls by clicking 'NOT Generate Function Call' for all the init functions, and create your
I just started a new project using CubeMX to generate the initialization code for the STM32H747I-DISCO. I tried to initialize the GPIO LED1 pin (PI12), however the macros showing the user label did not appear anywhere, no matter if I selected the M4, M7 or set it to "free". The user button had the same issue, and the interrupt function code was not generated anywhere.The pins could be toggled using their port number directly, and those issues are not reproduced with any of the single-core STM32H7.Is this expected behaviour with dual-core STM32H7 models?
I have implemented the following code based on some examples on internet. It is supposed to trigger the DMA transfer complete callback put it does not. 99% of the code is generated using CubeMX IDE. The modified part of the code:void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { HAL_GPIO_TogglePin(GPIOA, LD2_Pin); } /* USER CODE END 0 */ /** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_USART2_UART_Init(); MX_DMA_
I am using stm32cubeIDE for FreeRTOS on stm32f429. As cubemx has option to adjust heap and stack size on generating code in "Project Manager" project tab. While FreeRTOS has also column of heap adjustment in config parameter in cubeMX.Question: From where FreeRTOS take heap size as per defined in code generation project tab or column in config parameter? should i need to adjust both code generation or config parameter column?Please anyone suggest to best way to avoid any heap/stack overflow.Thanks to all
Specifically, for a STM32F723, with the HS USB PHY enabled, it's giving me an error in HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len, uint8_t dma) { uint32_t USBx_BASE = (uint32_t)USBx; uint32_t *pSrc = (uint32_t *)src; uint32_t count32b, i; if (dma == 0U) { count32b = ((uint32_t)len + 3U) / 4U; for (i = 0U; i < count32b; i++) { USBx_DFIFO((uint32_t)ch_ep_num) = *((__packed uint32_t *)pSrc); pSrc++; } } return HAL_OK; }... where it's the __packed that's causing the problem. The same thing is true for the USB_ReadPacket immediately below the above in stm32f7xx_ll_usb.c I'm not sure what the effect of removing the __packed will be (presumably it's there for a reason!) but after freshly generating the project, a build produces:../Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_usb.c: In function 'USB_WritePacket': ../Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_usb.c:958:53: error: expected ')' bef
I try to operate very basic I2S DMA function in STM32H750 chip. This is a very simple function which successfully works on STM32F4 and F7 chips.I have read the previous comments about I2S problems on H7 chip, and knowthere are some problems with I2S in previous releases of HAL library, but with the release of v.1.50. this library was rewritten. Right know, polling mode and interrupt mode are successfully working.For DMA problems on H7, the linker script is re-edited. I2C and SPI DMA functions are working successfully, but I2S function starts without any errors, finishes 1 cycle successfully, then halts. It does not work in neither normal nor circular mode. In debug mode, HAL_I2S_TxHalfCpltCallback is called after one cycle, then it halts. No error callbacks are called. Below tryouts were not successful either;placing dma buffer on RAM_D2using cache maintenance functions (SCB_CleanDCache)using I2S2 or I2S3Solving this problem is very crucial for my project. Project files are a
Hi, i am using stm32f4. in my project i have one transmitter and one receiver.i transmit an 2 byte integer value usingHAL_UART_Transmit(&huart1,&temp_byte1,sizeof(temp_byte1), 500); HAL_UART_Transmit(&huart1,&temp_byte2,sizeof(temp_byte2), 500);and on the receiver part. i read these values usingvoid USART6_IRQHandler(void) { HAL_UART_Receive_IT(&huart6,&rx_data,1); temp_data[rx_index]=rx_data; rx_index++; if(rx_index==2) { rx_index=0; temp = ((temp_data[0]<<8)|temp_data[1]); if(temp!=79){ //sometimes i see a 79 in my buffer! hc05_flag = 3; //irrelevant flag with this question nm=0; //irrelevant flag with this question } }it works fine for one time. but after, i see temp_data[1] in temp_data[0]. it shift 8 bits and i see a big temp value (63744 etc.) . where is my problem?
..
I am using a custom board that uses the STM32F769NI chip. I am finding that any attempt to build using the LL drivers causes build failures. I suppose this is a bug, but not sure if or how to report.For the attached reference mx project, it fails with this../Src/main.c:300:3: error: unknown type name 'LL_ADC_InitTypeDef';So it seems that perhaps the LL includes aren't happening somehow?Also, another puzzlement, is there a way to properly copy a project? I find that copied projects won't import properly into CubeIDE.
Hi,I have a project with an STM32F412CEUx (UFQFPN48) with an IOC file created with CubeMX v5.2 or something. Now I opened it in CubeMX v5.4.0 and regenerated the code. This removed all initialisation code regarding the GPIOs D, E, F and G.The data sheets of STM32F412C as well as the more specific UFQFPN48 state that the MCU has those GPIOs.Any idea why they would not be generated or how I can enable their generation again?Best regardsfsch
#define MAX_DATA_LENGTH 50#define STX 0X02#define ETX 0X03u8 g_u8Rs232TxBuffer[105] = {0};u16 g_u16Rs232Tick = 0;extern UART_HandleTypeDef huart1;//(0X02, 0X03 0X30 , 0X11~ 0X18) OFF //(0X02, 0X03 0X31 , 0X11~ 0X18) ONu8 Rs232_DataReceived(u8 u8RxData[], u8 u8RxDataLength){ u8 u8Rdvalue = 0; //ReceiveDataValue u8 i=0; u16 u16Temp =0; if (u8RxData[0] ) u8Rdvalue = u8RxData[0]; } void Fun_Uart1_RxReceived(u8 u8RxData){ static BOOL s_bDbgRxStartFlag = FALSE; static u8 s_u8DbgBuffer[64] = {0}; static u8 s_u8DbgCount = 0; int g_u8Dbg_RxBuffer[64] ={0}; if(s_bDbgRxStartFlag == TRUE) { s_u8DbgBuffer[s_u8DbgCount] = (u8)u8RxData; s_u8DbgCount ++; if(s_u8DbgCount >= 64) { s_u8DbgCount = 0; s_bDbgRxStartFlag = FALSE; } else { if(u8RxData == 0x31) { s_bDbgRxStartFlag = FALSE; } } } else { if(u8RxData == 0x30) { s_bDbgRxStartFlag = TRUE; s_u8DbgCount = 0; } }}void Rs232_SendData_(u8 Data){ huart
Hi all,Last year after buying a Nucleo board, I downloaded CubeMX 4.27 and firmware 1.2. After some looking around, I found out about the firmware changes as well as MPU changes one has to do to get LWIP running and pings working.This year, I updated my system and installed CubeMX 5.3 and Firmware 1.5, and things did not work. I followed the following thread:https://community.st.com/s/question/0D50X0000A4nCOmSQM/need-help-to-run-ethernet-communication-correctly-with-stm32h7-nucleoAfter downloading the project from this Github repo:https://github.com/MX-Master/STM32H7_Nucleo-H743ZI_Ethernet_LwIPThe unit worked well on CubeMX5.3 and FW 1.3. After migrating the firmware to 1.5, without additional changes, everything stopped working. Yet again.I have not seen additional resources if anyone else has this problem, or if anyone else has managed to get LWIP and the NucleoH743 working with the latest versions. I did manage on 1.2 and 1.3. I'm scared to try 1.4 and 1.5 does not work.Dear STM32 e
Installing STM32CubeMx on OpenSuse Tumbleweed using /st-stm32cubeide_1.1.0_4551_20191014_1140_amd64.rpm_bundle.sis missing libusbxsudo ./st-stm32cubeide_1.1.0_4551_20191014_1140_amd64.rpm_bundle.sh [sudo] Passwort für root: Creating directory st-stm32cubeide_1.1.0_4551_20191014_1140_amd64.rpm_bundle.sh.root Verifying archive integrity... All good. Uncompressing STM32CubeIDE installer 100% Verifying... ################################# [100%] Preparing... ################################# [100%] package segger-jlink-udev-rules-6.44c-4.noarch is already installed error: Failed dependencies: libusbx >= 1.0 is needed by st-stlink-server-1.2.0-3.amd64 Verifying... ################################# [100%] Preparing... ################################# [100%] package st-stlink-udev-rules-1.0.2-2.noarch is already installed error: Failed dependencies: st-stlink-server is needed by st-stm32cubeide_1.1.0-1.1.0-4551_20191014_1140.x86_64libusbx is not available for OpenSuse. On http
EDIT: Nevermind this thread can be deleted, apologies. I didn't enable the HSEM2 Global interrupts under NVIC1/2 in CubeMX.Hi,I'm having issues getting the hardware semaphore interrupts to function correctly, or I'm misunderstanding their usage. I'm using a cubeMX generated project in SW4STM32. Below is a code snippet from the main.c file on the M4. uint32_t sem_mask = __HAL_HSEM_SEMID_TO_MASK(8); HAL_HSEM_ActivateNotification(sem_mask); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ HAL_HSEM_Take(8,8); HAL_Delay(1000); HAL_HSEM_Release(8, 8); HAL_Delay(1000); }I've just picked a random semaphore, so number 8, out of 31. From the comments in hal_hsem.c this is what I could gather about the usage. I've implemented the handler at the bottom of the same file:void HAL_HSEM_FreeCallback(uint32_t SemMask){ HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_14); }My problem is th
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.