Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Is it possible to obtain a (theoretical) 48kHz sample rate with 0% error on the STML5's SAI peripheral? So far the clock configuration tool in STM32CubeIDE has been unable to do so.Research led me here, but this is not applicable to a slower clocking board like the L5. From what I know, the SAI-clock should be at least 1:1 with the bit-clock, which's speed can be calculated with this formula:clk = sample_rate * resolution * n_framesWhere sample_rate is 48kHz, resolution is 32bit and n_frames is 2, one left, one right, equating to 3.072 MHz for the bit-clock. However, inserting this into the clock config tool fails, as the closest number to that is 4Mhz and even that is far off from the desired sample rate, with an error of -67%. Why is that? Is accurate sampling on the L5 possible? Other devices and DSP depend on accurate data.clock-tree: SAI-config:
Here is a weird one for ya.I am programming on the STM32L4R9I-EVAL dev board, but my project is configuredfor the STM32L4S9AII6. I am clocked at 120MHz.My program has started failing for what seems to be because I have too manyMX_<peripheral>_init() functions. Can you configure too many peripherals?I started getting this bug off and on as I was getting my TIM15 peripheral up andrunning. I now have my TIM15 working, or I should say I had it working untilnow. I thought before that the TIM15 was the culprit as that was what I wasworking on. So I would comment out it's init function in main() and then theerror would go away. I would mess around some more in MxCube and then theproblem would go away (for a while). This seemed to be a repeating theme as Iworked on that.So I moved on writing a small amount of other code that had nothing to do with anyperipheral and this problem happened again. Only this time, I don't dare messwith MxCube because before this everything was working perfect
..
Hi all, I have made a source code that runs fine, But after 6 months I again tried to run the same code. Now the running stuck at some point,The code stuck at this point is shown belowIs this error occur due to any hardware failure like oscillator /capacitor Anybody, please help???
Hello everybody!Sorry for the question but i am in need of help.I use STM32CubeIDE 1.5.1 with stm32 discovery f407g to manage an exyernal adc ADS1118.ADC works well with Arduino, but unfortunately I can't get it to work with discovery.... /* USER CODE END SPI1_Init 1 */ hspi1.Instance = SPI1; hspi1.Init.Mode = SPI_MODE_MASTER; hspi1.Init.Direction = SPI_DIRECTION_2LINES; hspi1.Init.DataSize = SPI_DATASIZE_16BIT; hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; hspi1.Init.NSS = SPI_NSS_HARD_OUTPUT; hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_32; hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi1.Init.TIMode = SPI_TIMODE_DISABLE; hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; hspi1.Init.CRCPolynomial = 10;//I want to send this setting to get the input ain0:uint8_t buffer_tx0[2] = {235,195};uint8_t buffer_rx[2];//get the data HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_RES
I would have expected CubeMX to include/generate a line, for example like: LL_DMA_SetPeriphAddress(DMA1, LL_DMA_CHANNEL_3, LL_USART_DMA_GetRegAddr(USART3, LL_USART_DMA_REG_DATA_RECEIVE) );
Hello STM32-Community,I've got a somewhat mundane problem today. Suddenly a piece of .h file decides to give a warning. I'm using STM32CubeMX and have also rebuilt the project multiple times and I still get this warning: Anyone knows how to fix this issue? I'm just afraid it might also be a warning which can be serious in the future.Kind regardscrackl1ng
Hello!My problem is that I don't see the components in the Additional Software menu.I did everything strictly according to the instructions specified of the official website. Components installed as shown.CubeMX reinstalled, the computer rebooted, but it did not help. Touching Refresh button also has no any effect.I use a STM32H747-DISCOWhat could be the problem?
ldr sp,=_stack /* Set stack pointer */It is this code that I am always brought back, it is in the file: startup_stm2l476rgtx.s
Hello dear Engineers,Before this upgrade(downgrade?????), I was able to use FREERTOS successfully. The main procedure was to change the time base from SYSTICK to TIM1 and then everything was working. Now in this upgrade even without FREERTOS, when the time base is set to any timer but SYSTICK, it gets stuck at HAL_Init();.The project is attached for further analysis. The board is a custom board.sincerely yours
Hello,I am beginner with stm32, I try to start my first project but I cannot do it, because there is the core_cm4.h file which was not generated here is the error message: Description Resource Path Location Typefatal error: core_cm4.h: No such file or directory stm32l476xx.h /bliking-test/Drivers/CMSIS/Device/ST/STM32L4xx/Include line 165 C/C++ Problem
How to configure Zigbee and FreeRTOS using CubeMX. Currently the samples under WB55 have two Zigbee and FreeRTOS samples, but for EWARM. Is there a note on how to manually add FreeRTOS to a CubeMX/CubeIDE project for ZigBee. I have an application on STM32F4 which uses an external ZigBee radio. The project uses FreeRTOS for running multiple tasks. Ideal to shift to WB55.
Hi all...I am using a nucleo board and CubeMX ....I have an external interrupt which I can see on the logic analyzer. However when setting a breakpoint in code it never goes there?? I am set for rising edgevoid HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if (GPIO_Pin == SPI_IRQ_Pin) ISR.SPI_WakeUp = T; }
I have configured FDCAN for classic CAN frame in STM32CubeIDE with Firmware package version 1.9.1. Following is my configuration:hfdcan1.Instance = FDCAN1; hfdcan1.Init.FrameFormat = FDCAN_FRAME_CLASSIC; hfdcan1.Init.Mode = FDCAN_MODE_NORMAL; hfdcan1.Init.AutoRetransmission = DISABLE; hfdcan1.Init.TransmitPause = DISABLE; hfdcan1.Init.ProtocolException = ENABLE; hfdcan1.Init.NominalPrescaler = 6; hfdcan1.Init.NominalSyncJumpWidth = 1; hfdcan1.Init.NominalTimeSeg1 = 13; hfdcan1.Init.NominalTimeSeg2 = 2; hfdcan1.Init.DataPrescaler = 6; hfdcan1.Init.DataSyncJumpWidth = 1; hfdcan1.Init.DataTimeSeg1 = 13; hfdcan1.Init.DataTimeSeg2 = 2; hfdcan1.Init.MessageRAMOffset = 0; hfdcan1.Init.StdFiltersNbr = 0; hfdcan1.Init.ExtFiltersNbr = 0; hfdcan1.Init.RxFifo0ElmtsNbr = 32; hfdcan1.Init.RxFifo0ElmtSize = FDCAN_DATA_BYTES_8; hfdcan1.Init.RxFifo1ElmtsNbr = 0; hfdcan1.Init.RxFifo1ElmtSize = FDCAN_DATA_BYTES_8; hfdcan1.Init.RxBuffersNbr = 0; hfdcan1.Init.RxBufferSize = FDCAN_DATA
I have my custom PCB design by using STM32 MCU.Now i want to know how can i design template for this custom board GPIO pins and other interfaces so when i want to use this i simply select it and all pins are set as template.every time when i make new project don't need to do all setup again.similar like any stm32 discovery board all pins are set up already.How can i do it? which software is used?
I downloaded the SetupSTM32CubeMX-6.5.0 installer and its folder for macOS.The installation of STM32CubeMX with macOS 12.2.1 (Monterey) is not allowed even following the terminal command: sudo xattr -cr ~/SetupSTM32CubeMX-6.5.0.app.I think there is an incompatibility with JAVA of macOS.Can you please help me to resolve this issue?
Additional Information:STM32WB55The PSC is set to 0the ARR is set to 31The pulse is set to 15The problem starts when writing to internal flash after FLASHEx_Erase runs while TIM16 is activated. I tested the speeds for the given PSC, ARR and pulse, and it comes out to 1.002MHz. Has anyone ran into this problem before?
Hi, I'm trying to configure my stm32h7b0vb for max clock (280Mhz), but max freq on DIVN1 is 420Mhz, and DIVP1 is 2 (min val). Therefore I only reach 210Mhz
Hello,I haven't used STM32Cube for a long time because I was busy with other things.For software and hardware development I use STM32Cube under Linux and the board NUCLEO-H743ZI2 as hardware platform.Since I wanted to create an project from scratch, I started with updates of the entire STM32Cube (STM32CubeIDE to 1.8.0 and the repositories to v1.9.1) before I started the project with the command "New STM32 Project from an Existing STM32CubeMX Configuration File (.ioc)". "ST-LINK" has also been updated to version "V3J9M3".When setting up and editing the project, I proceeded as in the past.1. Although I have activated and set up a SPI interfaces in the STM32CubeMX, which I called from the STM32CubeIDE, after generating code, the line '#include "spi.h"' is always missing in "main.c". I have to add it manually otherwise the compiler reports an error.2. When debugging, the code always gets stuck in one of the hardware initialization calls: either in the procedure "SCB_EnableDCache()", "HAL_I
Hello dear community,This is my first post here and I am coming to you for help.In the context of a project with a STM32H747I-EVAL board (this board was lent to me and I notice that it doesn't seem to be sold anymore), I need to send/receive CAN messages with another device. I want to use FDCAN1 and FDCAN2.I have created a project with the STM32CubeIDE with the corresponding board. When I go to the "Pinout & Configuration" view, I want to activate FDCAN1 and FDCAN2 but this is where I encounter problems. As the attached screenshots show, I encounter conflicts with other elements when trying to activate FDCAN1 and FDCAN2. These conflicts are present whatever the runtime context (M7 or M4).I admit I am a bit lost and do not know how to continue. Why are these conflicts present? How can I solve them and use FDCAN1 and FDCAN2 ?Waiting for your answer, I thank you for all the help you can give me.Thank you
When I was going through the setup process of USB in STMcubeMX, I suspected that it could not be used as USB host.I would like to know if STM32F372/STM32F373 can be used as USB host. Can STM32F372/373 be used as USB host?
Requirement: I need to create a basic C++ project (into which I'll insert files from an embedded C++ project built for another platform, then begin port testing.) The specifics are using a STM32F051R8 with "LL" low level support, but I don't think my problem is specific to the device. The C++ project is necessary for this task, and when I tried just changing main.c to main.cpp in my prior attempt(s), the project would not build (could not find main() to link from the .s startup file, even though main() was clearly present.)What I tried before: I tried using STM32CubeMX to generate a trivial (light one LED using LL code generation setting), and that works, until I change the name of main.c to main.cpp, then when I try to build, main() can't be found (bl main in the .s file doesn't find main() in main.cpp)What I'm trying now: I am now trying to use STM32CubeIDE as the starting point (File > New > STM32 Project); I specify the requested project name and set as C++, executable,
After spending hours trying to figure out why my I2C lines weren't working and trying my code on a STM32G031 development board, I've noticed that Cube IDE does not generate the following line in the file: stm32g0xx_hal_msp.c.GPIO_InitStruct.Alternate = GPIO_AF6_I2C1;The generated code for the file: stm32g0xx_hal_msp.c for the STM32G031 chip is as follows:void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c){ GPIO_InitTypeDef GPIO_InitStruct = {0}; if(hi2c->Instance==I2C1){ /* USER CODE BEGIN I2C1_MspInit 0 */ /* USER CODE END I2C1_MspInit 0 */ __HAL_RCC_GPIOA_CLK_ENABLE(); /**I2C1 GPIO Configuration PA9 ------> I2C1_SCL PA10 ------> I2C1_SDA */ GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = GPIO_AF6_I2C1; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); /* Peripheral clock enable */ __HAL_RCC_I2C1_CLK_ENABLE(); /* USER CODE BE
I tick the "Run after programming" option. Normally this works fine. User code gets going after programming. I create projects using Cube MX. With latest Cube MX (Version 6.4.0) code, after programming control is not going to user code. I have to now change the BOOT selection jumper and press reset. Then only user code is being executed. I never faced this problem before with earlier version (I don't have the older version number, as I upgraded Cube MX). I took one of my earlier projects and changed the code to test this feature manually and it works fine. Soon after downloading the code control transfers to user code. Can someone point out why this is happening and what is the solution please? Thank you for your valuable time.
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.