Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
This seems like an easy one, but I've searched high and low. Both STM32CubeMX (v6.9.2) and STM32CubeIDE (v1.13.2) place generated code in a root folder named Core. Is there a way to configure file placement into folders of my choice?
Hello,We're trying to configure the H7 for use with 2x PDM mics, with an effective sample rate of 16 kHz. I believe the input clock to the microphones them selves should be 2.048 Mhz, yet CUBE MX produces an AudioFrequency field value of 16 kHz?Strange, the examples for the F7 boards use the proper frequency when interfacing with PDM mics.Is it a bug or am I understanding the values incorrectly...
I am now trying to implement CDC-VCP connection between a PC and a STM32 board. Just my goal is a STM32 echo server.I have done like this: STM32 Cube MX : USB FS endableUSB Device : CDC Enable, rx/tx buffer size as 128<-1000Clock config : USB 48MHz and other config is done by "resolve clock issue"SYS : serial debug enabledRCC : Enable LSC as Crystal/CeramicCode : in "while" body, #include "usbd_cdc_if.h"add Hal_Delay(500)CDC_Transmit_FS(tx, strlen(tx));Debug :debug by STLinkconnection : PC <-USB cable->STM32 (L432KC, L073RZ both)Result : uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len){ uint8_t result = USBD_OK; /* USER CODE BEGIN 7 */ USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*)hUsbDeviceFS.pClassData; if (hcdc->TxState != 0){ return USBD_BUSY; //<-Always triggered } USBD_CDC_SetTxBuffer(&hUsbDeviceFS, Buf, Len); result = USBD_CDC_TransmitPacket(&hUsbDeviceFS); /* USER CODE END 7 */ return
第一次在论坛中请教问题,如果有不对的地方,请及时通知修改,感谢 我在使用STM32H750XBH6 ,在使用STM32CUBEMX 自动生成代码时出现了问题,DMA的初始化代码没有自动生成,在不停地测试中发现,DMA Request 选择 dma_generator0-dma_generator7、MEM2MEM , 可以生成代码,选择定时比较捕获输出通道作为请求源没有自动生成代码(例如 tim4_ch1\ch2 ,tim3_ch3\ch4),cubemx版本号6.92,希望可以得到一些解决的建议 ,感谢
Hi, I assigned all used GPIOs to desired functions except the PC2 at ball M1. The datasheet seems doesn't indicate this pin would be something special. I just need SPI2_MISO there but MX doesn't allow select anything, all choices are off just the Reset_State. Is it a bug? I use latest version of MX 6.9.2.
Hello.I'm using a development board STM32H747I Disco. i'm using a DAC to output a Sinus signal and read it through the ADC. the DMA is able to store the data correctly in normal mode, but not in circular mode. If the DMA can fit exactly one or more cycles of data then the result is correct, otherwise the result is very confusing. My ADC code references the ADC_DMA_Transfer tutorial for the H7 platform to invalidate the cache at half and full DMA. And set the buffer alignment at the beginning./* Definition of ADCx conversions data table size */#define ADC_CONVERTED_DATA_BUFFER_SIZE ((uint32_t) 256) /* Size of array aADCxConvertedData[] *//* Variable containing ADC conversions data */ALIGN_32BYTES (__IO uint16_t aADCxConvertedData[ADC_CONVERTED_DATA_BUFFER_SIZE]);Can anyone help me please?
Hello,Finally I managed to produce a three-phase PWM in classic DMA mode with the pure HAL-Lib. (Hardware: NUCLEO-H563ZI) However, within the cube produced routine, file: tim.c:void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* tim_pwmHandle) This wrong call appears: __HAL_LINKDMA(tim_ocHandle, hdma[TIM_DMA_ID_CC4], handle_GPDMA1_Channel3); It should be :__HAL_LINKDMA(tim_pwmHandle, hdma[TIM_DMA_ID_CC4], handle_GPDMA1_Channel3);To get rid of this error when re-generating the code from the Cube MX, I added /* USER CODE BEGIN TIM1_MspInit 0 */ #define tim_ocHandle tim_pwmHandle /* USER CODE END TIM1_MspInit 0 */ Did I something wrong or can this be fixed in the future?Thanks a lot,Andreas Code generated by CubeMx: void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* tim_pwmHandle) { GPIO_InitTypeDef GPIO_InitStruct = {0}; DMA_NodeConfTypeDef NodeConfig= {0}; if(tim_pwmHandle->Instance==TIM1) { /* USER CODE BEGIN TIM1_MspInit 0 */ #define tim_ocHandle tim_pwmHandle /* USER CODE END TIM1_
Hi,I have a project where I need at least 8 PWM input channels, 10 would be great. I can't see a method to filter by PWM input on the website or in STM32CubeMX. I would like to round it down to a few devices and compare them on cost, package, etc. Is there a method to do this that I'm missing?At the moment I'm simply choosing the devices with the most timers and working through the list 1 by 1 using STM32CubeMX, this is quite a slow approach.Any advice is welcome. Thanks
Hello!When I took a project on version 6.0.0 and compiled it - it works stable. After CubeIDE offered to migrate to a fresh version 6.9.2 and I agreed, I set my Driver_PHY. After that the project builds, but not working.My source data:Nucleo-F767Zhttps://github.com/Jabed-Akhtar/STM32F767ZI_Nucleo-144_CubeIDE_Examples/tree/main/Eth_UDP_Client_v1.0 Best regards,Daniel Ruchess UDP: This works on CMSISv1, but does not work on CMSISv2
I am getting error in auto generated code. While doing Init for RNG peripheral at very first time just after flash it's going in error loop and later upon reset, it is working fine. This behaviour I observed in debugging mode. What is the issue can you help?
Hello All,Goodday! Iam trying to configure the STM32G431RB with Cube, getting warnings when ADC-IN selected in some of the pins, and the same warnings get cleared if selected with GPIO_Analog option too. Can anyone explain please.
I have connected STM32C031C6T6 board to my device but it has not been detected for some reason, it was working fine before but not working now, I have reset it as well still no use, kindly tell me what to do.
I have stm32 bluepilll on which I am able to transmit CAN messages but CAN Receive interrupt is not generating.I found while configuring that CAN RX pin(GPIO mode) is getting configured as Input mode. How accurate is this?I think it should be Alternate function. I made PB8 as Alternate function still CAN Rx interrupt is not working.Above statements are under stm32f1xx_hal_msp.cI am using CAN RX1 interrupt, following are my configurationsstatic void MX_CAN_Init(void){ /* USER CODE BEGIN CAN_Init 0 */ /* USER CODE END CAN_Init 0 */ /* USER CODE BEGIN CAN_Init 1 */ /* USER CODE END CAN_Init 1 */hcan.Instance = CAN1;hcan.Init.Prescaler = 9;hcan.Init.Mode = CAN_MODE_NORMAL;hcan.Init.SyncJumpWidth = CAN_SJW_1TQ;hcan.Init.TimeSeg1 = CAN_BS1_3TQ;hcan.Init.TimeSeg2 = CAN_BS2_4TQ;hcan.Init.TimeTriggeredMode = DISABLE;hcan.Init.AutoBusOff = ENABLE;hcan.Init.AutoWakeUp = DISABLE;hcan.Init.AutoRetransmission = ENABLE;hcan.Init.ReceiveFifoLocked = DISABLE;hcan.Init.Tr
I am using Stm32L476rg controller and generated project using Cube-MX including clock settings.Controller giving error of HAL_timeout error in HAL_RCC_ClockConfig() function. I am using MSI clock for configuration.For reference I have attached screenshot of the clock settings generated by Cube-Mx.what is the reason that controller get stuck after this error, is there any solution for the same issue?
I'm creating a new project for STM32G030F6P6 in STM32CubeMX. It says 32 kBytes flash. But when I look at the generated project in the file stm32g030xx_flash.icf it says: /*###ICF### Section handled by ICF editor, don't touch! ****/ /*-Editor annotation file-*/ /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ /*-Specials-*/ define symbol __ICFEDIT_intvec_start__ = 0x08000000; /*-Memory Regions-*/ define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; define symbol __ICFEDIT_region_ROM_end__ = 0x0800FFFF; define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; define symbol __ICFEDIT_region_RAM_end__ = 0x20001FFF; So it says to the linker that the flash memory is 0x08000000 - 0x0800FFFF (this is 64 kBytes flash).I have tested saving data on address 0x0800f800. This works. And STM32CubeProgrammer is also able to read the data. The data sheet says this MCU shall have 32kByte flash but it works as a 64kByte.
I am trying to set up USB OTG FS as CDC(virtual com port). For the other Nucleo board (Nucleo F746ZG) I was able to set it up in middleware section of CubeMx GUI. With the STM32U575ZI-Q board, the option(USBX) is disabled. Also, in the device manager or computer, the port is not recognized. I am using C-type USB to USB-A also tried with C-type to C-type.
When I click ACCESS TO MCU SELECTOR, the console prints : 2023-01-18 14:35:27,011 [INFO] MultiScanPanel:196 - Auto-refresh data requested => check proxy status ongoing 2023-01-18 14:35:27,014 [INFO] FinderPluginLoader:92 - Searching for filters in installed packs Failed to load native library:sqlite-3.34.0-2c9e6182-4a79-4303-b6d5-9dd5ff21406c-libsqlitejdbc.so. osinfo: Linux/x86_64 2023-01-18 14:35:27,102 [ERROR] MicroXplorer:720 - Failed to load native library:sqlite-3.34.0-2c9e6182-4a79-4303-b6d5-9dd5ff21406c-libsqlitejdbc.so. osinfo: Linux/x86_64 java.lang.UnsatisfiedLinkError: /tmp/sqlite-3.34.0-2c9e6182-4a79-4303-b6d5-9dd5ff21406c-libsqlitejdbc.so: /tmp/sqlite-3.34.0-2c9e6182-4a79-4303-b6d5-9dd5ff21406c-libsqlitejdbc.so: failed to map segment from shared object com.st.microxplorer.db.DbException: Can't connect to CubeFinder SQLite database (/home/maegami/.stmcufinder/plugins/mcufinder/mcu/cube-finder-db.db): Error opening connection at com.st.microxplorer.mcufinder.db.DbUtils.l
I am using above settings and functions for RTC and One Alarm, also attached with this post as RTC_and_One_Second_Alarm_Setup_using_STM32hxxx.pdf, please review and let me know if you see any issue. Thanks in Advance.
I have followed this tutorial and gotten FATFS working perfectly on the Nucleo-L4R5ZI-P however I am trying to transfer my code to the STM32L4Q5CGU6 and the option under;middleware -> FATFS -> FATFS Mode and Configuration -> there is no option for SD Card The chip advertises SD functionality it has an SDMMC channel, I'm assuming this is an error in STM32CubeIDE not recognising it as the STM32L4Q5CGU6 has SDMMC2 and not 1.Is there a way around this or how can it be solved? Thankshttps://community.st.com/s/article/how-to-create-a-file-system-on-a-sd-card-using-stm32bubeide
Hi,I cannot enable SPI1 interface in CubeMX with STM32F427.I only see the message "I2S1" must be disabled":But I2S is not used in my project.In Pinout view it is possible to select Pins PA4 to PA5 and PB5 for SPI1-sugnals without error messages.Whats wrong here?
Because I don't want use HAL , but want use the possibility to configure pins with CubeMX
HiI will setup an application on my STM32H743ZI2 which should make a Client socket connection using the LwIP and netconn. When i'm uisng the LwIP HTTP Server Netconn RTOS example i can make it work and the Netonn API functions is working,If i instead of uising the example is starting a project using CubeMX and Enabling the LwIP, activating the FREETOS, enabling the CPU iCache and DCache.In the LwIP settings i activate the LWIP_NETCONN (NETCONN API) and checking that the follwing, described, is set correctly LWIP_NETCONN (NETCONN API)Diagnostic:Dependency: Use NETCONN API requires NO_SYS=0 and MEMP_NUM_TCPIP_MSG_API>0 if MEMP_MEM_MALLOC is disabled.Parameter Description:When this parameter is enabled, Netconn API is enabled (require to use api_lib.c). I'm then generating the project to run in Keil and in the main. c i #include the api.h, in lwipopts.h i define the LWIP_NETCONN. Within the thread in just using the same setup as in the working e
..
Hello, I get this error can't figure this out. Any ideas?
Hello. I have been dealing with USBx host HID application for a while trying to find a soluction to my problem but despite that I dont know what else to look for to make it work. I'm working with Cube 6.9.2 and with its lastest library STM32Cube_FW_U5_V1.3.0. on a STM32 U575 microcontroller. I do not use USBPD, but I have seen the examples are provided, and in base to that I try to aply ir to my own project not using that specific library. Working with threadx. Clock configuration for USB is correct at 48Mhz, and USB HAL_HCD_IRQHandler is being called if I plug a keyboard. The problem I have is that no matter what I do, always ends calling "ux_host_error_callback" and logs "UX_DEVICE_ENUMERATION_FAILURE". Any ideas as what to to to solve it are welcome.Thanks
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.