Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
..
If I tick the enable box in STM32CUBEMX the interrupt is enabled when MX_GPIO_Init() is executed. Since this is prior to the initialisation of FreeRTOS queues etc this turns into a disastrous mess.If I leave the box unticked then everything assoociated with this interrupt must be written manually.It's a shame that the interrupt can't be setup in the MX and then manually enabled when the appropriate FreeRTOS task becomes active.
In STM32G030, PA6 can be configured as PWM Output of Timer 16. What I want is to initialize the pin in analog mode (High Impedance) and when I want to use the PWM, then switch the configuration to timer channel. I think this could be better done writing my own functions with registers. But I'm trying to see how to do it with HAL.Using initialization code from CubeMx, and modifying it:void SystemClock_Config(void);static void MX_GPIO_Init(void);void MX_TIM16_Init(void); //Removed static keywordvoid PA6_analog ();void PA6_timer();Below the functions which I would call whenever I want to use them. void PA6_analog(){//clock is already initialized in MX_GPIO_Init for other ports GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitStruct.Pin = GPIO_PIN_6; GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); }void PA6_timer (){ MX_TIM16_Init();//start PWM output //stop t
Hi,I am a newbie on microcontroller but, I can read / write on the GPIO port and control a servo motor in PWM with a timer.Now, I am starting to play around with ST BLE for control the GPIO port and servo motor.I use: Nucleo-F401RE X-NUCLEO-IDB05A1 board.To check my hardware and configation, I tested the demo programs and everything works fine.Now, I would like to create my application using the X-NUCLEO-IDB05A1 board.To configure the Nucleo-F401RE, I use Stm32CubeMx 5.6.1.I installed :STM32F4 1.25.0 PackageX-Cube-BLE1 5.0.0 stack and sample applications for BlueNRG-MS module.I created a new project and followed the configuration procedure indicated in the document:"Getting started with the STMicroelectronics X-CUBE-BLE1 software package for STM32CubeMX"I fine this document here: C: \ STM32Cubeprojects \ Packs \ STMicroelectronics \ X-CUBE-BLE1 \ 5.0.0 \ DocumentationAt the end of the configuration procedure, in the "Project Manager -> Advanced setting" tab I should get this:Bu
If from the "Clock Configuration" tab Fadc > 36Mhz then the Clock prescaler for the ADC is automatically set to /2 where the /1 is diabled. For > 72MHz it is /4 where /1 and /2 are disabled. Rev. 2 has an additional /2 divider that has been taken into account in the HAL code but not in CubeMX I assume.Code snippet from stm32h7xx_hal_adc.c: /** * @brief Configure boost mode of selected ADC. * @note Prerequisite condition to use this function: ADC conversions must be * stopped. * @param hadc ADC handle * @retval None. */void ADC_ConfigureBoostMode(ADC_HandleTypeDef* hadc) else /* STM32H7 silicon Rev.V */ { freq /= 2U; /* divider by 2 for Rev.V */ if (freq <= 6250000UL) { MODIFY_REG(hadc->Instance->CR, ADC_CR_BOOST, 0UL); } else if(freq <= 12500000UL) { MODIFY_REG(hadc->Instance->CR, ADC_CR_BOOST, ADC_CR_BOOST_0); } else if(freq <= 25000000UL) { MODIFY_REG(hadc-&g
The STM32F103 does not have a Synchronous Prescaler. and the Asynchronous Prescaler can be set to (2^20 - 1) in the MCU.But STM32CubeMX doesn't allow a number higher than 127. Not really a problem of course, just a bit confusing.
Hey everyone,i need to find the app_conf.h somwhere but i cant see where. maybe that you guys can help me out??thanks for lookingbye.
With previous version it was working perfectly but new version has a message as: The code is generated succesfully under 'my destination' but MDK-ARM V5 project generation have a problem
I have setup on cubeMX (STM32F302R8 Nucleo board) version 6.0.1 USART1 to use DMA on TX.I use LL driver for usart.The generated code is the following : /* USART1_TX Init */ LL_DMA_SetDataTransferDirection(DMA1, LL_DMA_CHANNEL_4, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); LL_DMA_SetChannelPriorityLevel(DMA1, LL_DMA_CHANNEL_4, LL_DMA_PRIORITY_HIGH); LL_DMA_SetMode(DMA1, LL_DMA_CHANNEL_4, LL_DMA_MODE_NORMAL); LL_DMA_SetPeriphIncMode(DMA1, LL_DMA_CHANNEL_4, LL_DMA_PERIPH_NOINCREMENT); LL_DMA_SetMemoryIncMode(DMA1, LL_DMA_CHANNEL_4, LL_DMA_MEMORY_INCREMENT); LL_DMA_SetPeriphSize(DMA1, LL_DMA_CHANNEL_4, LL_DMA_PDATAALIGN_BYTE); LL_DMA_SetMemorySize(DMA1, LL_DMA_CHANNEL_4, LL_DMA_MDATAALIGN_BYTE); USART_InitStruct.BaudRate = 115200; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; USART_InitStruct.Parity = LL_USART_PARITY_NONE; USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX
Hi, I am using STM32CUBEIDE, project creation is simple. i modified that code and i add the more function. After i need to add another peripherals, so i use .ioc (stm32cubemx) add another peripherials , after save it ask create, when into my project modified code doesnot exist, new fresh code will appear. Can anyone tell me how to overcome this one.??
This problem was already mentioned two years ago and was allegedly fixed in version 5.2.0 of CubeMX. It is currently impossible for me to remove the default FreeRTOS task from CubeMX (6.0.1 with a STM32 F4 MCU), even removing it from the ioc file does not help. Is there any other way to do this?As a side node this would not be a problem if CubeMX created the task attribute definition in the right order. g++ considers this to be an error.
I selected the LQFP176 package, because the datasheet expresses a 32bit data bus. However, ST development tools are limiting me to 16bit. Has anybody taken the generated 16bit code and expanded it to 32bit or would I be wasting my time? Thank you for any feedback.
Am I suffering from acute dementia, or what...I recall CubeMX used to generate Deinit counterpart for each generated MX_***_Init.Like MX_GPIO_Init() and MX_GPIO_Deinit().Is my memory playing games with me, or is that deinitialization disappeared?
Hello @Houssem CHAABANI ,Is there a setting with STM32CubeMX to change the Tick Init Priority value? I observe that example FreeRTOS project (generated with help of STM32CubeMX) have macroTICK_INT_PRIORITYset to 0xF, while the code generated with help of my IOC file has the macro set to 0.Please help.Thanks,Rajeev
I am planning to use STSPIN32F0A for my project. Currently, I have STEVAL-ESC002V1 launchpad and who like to control BLDC motor using STM32cubemx GUI. Please help me out the the method.
STM32F411 discovery board DFU with STM32CUBEMX generated basic DFU code not worked properly.It shows the "Device Descriptor Request fail in device manager.What is exact issue can not find?All setting done from STM32CUBEMX with standard parameter.Set below parameters as#define USBD_VID 1155#define USBD_LANGID_STRING 1033#define USBD_MANUFACTURER_STRING "STMicroelectronics"#define USBD_PID_FS 57105#define USBD_PRODUCT_STRING_FS "DFU in FS Mode"#define USBD_CONFIGURATION_STRING_FS "DFU Config"#define USBD_INTERFACE_STRING_FS "DFU Interface" #define USB_SIZ_BOS_DESC 0x0C
Evening,I have been working on a FreeRTOS project for the last six months and all was going well until the last STMCubeIDE & CubeMX update.Rightly or wrongly, I have been using the usarts with the below interrupt config /* UART8 interrupt Init */ HAL_NVIC_SetPriority(UART8_IRQn, 0, 0); HAL_NVIC_EnableIRQ(UART8_IRQn);Preemption = 0.After the last CubeMX update, my four uart comms no longer worked.After much digging, I found that the CubeMX was setting the Uart Preemption = 5, thus generating the below code. /* UART8 interrupt Init */ HAL_NVIC_SetPriority(UART8_IRQn, 5, 0); HAL_NVIC_EnableIRQ(UART8_IRQn);When it is set at 5, my code no longer works. The uart interrupts do not respond at all.A value of 5 appears to be a reasonable value or even in the range of 5..15.Why does my code no longer work??P.S. I used the CubeMX builder for the original project design and used it's defaults.It would appear that all Preemption's
Dear @Khouloud ZEMMELI ,STM32CubeMX version series 6 adds two instances of #include "stm32h7xx_hal.h" to file main.hI am observing this behavior even with STM32CubeMX version 6.1.0I observe in \inc\main.h:Line 31: #include "stm32h7xx_hal.h"Line 32: #include "stm32h7xx_hal.h"Requesting duplicate include removal.Thanks,Rajeev
Hello,today I noticed that CubeMX is behaving strangely.It gives me warnings that he had to "fix stacksize according to changed configMINIMAL_STACK_SIZE, but the problem is that this setting is 128and I try to set task to 8192 (it has normal prioritiy), but when I click Ok, it sets stack back to 128 (with warning). It does these actions on two tasks, but not on others...Why is CubeMX doing this? I work on this project for months and didn't have such problem until now.What is wrong ?Regards,Bully.
What is the proposed workflow on keeping a platform updated with the latest releases of for example HAL and middleware layers from ST? Previously the code generated from CubeMX contained a version and a date, but that seems not be in the header of the generated file anymore with the last generation from CubeMX that I performed. How can I refer to which version of let say the usb core that I am using?
Please click on this button to validate your ...But the dowload did not start when i click validation button
Hi!i have been using cubemx for a while now, and now i am wondering regarding the code generation. in the main file , for example ,there are user code sections. can i create more of theses sections? or must i use the generated sections only?
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.