Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Below images show a PCC step configuration window and my clock tree configuration. As seen i can not change info under clock tab of PCC. Anybody know the reason ?
I use STM32Cube Ver 4.26.1 to generate LWIP code with HTTPD, it keep print "Assertion "HTTP headers not included in file system" failed at line 2271 in ..\Middlewares\Third_Party\LwIP\src\apps\httpd\httpd.c " .I find it is in file "httpd_opts.h", " LWIP_HTTPD_DYNAMIC_HEADERS" is not defined.From Cube ==>Configuration ==>LWIP ==> HTTPD, nowhere can I define " LWIP_HTTPD_DYNAMIC_HEADERS".Any suggestions?
How can I set CPU and MPU parameter in CORTEX_M7 for ethernet communication?
I ran into problems with the LAN8742A on the STM32F746-G discovery board. CubeMX is generating wrong values for some registers resulting in a misconfiguration of the MAC. I noticed this becuase about a quarter of all packets send were lost and a lot of duplicate acknowledgements were send in the TCP connection.After some research I found this thread: https://www.olimex.com/forum/index.php?topic=2495.0I can approve these changes. By correcting the values, the board works like a charme. I have CubeMX 4.26.1 installed and generated the files about 3 weeks ago. Will this be fixed to help other developers? These were some exhausive last days finding this bug.I also want to maybe help others to find a soulution for the described symptoms.Finn
I want to implement a callback for USB connection / disconnection.I see that CubeMX generates HAL_PCD_ConnectCallback, as __weak in file stm32f7xx_hal_pcd.c, but the problem is that it's already defined in file usbd_conf.c. And there's no option for user code there. So how can I add my code to this callback?Thanks
Hi, colleges!I use Nucleo-144 STm32F767 development board to learn USB. Now - Application example - device USB MSC. The example uses SD card, with I haven't. I want to use internal instead of SD card. So, I changed the "usbd_storage.c" file. Plugged and not played =) Error - Cann't start this device (code 10). My STM32 is falling in HardFault_Handler. I've put break point in "Handle Enumeration done Interrupt" and seen the process has stopped. The enumeration process is done. Ok. What is going then? Which step is next? Where I need to put my break point? I don't really know how to debug USB transaction and communication process. Wireshark doesn't see my device at all. /* Private variables ---------------------------------------------------------*/ uint8_t usbMassStorage[0x1000]; .... int8_t STORAGE_GetCapacity(uint8_t lun, uint32_t *block_num, uint16_t *block_size) { *block_num = sizeof(usbMassStorage)/512; *block_size = 512; return 0; } int8_t STORAGE_IsReady(uint8_t
Hello,I am currently working on a project for which I need to transmit data from my STM32 Nucleo 144 to micro SD via SPI. I ordered this breakout board to use:https://www.waveshare.com/micro-sd-storage-board.htmThe board came with a driver, however it is for the STM32F10 series, and as far as I can tell is not easily ported to the STM32F7 series. I found that in the STM32Cube_FW_F7 there is a driver called adafruit_shield_sd.c, which I have tried to implement into my project and it appears to work, however when I try to initialize my sd card I receive an error (BSP_SD_Init returns 0x01, or BSP_SD_ERROR). I cannot tell if this is because I have wired my breakout board incorrectly or because the adafruit driver is incompatible with my breakout board.If I was confident that I was wiring my board up correctly, troubleshooting this might be going a little smoother but this is my first crack at adding a peripheral to my board.In CubeMX, I have SPI1 enabled, using:PA5 = SPI1_SCLKPA6 = SPI1_MI
I am working on a project that integrates the cubemx-classb library, which depends on V1.5.0, and also want to use STM32CubeMX for other configuration. However, it appears that the STM32CubeF0 Firmware Package V1.5.0 configured by the STM32CubeMX tool provides outdated (v1.3.1) HAL header files. Generated initialization files are not compatible, specifically WWDG references non-existent MACROS that don't appear until V1.5.0.
Let's take example STM32F407 MCU TIM3_CH1 timer is configured for indirect capture mode meaning this channel is triggered by TIM3_CH2 input signal. In this mode TIM3_CH1 external pin is not used. Can it be configured as this channel' output? If yes, then how to do this? STM32CubeMX peripheral configurator only allows one choice for any channel such as "Input Capture Indirect Mode", choosing it does not leave option to choose channel 1 pin as output. Or could this pin configuration be done manually in software initialization in addition to the Indirect Mode? My goal is to use this pin for testing the TRGO Master clock output generated in this timer and internally connected to another timer input. Please advice.
Hi, I have some trouble to handle ADS7953 with HAL_SPI_TransmitReceive_DMA api,if using HAL_SPI_TransmitReceive api, it takes long time and impact other operations,so I hope to reduce the communication time with HAL_SPI_TransmitReceive_DMA in the communication of SPI, please help to let me know the method if possible, with detailed example, I update my code, please help to review it, if finding something, please help to let me know what I should modify and how to modify with detailed example or explanation,Thankful for your kindness in advance,thanks.My code is, CS_Low; if(HAL_SPI_TransmitReceive_DMA(&hspi2, cmd, data, 2) != HAL_OK) { /* Transfer error in transmission process */ } uint8_t state = HAL_SPI_GetState(&hspi2); while (state != HAL_SPI_STATE_READY) { state = HAL_SPI_GetState(&hspi2); Hal_DebugPrint("SPI2_HS1_ManulMode hspi2 State is: %d\r\n", state); }CS_High;and the setting case of SPI & DMA is, /* USER CODE
Hi, I have a problem with a minimal project using STM32CubeMX (version 4.27), an STM32F407VG and generating code for MDK-ARM5 (Keil). I create a new project, configure UART3 on pins PD8 and PD9. I add a simple printout on the UART in the main loop (not in an interrupt) giving the HAL_GetTick() as an ascii string and the value stays at zero continously. Similarly, any calls to HAL_Delay etc. hangs the processor. I've also tested to configure the RCC (HSE crystal) and clock settings (HSE 8mhz, using "resolve clock issues") in addition to the UART, but with the same results. Am I missing some other important configuration to be done in the CubeMX gui or should I add any user code to ensure that SysTick_Handler is called?The only added code are as below, in the sections indicated by the USER CODE comments in Src/main.c. /* USER CODE BEGIN 0 */ void uart_send (const char *str) { uint16_t size; for (size=0; str[size] != 0; size++); HAL_UART_Transmit(&huart3, (uint8_t *) str, size, HA
..
Hi, colleges!I'm still working with USB. Now it is STM32H743 Eval board. So, I tested example from Cube v1.3.0 HID-device. It didn't work. I've debuged and have seen no high signal on DP line after usb start (without V power detection). I don't now why I've no signal.Can anybody help me? Who has experience with H743 MCU USB module?
Hello, I'm trying to install X-Cube PLC1 software in CubeMX by Help->Manage Embedded Software Package ->From Local >en.x-cube-plc1.zip without success!Does anyone know if this is the correct procedure? I test X Nucleo PLC 01A1 by mbed and it works, but I prefer Truestudio but I 'm able to find only few info about that board.Thank!
Hi All, I am using STM32CubeMX HAL functions (STM32CubeF1 FW package V1.6.1 in STM32F100RCT MCU project) to handle 24LC128 I2C EEPROM comms. Followed the advice in the HAL library help:DMA mode IO MEM operation:Write an amount of data in no-blocking mode with DMA to a specific memory address using HAL_I2C_Mem_Write_DMA()At MEM end of write transfer HAL_I2C_MemTxCpltCallback is executed and user can add his own code by customization of function pointer HAL_I2C_MemTxCpltCallbackRead an amount of data in no-blocking mode with DMA from a specific memoryaddress using HAL_I2C_Mem_Read_DMA()At MEM end of read transfer HAL_I2C_MemRxCpltCallback is executed and user can add his own code by customization of function pointer HAL_I2C_MemRxCpltCallbackIn case of transfer Error, HAL_I2C_ErrorCallback() function is executed and user can add his own code by customization of function pointer HAL_I2C_ErrorCallbackSo my code looks as follows:Writing:if(CheckI2C1DeviceReady() == FALSE) { return I2C_E
Hi,microcontroller is stm32h743ZI.
I am working on a project using the STM32L476, freeRTOS, and am generating code using STM32CubeMX. My team has been happy to use freeRTOS kernel v9, which has been included with STM32CubeMX so far.However, I recently updated to STM32CubeMX version 4.27.0 and regenerated our project code. To my surprise, the project now says freeRTOS kernel v10.0.1. Curiously, the generated kernel files seem unchanged from version 9.So what is the roadmap for freeRTOS in STM32CubeMX? And is it a bug that the kernel is listed as v10, or that the v9 kernel is still generated?Thanks,Adam J.
Posted on March 14, 2018 at 08:07When the attached ioc file (minimal test case, consistently reproducible) is generated using CubeMX 4.24, firmware package V1.6.0 and built with TrueStudio 9.0.0 the processor locks up when it reaches the call to __HAL_AFIO_REMAP_TIM3_ENABLE() in HAL_TIM_MspPostInit for TIM3. The processor is an STM32F103RF. No additional code was added and no code modified from the original generated code.else if(htim->Instance==TIM3) { /* USER CODE BEGIN TIM3_MspPostInit 0 *//* USER CODE END TIM3_MspPostInit 0 */ /**TIM3 GPIO Configuration PC6 ------> TIM3_CH1 */ GPIO_InitStruct.Pin = GPIO_PIN_6; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);__HAL_AFIO_REMAP_TIM3_ENABLE(); // <<===== LOCKUP!/* USER CODE BEGIN TIM3_MspPostInit 1 *//* USER CODE END TIM3_MspPostInit 1 */ }The processor seems to lock up and t
How can generate the freeRTOS with STM32CubeMX. Could you explain the Steps ?
Hi, I am programming STM32F051R8TX controller using STM32Cube auto-generated code. The HSI clock for the controller is 8 Mhz which can be PLL’d to 48 Mhz. When I was using the discovery board (which has the same controller) the PLL was by default set to 48 Mhz and everything was working fine. Now have a custom PCB with the same controller in it and it seems that now the default setting is HSI 8Mhz. I didnt notice it before but I already tested code for LCD display, Printer etc and everything worked fine. Now when i noticed the HSI 8 Mhz clock I changed it to 48 Mhz using PLL option and the controller wont program again(After programming fine for first time). This code is generated by STM32Cube and the exact code works fine when i connect my discovery board to program. To make my board work I had to switch back to HSI 8 Mhz with no PLL, and now everything is back to normal. Why is it that I can use PLL in discovery board and not my PCB, Can anyone help me out with this problem?
Is there a way to set the mcu pinouts based on constraints imposed by the physical wiring of the board?[Gui extension]I'm dreaming of having the ability to add custom "rectangles" and "lines" to the pinout view which represent the wiring on the board. [text based]On the other hand, a solution based on text files would work, too. Is it advisable to write an application which generates files akin to the ones in /STM32CubeMX/db/plugins/boardmanager/ ?
My reading of the specs for the F7 series is that if an external clock is supplied to RCC_OSC_IN and HSE Bypass mode is selected then RCC_OSC_OUT is available as a general GPIO pin.CubeMX seems to want to assign it so I loose a pin!!
As in the title, I've just updated to 4.27.0 and it insists on enabling Scan Conversion mode. This causes my ADC code to fail. Since there are no alternate options, why is the item in the menus?
Hello,Please apologize if I am asking for trivial question but I have following problem. I have set in the STM32CubeMX pins which are used for SWD ( I am using th STM32F103CBT6 ) as an output pins. When I compile the software and program the micro looks that is working but I have lost access via debugger to MCU :(. Could you be so kind and help me to understand how to proceed in order to get back SWD capability. Thank you very much in advanceWith Best Regards,Jacek
I use STM32L0 series microcontroller with LL and CMSIS libraries, no HAL is selected in the advanced settings tab, only LL.And still, when I enable the "Flash and EEPROM global interrupt" in the Configuration -> NVIC, STM32CubeMX starts using the HAL library and generating code for it. As I understand, LL (at least for STM32L0) misses a module for working with Flash, but still, I think this is a bug.
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.