Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
My code is not passing the netif_is_link_up() function and it always goes to netif_set_down(). I also have this doubt when I connect network cable to Ethernet port of board, it does not glow any green or yellow light on this port. But my network cable is working when I tried it on my laptop. Is it mandatory that green/yellow light needs to blink to show successful connection? My board is brand new and I highly doubt if it has any hardware problem.I would really appreciate if any one can help me to resolve the issue of setting up Ethernet connection. Thanks
CAN peripheral test in NUCLEO-L476RG MB1136 rev C (C-04) Board.and work with STM32CubeIDE (1.3.1) + STM32Cube_FW_L4_V1.15.1.(1) The CAN1_RX(PB8) and CAN1_TX(PB9) pins of STM32L476RG do not drop the voltage to 0 Volt. Low voltage is 1 Volt.Tested voltage level with the code below. hal_gpio_togglepin(GPIOB, GPIO_PIN_8 | GPIO_PIN_9);(2) Due to the above phenomenon, CAN1_RX(PB8) cannot be lowered to 0Volt to use the built-in CAN bootloader mode of STM32L476RG.CAN Transceiver does not fall below 2.5 Volt of CAN1_RX(PB8) pin.(3) When using CAN1_RX(PA11) and CAN1_TX(PA12), there is no problem from 3.3V to 0V.However, the CAN Tx output level of the CAN1_TX(PA12) pin remains 3.3V unchanged even when sent from the CAN below function code made with CubeMX. if (HAL_CAN_AddTxMessage(&hcan1, &TxHeader, TxData, &TxMailbox) != HAL_OK) (The oscilloscope measured the point where there is no change in the output pin.)If the CAN baudrate is not correct, the signal should be outpu
So I can not enable internal connection by CUBE and VOUT occupies some pin on the PInOut View which I intend to use for other purpose, so I can not to use all advantages of CUBE . So The Configuration page of OPAMP look like attached pictuire
it does not create a project. I used this ioc file on a working computer,There it earned. How to fix my cube mx? or reinstall Keil 5? I need help. I add Keil project
Hi!I am trying to create a very first Hello World project like that:/** ****************************************************************************** * @file : main.c * @author : Auto-generated by STM32CubeIDE * @brief : Main program body ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * *********************************************************
Hi,I have a NUCLEO F103RB board with STM32F103RB MCU. I am doing my first program for blinking a LED (I am starting with STM32 MCU family). I use STM32CubeIDE just downloaded in the last days.I compile my simple program without problems.The debug phase does not happen due to the following error I read on the console:this is the messageOpen On-Chip Debugger 0.10.0+dev-01193-g5ce997d (2020-02-20-10:57)Licensed under GNU GPL v2For bug reports, read http://openocd.org/doc/doxygen/bugs.htmlnone separateInfo : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWDadapter speed: 8000 kHzadapter_nsrst_delay: 100Info : Listening on port 6666 for tcl connectionsInfo : Listening on port 4444 for telnet connectionsInfo : clock speed 8000 kHzInfo : STLINK V2J36S26 (API v2) VID:PID 0483:374BInfo : using stlink api v2Info : Target voltage: 3.239448Error: init mode failed (unable to connect to the target)Moreover an additional window (titled PROB
Hello, I try to implement some kind of data logger which saves values on an usb stick. The board is based on an STM32F767ZGT6.To do things properly, I have created a fresh new project with STM32CubeMX ( to include later in my main project). Here is what I have configured in CubeMX in few words:HSE : 25Mhz / LSE 32,768kHz CrystalsCPU Icache & Dcache EnabledFreeRTOS enabledTimebase: Timer 6Minimum Heap 0x400 / Minimum Stack 0x800FatFS R0.12cUSB_OTG_HS: Internal FS Phy Host_OnlyClass For HS IP : Mass Storage Host ClassThen I have implemented a way to create, open, fill and close a file based on F7 library "FatFs_USBDisk" and "FatFs_USBDisk_RTOS" examples. To simplify things, in the main task, I do the followings: /* FatFS: Link the USBH driver */ FATFS_LinkDriver(&USBH_Driver, USBHPath); /* Init host Library, add supported class and start the library. */ USBH_Init(&hUsbHostHS, USBH_UserProcess, HOST_HS); USBH_RegisterClass(&hUsbHostHS, USBH_MSC_CLASS); USBH_Sta
hi I wanted to ask regarding stm32h7 as I have two main available one for m4 main and the other for m7 main, if I process a variable in the cortex m4 how can I transfer it to the m7?Can i use mdma or dma.....Tanks
Hello,I configured TIM2CH4 on my Nucleo STM32F303RE board to PWM with the LL library, and added some extra code to actually enable the outputs, set compare to with 50:50 duty, enabled the UPDATE IRQ and implemented the ISR to count down from a value initialized to a wanted number of pulses, and if it is 0, I call LL_TIM_DisableIT_UPDATE and LL_TIM_DisableCounter, which in turn I enable in my "start pulses" routine.Also, I configured the "CH Polarity" in Pinout & Configuration tab to LOW.So far so good, the scope output, starting with the second run of the routine, looks exactly like I want: The idle signal is low, when I start the pulsing, I see e.g. 10 pulses, and the pin ends on an idle low level.The problem is that the whole thing starts with the output pin being HI after "booting".Only after the first pulsing it remains low.I tried, in main.c in the generated TIM2 init routine, user code section, to add enabling the output already (as opposed to my later init routines), with TI
Is there a verbose mode for CubeIDE and CubeMX to log command line commands being called?I currently have a CubeMX script to load .ioc file and generate the project output there are several key differences between when the IDE generates and when the script generates. config load C:\repo\Completed_and_working_from_project.ioc project name testProjectName project toolchain "STM32CubeIDE" project path C:\generated project generateTo execute the script I call:java -jar STM32CubeMX.jar -q myscript.batThe most obvious difference is that with the IDE the .ioc has a toolchain of "STM32CubeIDE" but when I use the above script the toolchain is changed to EWARM V8.32 and the output is not the same. I would expect to be able to load the .ioc file (and any other config files needed) and generate the projects generated files such as the IDE does when the .ioc file is generated. I am referencing Document UM1718 version 31 released December 19 for CubeMX commands
CubeIDE 1.2.0 I have a simple script to test the command line setup. The script is loading the .ioc and creating .csv of the pinout. I get partially through the csv command where Java runs into a NullPointerException seen below2020-06-09 12:53:23,629 [DEBUG] PinoutAndConfigurationView:553 - sp_PinoutAndSystemViews - pce.getPropertyName() : dividerLocation1.0 2020-06-09 12:53:23,629 [DEBUG] PinoutAndConfigurationView:691 - sp_ModeConfig - pce.getPropertyName() : dividerLocation0.5 2020-06-09 12:53:23,649 [DEBUG] PinoutAndConfigurationView:960 - Start propertyChange PinoutAndConfigurationView : preferredSize 2020-06-09 12:53:23,649 [DEBUG] PinoutAndConfigurationView:1030 - End propertyChange PinoutAndConfigurationView : preferredSize 2020-06-09 12:53:23,649 [DEBUG] PinOutPanel:732 - fitInWindow Computed Zoom: 0.5 2020-06-09 12:53:23,692 [DEBUG] PinOutPanel:732 - fitInWindow Computed Zoom: 0.5 2020-06-09 12:53:23,754 [DEBUG] PinoutAndConfigurationView:1447 - Resize component 2020-06-09 12
__STATIC_INLINE void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t PinMask) { WRITE_REG(GPIOx->ODR, READ_REG(GPIOx->ODR) ^ PinMask); }I was trying out a Nucleo F303RE board and installed CubeIDE and the HAL/LL library, then stumbled upon this.That function, part of the LL API, first takes a temporary copy of the whole GPIO output register, *then* could be interrupted by an ISR or RTOS task which may change a certain pin bit on the same GPIO port, and then control returns back to above function, which then writes, directly into the ODR of the GPIO an outdated value of ODR xor'red with PinMask - oops, reverting the pin state change made by the ISR.Should it not be more like this?__STATIC_INLINE void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t PinMask) { if (GPIOx->ODR & PinMask) GPIOx->BRR = PinMask; else GPIOx->BSRR = PinMask; }
I am using a a very recent version of STM32CubeIDE (Version: 1.3.1) and STM32CubeMX (5.6.1.202004052303). I created a new project for the Nucleo-F207ZG board.I have enabled LWIP and then enabled UDP but the "IGMP module" has no "enabled" option. Is there some dependency that I am missing?Can anyone else enable IGMP?
Hi guys, I want to use 10 external interrupts. 9 of them are working fine, but one of it makes trouble. I'm using CubeMX and configured the 10 pins as external interupt with falling edge detection and enabled the interrupts. The pins are: PB6, PB7, PF0, PF1, PF2, PF14, PF15, PI9, PI10 and PI11. Interrupt on PF0 is handled with EXTI0_IRQHandler() and works fine, PF1 with EXTI1_IRQHandler() works fine, PF2 with EXTI2_IRQHandler works fine, PB6, PB7 and PI9 are handled with EXTI9_5_IRQHandler() and works fine and finaly, PI10, PI11, PF14 and PF15 should be handled with EXTI15_10_IRQHandler(). It works for PI11, PF14 and PF15, but PI10 is not working. First I was thinking about an hardware issue, so I checked the falling edge with the oscilloscope and it looks fine. Then I checked the register. GPIOI_IDR: When the signal on the pin is high (3,3V), IDR10 is 1, when its low (0V) its 0. So there should not be a hardware or connection issue. MODER10 in the GPIOI_MODER register is 0 (the pin is
Hello, I am triying to use the STM32F407 with Freertos ,USB VCP and USART interrupts. My problem is when I include USART interrupts with Freertos, the interrupt is always running. I did other project without the Freertos and everything is OK. I leave the code.THank youmain#include "main.h" #include "cmsis_os.h" #include "usb_device.h" UART_HandleTypeDef huart2; UART_HandleTypeDef huart6; osThreadId defaultTaskHandle; osMessageQId myQueue01Handle; osSemaphoreId myBinarySem01Handle; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_USART2_UART_Init(void); static void MX_USART6_UART_Init(void); void StartDefaultTask(void const * argument); void USART6_IRQHandler(void); int main(void){ HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_USART2_UART_Init(); MX_USART6_UART_Init(); osSemaphoreDef(myBinarySem01); myBinarySem01Handle = osSemaphoreCreate(osSemaphore(myBinarySem01), 1); osThreadDef(defaultTask, StartDef
..
Sometimes, I have some code need run after 'MX_GPIO_Init()' but before 'MX_NVIC_Init()', but there is no user code region at here. I often encounter the situation, that some peripheral initialization need gpio inited first, and then enable the interrupt.Thanks.
Lately I got stuck at a particular issue in STMCubeMX / STM32CubeIDE Device configuration tool, where a certain portion of the HAL library configuration was fixed and overwritten during code generation, more info here.---This above issue has been fixed in the later versions of STMCubeMX (don't know exactly, versions after mid 2020) / STM32CubeIDE (version 1.4.0 onwards).See the linked thread for more info.The workaround below can however be applied to other issues - but it's pretty hacky and you should really only use it when all other options have been exhausted.Original post follows.---I've figured out a workaround for this and since I suspect that this might be applied to other issues as well, I'm posting it here.---The idea is to use a user template (which is a FreeMarker template with alternate square bracket syntax) to wrap specific blocks of the auto-generated header file into USER CODE sections.This allows user modifications within that block to survive code regeneration. Other
FYI: To run the cube on raspberry:Download and install Oracle java 1.8.0, arm32 hard float cd /opt; tar xvf jdk-8u251-linux-arm32-vfp-hflt.tar.gzDownload and unzip STM32CubeMXunzip en.stm32cubemx_v5-6-1.zipStart installer/opt/jdk1.8.0_251/bin/java -jar ./SetupSTM32CubeMX-5.6.1.exeExecute STM32CubeMX from install directory/opt/jdk1.8.0_251/bin/java -jar ./STM32CubeMX
Hi,I want to measure time between two events. The events come in as ext- interrupts. I set up a timer like this:TIM_MasterConfigTypeDef sMasterConfig = {0}; /* USER CODE BEGIN TIM6_Init 1 */ /* USER CODE END TIM6_Init 1 */ htim6.Instance = TIM6; htim6.Init.Prescaler = 49; htim6.Init.CounterMode = TIM_COUNTERMODE_UP; htim6.Init.Period = 1; htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; if (HAL_TIM_Base_Init(&htim6) != HAL_OK) { Error_Handler(); } sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; if (HAL_TIMEx_MasterConfigSynchronization(&htim6, &sMasterConfig) != HAL_OK) { Error_Handler(); }Starting the timer HAL_TIM_Base_Start(&htim6);Trying to read its value in the ext-it gives always 1 or 0. I dont really understand what I am doing wrong.// diff is allways 0 or 1 (even when different times went by between the calls) uint32_t diff = __HAL_TIM_GET_COUNTER(&h
Hi, I have 3 SAI ports and 2 x SD cards ( FATFS in cubeMX does't set up 2 cards )the chip is supposed to have 4 SAI ports stm32h753bit6I get conflict errors if;I have asynchronous set on SAI1 A without error on SWD pinI have SDMMC2 in 4 bit mode without conflict on SWO pinbut there are no conflicting pins?The main problem though , if I choose Syncronous on SAI1 port A and enable 1bit mode for SDMMC2 then the conflict errors go away in debug BUT....PB3 JTDO-SWO pin remains orange!!Am i doing something obviously wrong here ?I attached the cubeMX file
Hi,I'm using CubeIDE 1.3.1 with CubeMX 5.6.1, target is a STM32L5 with SDMMC.I had a problem during SD initialisation, which gave me a timeout error every time from SDMMC_CmdGoIdleState call in SD_PowerON.I finally found the problem : the function HAL_SD_MspInit generated by CubeMX in the file stm32l5xx_hal_msp.c is just setting things in the PeriphClkIni structure but never uses it : here's the code generated :void HAL_SD_MspInit(SD_HandleTypeDef* hsd) { GPIO_InitTypeDef GPIO_InitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; if(hsd->Instance==SDMMC1) { /* USER CODE BEGIN SDMMC1_MspInit 0 */ /* USER CODE END SDMMC1_MspInit 0 */ /** Initializes the peripherals clock */ PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_SDMMC1; PeriphClkInit.Sdmmc1ClockSelection = RCC_SDMMC1CLKSOURCE_PLLSAI1; PeriphClkInit.PLLSAI1.PLLSAI1Source = RCC_PLLSAI1SOURCE_HSE; PeriphClkInit.PLLSAI1.PLLSAI1M = 4; PeriphClkInit.PLLSAI1.PLLSAI1N = 48; PeriphClkInit.PLLSAI
Hi,Is there an update to CubeMX in the works that would upgrade the LwIP package to the latest 2.1.0 release, instead of using the old 2.0.3 version currently in use by CubeMX?Best regards,
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.