Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I just got started with a dual core STM32H745. I put together a quick project with CubeMX to test some FDCAN interfaces. I built the program and ran it.I'm using Keil ARM MDK. After building, and connecting it appears to connect to the CM7 (which is fine, because that's what I wanted anyway) - but I don't get far after that.There is some code to wait for CPU2 (CM4) for boot: /* Wait until CPU2 boots and enters in stop mode or timeout*/ timeout = 0xFFFF; while((__HAL_RCC_GET_FLAG(RCC_FLAG_D2CKRDY) != RESET) && (timeout-- > 0)); if ( timeout < 0 ) { Error_Handler(); }This never completes. I'm not really sure what to do with this.
I am trying to configure PJ0 as an external interrupt on an STM32F767.Enabling the EXTI0 interrupc removes the functions TIM1_UP_TIM10_IRQHandler from the generated code. This results in a DefaultHandler call comming from the timer.I am activating the interrupt here:This generates the following code changes:--- a/03-Implementation/mp12plus/Core/Inc/stm32f7xx_it.h +++ b/03-Implementation/mp12plus/Core/Inc/stm32f7xx_it.h @@ -53,13 +53,13 @@ void BusFault_Handler(void); +void EXTI0_IRQHandler(void); ... -void TIM1_UP_TIM10_IRQHandler(void); And the implementation of TIM1_UP_TIM10_IRQHandler is also removed. Any idea of why there is this behaviour?Adding the lines manually again makes code work again.Note: configuring the PJ0 as EXTI0 does not trigger this behaviour, its the activation of the NVIC that actually triggers this function erasure.
Good afternoon.I am using BluePill STM32F103C8T6 board.I wanted to connect an SD card to it and use it as Mass StorageAll examples use the SDIO interface for connection.But I don't have this item in CubeMX. How can I mount an SD card
STM32F407 SYSCLK, HCLK, PCLK1, PCLK2, Ethernet PTP Clock, HCLK to AHB bus, To Cortex System Timer, FCLK Cortex Clock, APB1 peripheral clocks, APB1 timer clocks, APB2 peripheral clocks, APB2 timer clocks.I only know where to measure HSE and HSI.HSE frequency can be measured on quartz X2, PH1-OSC_OUT, pin PH1.The HSI frequency can be measured on pin PA8 by enabling Master Clock Output 1 in the RCC Mode Configuration.
We are pleased to announce you that the official release of STM32CubeMX v6.8.0 is available for download hereWhat is new in STM32CubeMX V6.8.0?• Added the support for the STM32H5 series microcontrollers• Added the support for new microcontrollers in the STM32U5 series• Added the support for the STM32WBA series microcontrollers• Added the support for one new board related to the STM32G4 series: B-G473E-ZEST1S• Added the support for three new boards related to the STM32H5 series: NUCLEO-H563ZI, NUCLEO-H503RB, STM32H573I-DK• Added the support for three new boards related to the STM32U5 series: STM32U5A9J-DK, NUCLEO-U5A5ZJ-Q, NUCLEO-U545RE-Q• Added the support for one new board related to the STM32WBA series: NUCLEO-WBA52CG• Added the LPBAM support for new microcontrollers in the the STM32U5 series• Added the support for Log4j version 2• Added the support for FreeRTOS™ for the STM32U5 series and STM32H5 series• Improved the visibility of STM32Cube Expansion packages under the peripheral an
The board is installed with the system( stm32mp1-openstlinux-5.15-yocto-kirkstone-mp1-v22.06.15) by following the Getting started .All drivers are installed.However, in the DDR test suite, I cannot connect to the device.How to make the right connection for using DDR Test Suite?Do I need a DDR utilities binary file for the connection?thank you
On an STM32H7, is it possible to configure CubeMX to make a HAL that does not use an ISR? It makes one for Tick to increment the tick counter.
Using STM32CubeMX/STM32CubeIDE - when enabling and configuring the OctoSPI peripheral (Hyperbus mode) on STM32H7A and enabling the Delay Block feature, the LL driver for DelayBlock does not get included in generated projects.I had to enable SDMMC1 to force inclusion of this driver, and even then it needs modification because it assumes that the MCU has a QuadSPI peripheral (not correct for STM32H7A).Am I doing something wrong, or is this an issue in STM32CubeMX/STM32CubeIDE?Thanks
Lines 792..793 in stm32h7xx_ll_tim.c: MODIFY_REG(tmpbdtr, TIM_BDTR_AOE, TIM_BDTRInitStruct->AutomaticOutput); MODIFY_REG(tmpbdtr, TIM_BDTR_MOE, TIM_BDTRInitStruct->AutomaticOutput);That second line looks odd as TIM_BDTRInitStruct->AutomaticOutput seems to be either LL_TIM_AUTOMATICOUTPUT_DISABLE or LL_TIM_AUTOMATICOUTPUT_ENABLE, both having 0 in the MOE bit position. Wouldn't it make more sense to explicitly set it to zero if that is what it's always supposed to be?Is there an option in CubeMX to have MOE set from the start? Having to call LL_TIM_EnableAllOutputs() on some timers but not all is a little unintuitive (e.g. moving from TIM3 to TIM8 made my code stop working).Using CubeMX version 6.7.0 and STM32Cube FW_H7 V1.11.0
As indicated in community.st.com/s/question/0D53W00000zoHteSAE/h7cubemx-critical-bugs-with-ll-and-adc3 there seems to have been a bug where the resolution wasn't correctly set when working with ADC3.As of today, the conversion seems to instead be made twice, both in the calling code (generated by CubeMX)ADC_InitStruct.Resolution = __LL_ADC12_RESOLUTION_TO_ADC3(LL_ADC_RESOLUTION_10B); ADC_InitStruct.LowPowerMode = LL_ADC_LP_MODE_NONE; LL_ADC_Init(ADC3, &ADC_InitStruct);and in the library codeErrorStatus LL_ADC_Init(ADC_TypeDef *ADCx, LL_ADC_InitTypeDef *ADC_InitStruct) { ... #if defined(ADC_VER_V5_V90) if(ADCx==ADC3) { MODIFY_REG(ADCx->CFGR, ADC3_CFGR_RES | ADC_CFGR_AUTDLY , ((__LL_ADC12_RESOLUTION_TO_ADC3(ADC_InitStruct->Resolution) & (ADC_CFGR_RES_1 | ADC_CFGR_RES_0)) << 1UL) | ADC_InitStruct->LowPowerMode ); } else ...Running the code, ADC3->CFGR is indeed 0x80000000 both before and after LL_ADC_Init() as the incorrectly calculated resolution
STM32F407 Discoveryen.MB997-F407VGT6-C01_Schematic.pdfHSE quartz 8 megahertz.How are 4-26 MHz generated for HSE?With an oscilloscope, I see only 8 megahertz on X2 quartz.Where are those 25 megahertz that are listed as input for HSE?In the documentation I read this:This frequency cannot be changed, it is fixed at 8 MHz and connected to PH0-OSC_IN of the STM32F407VG.But in Cube Mx this frequency can be changed from 4 to 26 megahertz.
Hi,I have an issue, I can't change the project in STM32CubeMX. I wrote the project name V04 at the beginning of the project now I would like to change how can I do it. I don't touch even the textbox.Thank you
Hello,We are struggling with the configuration of LwIP for my STM board over FreeRTOS.We have our own designed board with STM32F777ZIT controller.Ethernet and LWIP is working as expected as we used without FreeRTOS middleware but we are not able to integrate ethernet with FreeRTOS in STM.I have attached cumbemx screenshot for ethernet connection to STM.Also find attached ETH and LWIP settings in cubemx.We are executing following steps to access FreeRTOS and ethernet.1.In cubeMX enable ETH in RMII mode set PHY Address as 0 in parameter Setting.2.Enable LWIP in middleware.set DHCP as enabled (tried it with DHCP disable also)3.Enable FreeRTOS in CMSIS_V1 mode all other settings in RTOS are as it is.Then we have generated code and build it...It can build successfully, but does not run as it throws DMA memory errors.Laptop settings are correct as I can ping board if RTOS is not used.I would appreciate if you could provide me some step by step, in addition with a reference.
I'm trying to receive more than 1 byte but it receive only 1 byte. Poll method or IT, it doesn't matter. Always receives 1 byte and writes it in rx_buffer[0]. When I search it I found out the reason is timeout, I increase timeout 1000 from 100ms but nothing changes. Can anyone help me please? Here is my code for poll/* Includes ------------------------------------------------------------------*/#include "main.h"#include "string.h"/* Private variables ---------------------------------------------------------*/UART_HandleTypeDef huart1;UART_HandleTypeDef huart6;DMA_HandleTypeDef hdma_usart1_rx;/* Private function prototypes -----------------------------------------------*/void SystemClock_Config(void);static void MX_GPIO_Init(void);static void MX_DMA_Init(void);static void MX_USART1_UART_Init(void);static void MX_USART6_UART_Init(void);USER CODE END PFP *//* Private user code ---------------------------------------------------------*//* USER CODE BEGIN 0 */char rx_buffer[50];char tx
I am trying to write a code so that I measure temperature and humidity via HTU21D sensor. It uses I2C interface. In the datasheet:The HTU21D(F) sensor requires a voltage supply between 1.5V and 3.6V. After power up, the device needs at most 15ms while SCK is high for reaching idle state (sleep mode), i.e to be ready accepting commands from the MCU. No command should be sent before that time. Soft reset is recommended at start.According to this information, I formed the following function:void HTU21D_SensorInit(void) { uint8_t pData[] = {0xFE}; // SOFT_RESET if(HAL_I2C_Mem_Write(&hi2c2, (DEVICE_ADDRESS << 1), WRITE_REGISTER, 1, pData, 1, HAL_MAX_DELAY) != HAL_OK) { Error_Handler(); } // HAL_UART_Transmit(&huart1, (uint8_t*)"Sensor initialized!\r\n", 21, 100); for debugging HAL_Delay(15); }And I invoke this function in main after MX_I2C2 is called.This function works find and doesn't go into Error_Handler. In while(1) part of the main function, I invoke the following
Hi,I'm a beginner, and I try to use STM32F103C8 IC for very simple thing.I updated Ide and MX program to CubeIde 1.12 and CubeMx 6.8. Now I can not Build my project.There are many error messages which you can see in the picture. If I see the Drivers tree, the RTOS2 is marked red icon. 1.) I don't understand the CubeMX why generated DSP, RTOS, RTOS2 etc. parts if I didn't ask for them.2.) How to turn off the generation of these (DSP, RTOS, RTOS2, etc.)?3.) What else needs to be installed on my machine so that the build process works properly?Just as an example, I have included a picture of a previous generated C code produced by CubeMx 6.7 and CubeIde 1.11. You can see how much simpler the structure was. Best regards Zoltan
CUBE_MX 6.8.0 Cube PACK 1.27.1 EMPTY project
..
I am trying to connect to the WFM200 wifi module over SDIO. I am using the SDMM peripheral library/code for this.However, in the selection in CubeMX there is only the options for SD and MMC but no SDIO.Which option should I choose for using SDIO with the WFM200?
Hello,I'm looking for an MCU from the STM32H7/F7 lines that has the highest number of Chip Selects for the FMC bus. The highest CS count I've seen so far is the STM32H743:Is this the maximum
STM32L476ZGT3 processorSTM32IDE 1.12.0STM32MX 6.8.0Once I updated the IDE, the system locks on the LL_PWR_IsActiveFlag_VOS() under the stm32l4xx_II_pwr.h file (Through the SystemClock_Config() section).I updated the file location by creating a new project and copying my files into the directory.When debugging, the cursor jumps from the end of file bracket "}" to the return function and won't go further.__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VOS(void){ return ((READ_BIT(PWR->SR2, PWR_SR2_VOSF) == (PWR_SR2_VOSF)) ? 1UL : 0UL);}
I work on a project with STM32F767ZI that uses 3 CAN buses and require them to be turned ON and OFF at specific times to save power.However, code generated by STM32CubeFW_F7 V1.16.1 (latest version at the time of posting) generates questionable(or even completely wrong) code that manages RCC APB clock enable bits.Let's take a look at can.c (code is slightly redacted to save space in the post, the full file is attached) generated by CubeIDE: static uint32_t HAL_RCC_CAN1_CLK_ENABLED=0; static uint32_t HAL_RCC_CAN3_CLK_ENABLED=0; static uint32_t HAL_RCC_CAN2_CLK_ENABLED=0; void HAL_CAN_MspInit(CAN_HandleTypeDef* canHandle) { GPIO_InitTypeDef GPIO_InitStruct = {0}; if(canHandle->Instance==CAN1) { /* CAN1 clock enable */ HAL_RCC_CAN1_CLK_ENABLED++; if(HAL_RCC_CAN1_CLK_ENABLED==1){ __HAL_RCC_CAN1_CLK_ENABLE(); } /* GPIO init here */ } else if(canHandle->Instance==CAN2) { /* CAN2 clock enable */ HAL_RCC_CAN3_CLK_ENABLED++; if(HAL_RCC_CAN3_CLK_ENABLED==1){
OS : Ubuntu 22.04.2 LTSSTM32CubeIDE : 1.12.0 Build: 14980_20230301_1550 (UTC)Firmware : STM32Cube FW_G4 V1.5.1Working on interfacing Nucleo-G491RE to EVAL-AD5592R-PMDZ evaluation board using SPI interface (SPI2). Before jumping on to it I just probed SPI2_SCK and made the necessary configurations to it using STM32CubeIDE and generated code. Using HAL_SPI_TransmitReceive sent bytes to be able to capture the SPI2_SCK on PB13 but did not get the expected clock on the oscilloscope. What did I miss out on configuring SPI?Please find the screenshot of the SPI configuration on STM32CubeIDE in the attachment.
I am relatively new to using the STM32 family and I am trying to use the USART on a STM32C011J4M6 device without success.Initially I am just trying to send out a single character using the lines uint8_t TxData[] = {'@'}; HAL_UART_Transmit(&huart1, TxData, 1, 10); after USART1 has been set up by CubeMX.When it runs however, as soon as it tries to write to the Transmit Data Register, the processor resets. I have verified where it is going wrong by stepping through the disassembly - all the registers seem to be set up correctly but immediately on executing the STR instruction to write the character to 0x40013828 (USART1 TDR) it jumps to the reset handler.I have been using STM32F042K6 and other devices up until now and the same code behaves correctly in those, exactly as expected.I'm not sure what I am doing wrong so can anyone point to what it might be? If I remove the HAL_UART_Transmit() then the rest of the code runs (although it is just toggling a GPIO pin at the moment).Than
In CubeMX, when you configure SDMMC in MMC mode, then you add FATFS in Middleware, you can choose SD card but you there is no option for MMC. Why is that ? I am unable to mount a fs on my eMMC. Should I use User-defined ?
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.