Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello ST community,When I use OpAmp's of STM32G474 and configure all of them to internal ADC connection, all of them still reserve external output pins as analog .I'm using : OpAmp's in Inverting mode, with PGA enabled, positive input internal connection to DAC, output internal connection to ADC. So only one analog pin have external connection, it's VINM0 which is going to PGA on OpAmp inverting input. Please tell which OpAmp mode need be used for my need ? This behavior can be seen in CubeMx when selecting OpAmp mode to:"PGA Connected-INVERTINGINPUT_IO0_BIAS-DACx_OUTy-INP" Generated code reserve not needed pit too.
Is it possible to install and configure Function and Expansionpacks with STM32CubeMX Tool?I can see support for X-CUBE-AI, X-CUBE-BLE1, X-CUBE-MEMS1, X-CUBE-NFC4 but neither SOUNDTER1 nor SMARTMIC1.
Using the latest version 5.5 of stm32cubemx. When I try and generate a new project I get the following error after clicking generate codeThe resulting project file is unusable.I've attached the ioc file for this project.I'm presuming this is a bug that has to be fixed by the cube team, but if someone could come up with a workaround in the meantime ;)CheersGlen.
I have already looked at others post regarding this problem but none of the solutions seems to work.
Hi all,I'm using STM32H750VBT6 and CubeMX 5.5.0 for my project. My problem is that I couldn't read ADC values using DMA. I have tried many ways but still stuck on this. Please provide any solution to this.Thanks,Duc-Toan Tra
Hello, I am using STM32H753 and STM32CubeMX. In my application I use four timers timers. Two timers are used to generate PWM signaly, and the other two are used to generate time base interrupt. All four timers are synced together using the internal triggers. From the two timers, which generate time base interrupt one of them is used to control sampling rate of an ADC and the other is used to turn of all four timers after a specific time. I run the above process, running the two PWMs and the other two timers, multiple times. The first time everything works perfectly. Timers start together and run the adc and PWMS, and the last timers turns everything off at the right time. The problem is that the second time that I run the process, the timer that runs the ADC works longer than expected. In other words, when the last timer turns all timers off, the timer that controls the ADC has worked longer than expected (some milli seconds, but in my application this produces a problem) My code is re
Hi,I'm using the nucleo-h755xi for testing purposes and I'm doing configuration by using CubeMX.I have opted to using the FreeRTOS middleware for both cores, CM7 will be using TIM6 and CM4 will be using TIM7 to generate ticks for the OS.Now my question is, looking at the generated code and my settings over at CubeMX. The configuration looks as follows (I've underlined one result with red for future reference):Now, in the reference manual it says:This is how the Timer6 is supposed to look like.The generated code for HAL_InitTick looks like this:HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) { RCC_ClkInitTypeDef clkconfig; uint32_t uwTimclock = 0; uint32_t uwPrescalerValue = 0; uint32_t pFLatency; /*Configure the TIM6 IRQ priority */ HAL_NVIC_SetPriority(TIM6_DAC_IRQn, TickPriority ,0); /* Enable the TIM6 global Interrupt */ HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn); /* Enable TIM6 clock */ __HAL_RCC_TIM6_CLK_ENABLE(); /* Get clock configuration */ HAL_RCC_GetClockCo
Hi,I want to connect USB Mouse with my Discovery Board and want to communicate with USB protocol. Where USB device --->> USB mouseUSB HOST --->> STM32F407VGT6 Discovery Board.IDE --->> STMCube IDE and STMCubeMX for HAL Library for easy understanding.Questions :Q.1: I am not getting any example so i can test. I am sure Mouse and Keyboard examples are very common but I am not getting easily.Q.2: I tried by myself using HAL library but When I am connecting my mouse with "Board". My mouse is not getting any power because Red Led which mouse has, is not glowing. Which directly means emuration process fails. Although I check my hardware which seems perfectly fine. except I am not getting 5V to operate a wired mouse.I am attaching schematic for your reference where you can search CN5.Can anyone face similar issue with this Board ? Q.3: I used you Function which i add by myself into main file. -->> USBH_StatusTypeDef USBH_HID_MouseInit(USBH_HandleTypeDef *phost); -->
Hello, I am using a stm32h753 and stm32cubemx, and trying to run the RTC module on VBAT. To do this I have connected a battery to the MCU. RTC is connected to LSE. Next, I set the RTC in my code and then I disconnect the MCU from power source, and then reconnect it again. Based on the documentation, this should automatically switch the RTC power source from VDD to VBAT.I have commented the MX_RTC_Init() in the startup, so that RTC is not reset when the MCU restart. Below are the code for system clock config, RTC Init, and the code to read the RTC registers after reset.void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; /** Supply configuration update enable */ HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); /** Configure the main internal regulator output voltage */ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); while(!__HAL_PWR_GET_F
I want to implement a lock-in detection on stm32f373cct6 that means that I need to trig the DMA of the DAC and the DMA of the SDADC with the same timer.I am using CubeMx to confugure the stm32f373cct6.I want to trig the DMA of the injected SDADC1 with TIMER 3 (see pic1 and pic2) but it doesn't work.(I succefully trig the DMA of DAC1 with TIMER 3)What did I miss ?
Hi everyone,On my STM32F429-Disco Board the WWDG-Handler triggers everytime there is an Interrupt, that I didn't configure through CubeMX. I wanted to add another UART and enabled the RXNE Interrupt. As soon as anything happens on the RX line the WWDG triggers. Same thing with the external Interrupt on a GPIO. As soon as I pull the Pin High or Low the µC freezes.Any idea what I'm doing wrong?
Hello,I'm trying to connect SDRAM to STM32 for the first time and I'm having trouble understanding the specs.In the datasheet, it seems the FMC peripheral can support 32bit memory.But when I use the Cube MX setting, I'm only able to select 16 bits for the Data.Is there something that I'm missing in the data sheet?
The function BSP_SD_Init() is called once the basic SD card initialisation is complete, and after the SD clock speed has switched from 400 kHz(*) to full speed.If the bus has been configured in Cube to use 4-bit mode, the following call chain occurs, which ultimately reads the SD card's SCR register, to check if it supports 4-bit mode: BSP_SD_Init() -> HAL_SD_ConfigWideBusOperation() -> SD_WideBus_Enable() -> SD_FindSCR() -> SDMMC_CmdSendSCR()We found that different cards respond differently to this command at full clock speed. Some work most of the time, but sometimes fail. Some respond to the command without error - but report that the register contents (stored in scr) are zero. And some never respond to the command, causing the code to enter the timeout loop - which is unfortunate because SDMMC_DATATIMEOUT is set to (essentially) forever, so the code gets stuck here.Although the SD spec (if we've understood it correctly) seems to suggest that it should be fine to read th
@The things i use:Hardware: Stm32F446RESoftware: CubeMX V.5.4 ; Matlab R2019b ; CubeIDE V.1.1 ; Mat-TargetMy Question is: Where is the Mistake in my Programm. I defined the PA5 as a Gpio output because that´s the Output for the LD2 LED on my board which should glow. Should i use a boolean or something else? Did i include the right Folders into the Debugsection?In Ide I had todeactivate one main.c data, because otherwise the programm had an error, that there would be two main.c datas and that it isnt able to debug. Also i had to deactivate the getbuffptr.c data in the Simulink options because i got an error: no file or directory with that namePls write everything that could be a possible Solution why the LED doesnt work/glow up(I added some Screenshots, hoping they are helpful)
https://github.com/STMicroelectronics/STM32CubeF3/issues/4
Hi there,I'm using the H7 dual core MCU's and using the M4 core for USB CDC.There is an issue with using the M4 core with USB CDC.The reference manual states at page 137 that address 0x1FF00000 - 0x1FF1FFFF is available to the M7 core as "System Memory". For the M4 core it is reserved unfortunately.This means that reading the "Unique device ID register" is not possible with the M4 core as it's at 0x1FF1E800.However the Unique device ID register is read in usbd_desc.c at the function Get_SerialNum:static void Get_SerialNum(void) { uint32_t deviceserial0, deviceserial1, deviceserial2; deviceserial0 = *(uint32_t *) DEVICE_ID1; deviceserial1 = *(uint32_t *) DEVICE_ID2; deviceserial2 = *(uint32_t *) DEVICE_ID3; deviceserial0 += deviceserial2; if (deviceserial0 != 0) { IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8); IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4); } }#define DEVICE_ID1 (UID_BASE) #define DEVICE_ID2 (UID_BASE + 0x4) #d
https://www.youtube.com/watch?v=-tvaeeJMW1w .
Hello when I enter NVIC settings for timer interrupt, there are different interrupts for TIM1. Such as: TIM1 break interrupt, TIM1 update interrupt, TIM1 trigger and commutation interrupts and TIM1 capture and compare interrupt. What is the difference between these interrupts? I want to use timer 1 as global timer interrupt but there is no option for that in CubeMX. Which interrupt I can use for this purpose?
I am trying to setup a PWM output with Timer 4 by using CubeMX. When starting the code it always stops at command HAL_TIM_PWM_Start(&htim4,TIM_CHANNEL_1)Attached are the setup in the main() and setup in the CubeMX.Any ideas what am I missing? MX_GPIO_Init(); MX_SPI1_Init(); MX_TIM4_Init(); HAL_TIM_Base_Start(&htim4); HAL_TIM_PWM_Start(&htim4,TIM_CHANNEL_1);
..
Here's the context:I'm working on a STM32H743, I managed to output the array values manually to GPIOD (ie my MCU is not fried... You never know)I paid close attention to using the correct region D2 as stated here : //In my main.c: #define BUFFER_SIZE 32 #define __SECTION_RAM_D2 __attribute__((section(".RAM_D2"))) /* AHB SRAM (D2 domain): */ volatile __SECTION_RAM_D2 uint16_t Buffer[BUFFER_SIZE] = {0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF}; //In my STM32H743xxx.Id, at the end of the file: /* Definition for DMA area */ .RAM_D2 : { KEEP(*(.RAM_D2)) /* ORIGIN = 0x30000000, LENGTH = 288K */ } >RAM_D2After my init sequence, and before my main loop, here's the part dealing with the DMA (and my timer !): __HAL_TIM_ENABLE_DMA(&htim1, TIM_DMA_CC4); HAL_DMA_Start_IT(htim1.hdma[TIM_DMA_ID_CC4], (uint32_t)Buffer, (uint32_t)DAC3_D0_GPIO_Port->ODR, BUFFER_SIZE); HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_3); HAL_TIM_PWM_Start(&htim1, T
When I have enabled USB Device for stm32f3discovery, the usbd_conf.c had this lines (59..63):#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) static void PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state); else void HAL_PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state); #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */Notice the "else" without hash (#) symbol.
Hello, when I create a project from CubeMX, compiler does not let me build it and gives me Selected processor does not support '***' 0xF in Thumb mode error. To test it I have created an empty project from CubeMX and did not assign any pins or anything. Even in that case, compiler still gives the same errors. I am using Nucleo-F746 board. I have tried to change the instruction set to Thumb and ARM from Thumb2, but I guess that is not that solution. How can I fix this issue? Thanks beforehand.Here is the screenshot of the errors:
This is a cross-post from https://stackoverflow.com/questions/59856541/stm32f3-cubemx-generated-usb-hid-device-sends-wrong-data-when-both-endpoint-andI'm debugging a problem with a composite device that I'm creating, and have recreated the issue in freshly-CubeMX-generated HID-only code, to make it easier to resolve. I've added small amount of code to `main()` to let me send ISB HID mouse-clicks, and flash an LED, when the blue-button is pressed. ... uint8_t click_report[CLICK_REPORT_SIZE] = {0}; extern USBD_HandleTypeDef hUsbDeviceFS; ... int main(void) { ... while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ if(HAL_GPIO_ReadPi
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.