Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Codegeneration for QSPI/OCTOSPI currently fails to enable a required clock and also passes an invalid value in the initialization struct.This is important to fix because especially the clock-issue was very hard to identify (and avoiding such init-pitfalls is IMO the core reason for the whole Cube-stuff to EXIST).The generated function HAL_OSPI_MspInit should call:__HAL_RCC_OCTOSPIM_CLK_ENABLE()but it never does.In MX_OCTOSPI2_Init, there should be a line like:sOspiManagerCfg.Req2AckTime = 1;because this value is asserted to be non-zero in HAL_OSPIM_Config.Current workaround:Manually fix both in the user-section of MX_OCTOSPI2_Init: /* USER CODE BEGIN OCTOSPI2_Init 1 */ __HAL_RCC_OCTOSPIM_CLK_ENABLE(); sOspiManagerCfg.Req2AckTime = 1; /* USER CODE END OCTOSPI2_Init 1 */How to reproduce:Attempt to use OCTOSPI2 peripheral (USE_FULL_ASSERT required for the invalid-Req2AckTime-check).I can provide a fairly minimal *.ioc file if needed.Versions:CubeIDE 1.6.1, using STMCub
If any examples on such please if anybody finds or could share some of their experience would be of great help.Thanks in advance.
I have tried to set up the second example from "Mastering STM32" in the DAC chapter using STM32CubeMX. I'm struggling a bit with DMA in general as well. The first (non-DMA) example seemed to work fine for me in making the LED breathe. I then modified the STM32CubeMX project to try it out with DMA, and got stuck. I was hoping that there was something simple that I missed (I did start the timer ...).I have overridden the PA5 pin for DAC1_OUT_2.I have used TIM6, which is connected to APB1 at 80 MHz (I assume).pseudo-code-y setup for ease of reading?TIM6.Prescaler = 8192 - 1TIM6.CounterMode = UpTIM6.CounterPeriod = 8192 - 1TIM6.Auto-ReloadPreload = DisableTIM6.EventTriggerSelection = Update EventI also set up the DMA for TIM6 with the "ADD" button. I set it to be circular, peripheral not incremented, memory *is* incremented, transfer is half-word to half-word, and is DMA1_Channel3.For DAC1, I have set Channel 1 to disabled, Channel 2 to connect only to the external pin (PA5, which is conne
Hello Community,I use the STM32L4R9ZITx and would like to save data on a MicroSD card via SDMMC1. Usually I use the SD 4 bit wide bus mode. After an update of CubeMX and the HAL layers now two more options are offered. One is "Auto Dir Voltage Converter", which occupies another pin (SDMMC1_CDIR) and the other is "Dir Voltage Converter", which selects an other pin (CKIN) in addition to CDIR. Since the identifiers are unknown to me and until now the pure 4 bit mode worked, I wanted to know what these two options are used for? Googling the identifiers was not very informative. I look forward to more information.
This topic was covered for the case of HAL in this thread:https://community.st.com/s/question/0D53W00000rZAQM/default-hsi-calibration-value-wrong-in-stm32cubeideBut my case is for LL which still seems to have this issue, in the generated code. I found this problem because the baud rate of 115200 on USART2 was so far off that serial comms was not possible. This is only a problem when RCC is set to use LL. When RCC is set to use HAL, the correct value of 64 is used for HSI calibration and I had no serial comms problem.I believe I am on latest STM32CubeIDE software and toolchain repository for my board:STM32CubeIDE:Version: 1.6.1Build: 9958_20210326_1446 (UTC)Repository version: STM32Cube_FW_L4_V1.17.0Another issue: It seems the Configuration Pane for RCC will not let me set this parameter (HSI Calibration Value) to the correct default value of 64. It is being limited to 31.The generated code from main.c is below. The line in question is: LL_RCC_HSI_SetCalibTrimming(16);------------------
I can transmit data to my computer when I used HS CDC in FW_H7_V1.8.0 of CubeMX6.0.1. Yesterday, I updated CubeMX6.0.1 into CubeMX6.2.1 and also used FW_H7_V1.8.0, but the HS CDC showed STMicroelectronics Virtual COM Port error code "10".So, I set up heap size in 0x1000,0x2000,0x4000, it can't solve error code "10".Then I used FW_H7_V1.9.0, the HS CDC show unkown device.What should I do?
I'm learning arm, I have a custom board with a STM32F4 MCU and a debug probe with JTAG 20 pins.In CubeMX System Core> SYS> Debug I have this option:- Serial Wire- JTAG (4 Pins)- JTAG (5 Pins)- Trace Asynchronous Sw- JTAG with Trace with Synchro (1 bit)- JTAG with Trace with Synchro (2 bit)- JTAG with Trace with Synchro (4 bit)So my big question is which mode should I use JTAG (4 Pins) or JTAG (5 Pins). I don't understand the difference. My board has this label:SWD> 3V3, DIO, CLK, GNDJTAG> 3V3, TDI, TMS, TCK, TDO, GNDAlso please someone briefly explain to me what the other modes are used for?
Dear ST community,there seems to be a bug in the latest version of the initialization code creator. I'm using STM32Cube IDE Version: 1.6.1 Build: 9958_20210326_1446 (UTC) with the included STM32CubeMX 6.2.1.20210324. The firmware package is STM32Cube FW_H7 V1.9.0 and the MCU reference is STM32H7A3ZITx. The particular MCU is STM32H7A3ZIT6 (not the Q version with integrated SMPS)The bug: Every time when creating the code from STM32CubeMX, the supply is configured to use the SMPS instead of the LDO:HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY);This flag does not exist and I need to manually correct it toHAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);It only happens since i updated to the latest version of STM32CubeMX.Does anyone experience the same? I cannot find a relevant setting in the STM32CubeMX GUI.
I’m using STM32CubeMX 6.2.1, STM32CubeIDE 1.6.1 and STM32Cube_FW_H7_V1.9.0. I found that the MX generated init code (LL) for DAC2 calls LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_DAC12) when it should call LL_APB4_GRP1_EnableClock(LL_APB4_GRP1_PERIPH_DAC2). The generated HAL init code has the same problem.
Hi everyone!I am going to use the EEPROM emulation library for stm32f407vet6 microcontroller. I downloaded it from the ST site, and then added the files "eeprom.h" and "eeprom.c" in my project. I told the compiler the path to the folder in which I store these libraries, but the project produces a large number of build errors. It seems that some of the definitions used in eeprom.c are missing in eeprom.h. In addition, some definitions are determined to be erroneous in eeprom.h. My question is this: how to properly connect these libraries and overcome these errors? I will attach some screenshots. Thanks in advance, and sorry for the translator, I'm not an English speaker.
I'm working on the NUCLEO-H745ZI-Q development board and recently configured the clock to its max 480 MHz through STM32CubeMx and tried debugging the code generated by CubeMx on STM32CubeIDE. While suddenly the micro failed to respond after the `SystemClock_Config();` step. From then the micro is failed to communicate with STlink. /** * @brief System Clock Configuration * @retval None */ 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_SCALE0); while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} /** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDef structure. */ RCC_OscInitStruct.OscillatorType
When I try to create stm32 project using CUBEIDE, I accidentally click "cancel". Then CUBEIDE delete the folder generated by them which it is good. After that, it delete all of my files inside one higher level parent directory. WTF!! This is severe bug. Also it can't be restored easily (nothing in recycle bin). Don't ask about using recovery program, some file is already corrupted (I already try it)Imagine that you create file on C:\, does it will delete all of my files in drive C: how severe it is..:loudly_crying_face:
Hi, I'm trying to read ADC value from multiple ADC channels but reading the same ADC value for all channels.This is my code snippet. Please support to fix it asap.#include "main.h"/* Private includes ----------------------------------------------------------*//* USER CODE BEGIN Includes *//* USER CODE END Includes *//* Private typedef -----------------------------------------------------------*//* USER CODE BEGIN PTD *//* USER CODE END PTD *//* Private define ------------------------------------------------------------*//* USER CODE BEGIN PD *//* USER CODE END PD *//* Private macro -------------------------------------------------------------*//* USER CODE BEGIN PM *//* USER CODE END PM *//* Private variables ---------------------------------------------------------*/ADC_HandleTypeDef hadc;/* USER CODE BEGIN PV */uint16_t ADC_VAL[3];uint8_t adc_index=0;/* USER CODE END PV *//* Private function prototypes -----------------------------------------------*/void SystemClock_Config(void);sta
CubeMX 1.x has wrong default configuration for H7B3I-DK board. The PINs, display ... has wrong setup.i.e. CubeMX configure H7B3I-DK with 640x480 display but H7B3I-DK has only 480x272 display.
the project is created from CubeMX, STM32F091CCT
I am trying to output One Pulse Mode, however the output is not back to 0V when the pulse is complete. The One Pulse is started with a button interrupt.The timing of the One Pulse is correct, but when the pulse is finished, the output was set to high. And this created another problem, the button would not trigger One Pulse again.void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1); HAL_TIM_Base_Start(&htim2); HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1); HAL_TIM_OnePulse_Start_IT(&htim2, TIM_CHANNEL_1); }static void MX_TIM2_Init(void) { /* USER CODE BEGIN TIM2_Init 0 */ /* USER CODE END TIM2_Init 0 */ TIM_ClockConfigTypeDef sClockSourceConfig = {0}; TIM_MasterConfigTypeDef sMasterConfig = {0}; TIM_OC_InitTypeDef sConfigOC = {0}; /* USER CODE BEGIN TIM2_Init 1 */ /* USER CODE END TIM2_Init 1 */ htim2.Instance = TIM2; htim2.Init.Prescaler = 0; htim2.Init.CounterMode =
Dear All, As you know well STM32CubeMX IDE is showing clock configuration block diagram which is the user programmable interface as showing in the attached picture. My question is ....Can we able to see all the timer block diagrams also in the format of clock configuration Please advice
I started a STM32 framework project here: https://github.com/FBergemann/STM32-FreeRTOS-Framework/tree/dev-usb-host-msd. And i am currently busy to set up logging to console and USB FS (as Host to USB stick). But i didn't manage to enable USB OTG FS. I think it's due to an error in enable VBUS. Because in https://github.com/FBergemann/STM32-FreeRTOS-Framework/blob/dev-usb-host-msd/USB_HOST/Target/usbh_conf.c there is #79 GPIO_InitStruct.Pin = USB_VBUS_Pin;#80 GPIO_InitStruct.Mode = GPIO_MODE_INPUT; /* wrong?! */#81 GPIO_InitStruct.Pull = GPIO_NOPULL;#82 HAL_GPIO_Init(USB_VBUS_GPIO_Port, &GPIO_InitStruct);I followed instructions according http://evenlund.blogspot.com/2016/10/usb-storage-with-stm32f4-discovery-and_58.html and https://www.youtube.com/watch?v=uIOb5sSFyUY.Can you please tell me, what i am doing wrong here?- thanks!regards,Frank
I've just switched to working on an STM32F411-E DIscovery. Starting a new project (STM32CubeIDE) and allowing it to populate the default peripheral config for the board is generating code that will not run (at least not for me).The clock configuration halts in the Error_Handler after a timeout in the HAL_RCC_OscConfig() call prior.This is on a completely virgin generated project with no code of my own added or alterations from the defaults. I have several of the same board and they all show the same problem. I don't recall having this problem in the past however it is a considerable time since using one of these boards.I've not got this same behaviour on the non-Discovery STM32F411CE boards I have.I've also not seen this problem on any of the Nucleo boards I've got.This is with IDE version 1.6.1 and firmware package F4 1.26.1What would be causing this? Before I start manually changing the clock configuration to try and sort this I thought it worth a check to see if anybody else experie
I get a strange Error Message during the Code-Generation Process in STM CubeIDE for a STM32F4 target:The Details: I am using STM CubeIDE for an embedded Project with an STM32F405 Microcontroller and I have added the CMSIS Package 5.7.0 to the project, because i need some of the DSP functions. I have allready done this before and never experienced such an error message.The message pops up during the Code-Generation process, after changing something in the Hardware-Setup with the (built in) CubeMX. It occurs two times during the Code Generation process. I can click on "OK" and it does NOT interrupt the Code Generation process, which seems to finish successfully. I can also compile the project without errors and it seems to work ok.The Question: Even though it seems to work properly, I'd like to know: what is this, where does it come from, and what can I do to solve this? I'm affraid that might lead to some unpleasant sleeping bugs or other nasty stuff ...Has anyone experienced anything s
Hi, everyone!I have a custom board with an STM32H7. I configured SDMMC2 correctly on it. As you can see there is no options for configuring DMA since it has an Internal (I)DMA.I have also added FATFS, as follows. I managed to write/ready successfully to SD CARD mounted via FATFS. My problem arises when I enable the ‘Use DMA Template’. It is a must in order to later add FreeRTOS to the project.After hours of debugging I realized that:f_write() calls disk_write(), which calls sd_write(), which calls BSP_SD_WriteBlocks_DMA(), which calls HAL_SD_WriteBlocks_DMA(), and does not return any errors.In sd_write(), WriteStatus desn’t get set to 1 [in sd_diskio.c] and times out.HAL_SD_IRQHandler() gets called but it subsequently never calls HAL_SD_TxCpltCallBack() (which should eventually via many wrappers set WriteStatus to 1), and completely skips it.I get HAL_SD_ERROR_TX_UNDERRUN.Any help is highly appreciate it :folded_hands: .
Hi - I have a Nucleo-F746ZG that I am configuring in CubeMX (version 6.2.1). When configuring it I am trying to only set up the RTC and UART3. UART3 is set up to print to the USB virtual COM port (and that works fine).In CubeMX, once I start a new project, I go to the "Timers" tab, the to the "RTC" node, then select the checkbox for "Activate Clock Source."The only changes I made to the generated source code were in the main method. I understand from reading the source code for stm32f7xx_hal_rtc.c that it is important to call HAL_RTC_GetTime and then call HAL_RTC_GetDate.Inside of main, in USER CODE BEGIN 2:RTC_TimeTypeDef current_time; RTC_DateTypeDef current_date; HAL_RTC_GetTime(&hrtc, &current_time, RTC_FORMAT_BIN); HAL_RTC_GetDate(&hrtc, &current_date, RTC_FORMAT_BIN); printf(" H:M:S = %02d:%02d:%02d\r\n", current_time.Hours, current_time.Minutes, current_time.Seconds); HAL_Delay(2000); printf(" H:M:S = %02d:%02d:%02d\r\n", current_time.Hours, current_time.Minute
The ioc found in FP-AI-SENSING does not match. There is no ioc file found in FP-AI-CTXAWARE1. I just want to change the Keras Model for something very similar to the ASC example.
..
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.