Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I am trying to catch a pulse on PB15. So I set the port PB15 to external irq with falling edge as per screen shot belowThe code in MX_GPIO_Init() generated by MX is:/*Configure GPIO pin : MPuls_Pin */GPIO_InitStruct.Pin = MPuls_Pin;GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;GPIO_InitStruct.Pull = GPIO_PULLUP;HAL_GPIO_Init(MPuls_GPIO_Port, &GPIO_InitStruct);and the code in the call back is a simple test// External Interrupt ISR Handler CallBackFunvoid HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){if(GPIO_Pin == MPuls_Pin) // INT Source is pin PB15{// HAL_NVIC_DisableIRQ(EXTI15_10_IRQn);// Serialprint((uint8_t *) "Hi\n");if( IRQCheckI > 0) {IRQCheckI = 0;sprintf (TempBufCA, "%3d -> ", ++TempCI);Serialprint(TempBufCA);}if ( MotorPosGI > 0) {MotorPosGI=0;Serialprint("\nMagnet at position\n");}// HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_11); // Toggle LED}}I put a break point on the line if(GPIO_Pin == MPuls_Pin) // INT Source is pin PB15{ but the loop never get accessed by the external
So I've moved away from eclipse and the CubeMX IDE. I am using sublime as my editor and I am enjoying a great deal of success and I would recommend to anyone using cubemx to migrate to a non java based IDE/editor - I compile the makefiles generated from CubeMX IDE and upload using STM32_Programmer_CLI directly from sublime.Therefore, as I want to forgo eclipse (except for debugging, the build analyser, and a few nice tools within) My questions are:How does CUBEMX generate the makefiles. (I assume it requires the .mxproject and or .cproject files but I would be happy to edit those myself if required)Can I run a command/script to achieve the same end? If not, it appears that CUBEMX only updates the makefiles when you perform a build. Can I at least stop compilation when running Debug/Build?Thanks for any suggestions+ sorry for initially posting this in the wrong part of the forum
Hi,I want to know by when STMicrolectronics is going to support STM32U0 series in STMCubeMX.-Sumit
Hi, guys, anyone has met such an issue?I was trying to generate code by CubeMX, and I also wanna generate USART1 IRQ handler but failed.here are my settings, anyone can help me with this?thanks
I'm using CubeIDE 1.15 with CubeMx plugin 6.11 to develop code for STM32H745.The clock resolve chooses 64MHz for USB:whereas the correct USB clock frequency is 48MHz:I would expect the clock configuration GUI to flag this issue for me and set up the correct frequency of 48MHz for USB when running the clock resolver. Just in case this is relevant, this is what my USB setup looks like:
I'm using STM32CubeIDE and targeting STM32H745IIK6. When I was using the CubeMx plugin version 6.10.0, I was able to enable the temperature sensor input on ADC3:After upgrading to CubeMx 6.11.0 with FW package H7_v1110.zip, this option (as well as the two inputs listed immediately before and immediately after it) are now gone:With upgraded SW/FW:The three options that used to be listed towards the end of the page, between the "IN16" input and the "EXTI Conversion Trigger" are missing. Are they available elsewhere now?
Note: Firmware package H7 V1.10.0 On the STM32H723 the internal vref and temp channels are connected to ADC3 which is a 12b ADC while ADC1 and 2 are 16b.The internal calibration values for the temperature sensor and vref are also scaled in 12b it seems but the HALMacros __HAL_ADC_CALC_VREFANALOG_VOLTAGE (in stm32h7xx_hal_adc.h) or __LL_ADC_CALC_DATA_TO_VOLTAGE (in stm32h7xx_ll_adc.h) assume a scaling in 16b resulting in incorrect readings if the actual adc resolution of 12b is passed to these macros instead of 16b.Passing a resolution of 16b and the actually 12b value from ADC3 to these functions results in a correct value.The same also applies to the macro __LL_ADC_CALC_TEMPERATURE and possibly others. The comment to __LL_ADC_CALC_DATA_TO_VOLTAGE states:"On this STM32 series, calibration data of internal voltage reference* VrefInt corresponds to a resolution of 16 bits" which is incorrect for this chip in this case.The vref calibration value on one specific chip h
I am using TIM+DMA, and the main problem is that the first value should be loaded into ARR before the timer starts, but it is not. Also, regarding length, if it should be set in bytes, it should be clearly documented in a comment for that function, which currently it is not. uint32_t val_tim[] = {1500, 1200, 2000, 3000, 4000, 5000};HAL_TIM_Base_Start_DMA(&htim2, val_tim, 6 * 4);
Hi everyone! I'm having some problems with DMA+SDMMC+FATFS.The nonDMA version works succesfully. But when I want to use DMA I have problems. My MCU - stm32F765vi. My peripherals initialization looks likeSDMMC1SDMMC1 NVIC settingsFATFS settingsThe problem is that f_mount returns an error that makes it impossible to work.Going further, the find_volume function is called in the f_mount function. Then the code stops at this point, after which an error is returned.Value of fmt = 3.I also tried to use separate RX and TX, but the error appears in the same place.Studying the forums and documentation didn't help me, so I would appreciate any help!
Hello,I'm trying to communicate with the USB FS CDC on my NUCLEO-H723ZG while using FreeRTOS and the device doesn't enumerate properly. I am using the current up-to-date software pack for STM32H7 -> 1.11.2I use the CubeMX starting project with the NUCLEO-H723ZG and I only add the USB_OTG_HS as a Full Speed Device.Then I add the middleware for the CDC using all default parameters.If I use the project at this point, the USB communication with the virtual comm port works flawlessly. However, it stops working when I add the middleware FreeRTOS with its default parametersIn Windows 11 Device Manager, I am getting the error were the USB descriptor failed (Code 43)Is there a configuration I am missing ? I would have expected the USB CDC driver to work right out of the box with FreeRTOS at this point...I have added the .ioc used to generate the projet as well as the main with the code to send an Hello_world message to the virtual com port. The only hardware required is the NUCLEO-H723ZG wit
Neither STM32CubeMX nor STM32CubeIDE can't connect to ST servers to login into MyST and/or download firmware packages/toolchains. Problem is that there is no verbose output for what is the reason, just error messageBut from wireshark capture I can see that it can resolve name of server and communicate with it, so firewall shall not be an issue.Same goes for STM32CubeIDEBut it also has access to internet, at least can see updatesAnd can establish connection with ST Micro servers This issue is only with specific corporate laptop, mentioned software can run without issues on my personal PC which is in same LAN. I am working on this issue with my company IT department, but it is hard to guess what could be the problem, because there is no specific info on why error happens. To me it seems like server breaks connection, but it would be nice to get some logs out of software to understand better how to troubleshoot the issue.
When i moved to new version of CubeMX and regenerate code for my H7 USB project i got compiler warning about some variables. Here is difference between old and new generated usbd_desc.c file;Old file:static void Get_SerialNum(void) { uint32_t deviceserial0; uint32_t deviceserial1; uint32_t deviceserial2; deviceserial0 = *(uint32_t *) DEVICE_ID1; deviceserial1 = *(uint32_t *) DEVICE_ID2; deviceserial2 = *(uint32_t *) DEVICE_ID3; deviceserial0 += deviceserial2; if (deviceserial0 != 0) { IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8); IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4); } } New file:static void Get_SerialNum(void) { uint32_t deviceserial0; uint32_t deviceserial1; uint32_t deviceserial2; deviceserial0 += deviceserial2; if (deviceserial0 != 0) { IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8); IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4); } } As you can see deviceserial0, deviceserial1 and devices
Hi, all,I am trying to port my preconfigured H743 Nucleo board pinout setting to H753ZI Nucleo board, which is pin to pin compatible. I clicked the "list compatible MCU" under the pinout tab, but for some reason, the window just stuck in the loading process forever. Please see the picture below: The progress stuck at exactly 70%, I can see the MCU I want, but I couldn't click on it because the loading is not done. Any idea on how I can fix this? Thanks for any suggestion in advance.
cubemx: 6.11 cubeide:1.15 cubeg4:1.5.2 azrtospackage:2.0.0./AZURE_RTOS/App/app_azure_rtos.c:53:14: error: expected ';' before 'static' 53 | __ALIGN_BEGIN static UCHAR tx_byte_pool_buffer[TX_APP_MEM_POOL_SIZE] __ALIGN_END; | ^~~~~~~ | ; ../AZURE_RTOS/App/app_azure_rtos.c:53:70: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__ALIGN_END' 53 | __ALIGN_BEGIN static UCHAR tx_byte_pool_buffer[TX_APP_MEM_POOL_SIZE] __ALIGN_END; | ^~~~~~~~~~~ In file included from ../Core/Inc/app_threadx.h:29, from ../AZURE_RTOS/App/app_azure_rtos.h:31, from ../AZURE_RTOS/App/app_azure_rtos.c:23: ../AZURE_RTOS/App/app_azure_rtos.c: In function 'tx_application_define': ../AZURE_RTOS/App/app_azure_rtos.c:81:68: error: 'tx_byte_pool_buffer' undeclared (first use in this function); did you mean 'tx_byte_pool_create'? 81 | if (tx_byte_pool_create(&tx_app_byte_pool, "Tx App memory pool", tx_byte_pool_buffer, TX_APP_MEM_POOL_SIZE) != TX_SUCCESS) | ^~~~~~~~~~~~~~~~~~~ ../Middlewa
Dear ST Community, I need to use an SRAM with the STM32H743AII6 MCU. When I try to configure the project on CubeMX, a warning appears next to the FMC line. I feel like I should fix this before going further with the configuration. I am curious why I am getting this warning even when FMC is the only peripheral that was already configured. Has anybody experienced this before? Are there any suggestions to resolve this? Here is a summary as background information: The warning text says "Partly disabled conflict with FMC Chip Select NE1". Warning stays even if I use NE 2/3/4. The package is UFBGA169, and NE1 pin is available on that specific pinout. CubeMX version is 6.11.0 but the issue was present with earlier versions as well. A screenshot is attached below. Thanks, JD
Bug DescriptionSTM32CubeMX offers the user an option to register their own callback functions under the advanced settings tab:In this example i have enabled the callback registration for CAN aswell as the SDADC. After generating the code my stm32f3xx_hal_conf.h file looks like this: ... #define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ #define USE_HAL_CAN_REGISTER_CALLBACKS 1U /* CAN register callback enabled */ #define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ #define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ #define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ #define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ #define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ #define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ #define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callbac
Hello everyone,I'm working on a Data Logger that inputs strain gauge sensor signals. I've already tested successfully my application on bread board but now it requires a standalone implementation in a new PCB. Since I can not waste shots I'll ask the community for help on this one.This is the electric scheme of my application with an STM32L452CEU6 MCU in the middle, I would like to know the following:- if the power sources are correct- if there are enough capacitors and if there are some mistakes on the VDD and VSS sources- Generally mistakes on the circuit Thanks
Hello, I would like to use the offical VScode extentention together eith STM32CubeMX.The guide says I need to set up MX generator Toolchain / IDE to Cmake.However I have no such option: How could I use the extention with CubeMX?I remember the option was there about a year ago on a different MCU (F3).I have STM32F103C8.Thank you!
Hi, yeah, I'd just like to remind the people that put together the updater portion of CubeMX that Windows has Run as Administrator, but MacOS does not. So when you hit Check For Updates, you get an indication that there is an update, but the check box is some weird colour (not grey, not unchecked, no indication of a reason why you can't select the update, and you can't update). To get the updater to work, you have to fire up a command line, cd into the application (for Windows people, a Mac app is a directory containing the executable as well as all of the resources to support the executable), then execute the java code using sudo.For me, I've been using Macs for many years, it's an annoyance. For people that are newer to embedded systems and especially ST's tools, this is a stopper and just a support issue waiting to get triggered.Stop doing that.
Hi, I hope this message finds you well,I've been working with the STM32H723ZG and am trying to configure and initialize the ADC to sample at 100khz sampling rate but have been unsuccessful. I have HAL_ADC_ConvSpltCallback() to toggle an LED for debugging purposes. Any help/suggestions will be greatly appreciated!Here are the steps that I took to initialize the ADC.Timer Parameter Configuration ADC1 Parameter Configuration ADC1 DMA Settings Variables /* USER CODE BEGIN PD */ #define ADC_BUF_SIZE 20 /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ #if defined ( __ICCARM__ ) /*!< IAR Compiler */ #pragma location=0x30000000 ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */ #pragma location=0x30000200 ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_
Hello Got a weird issue, to further test I created blank project with no other code to rule out conflict. When I put in HAL_SPI_Receive_IT(&hspi3, SPI_RX_BUF, 2);,According to my logic analyzer, the clk and data pins stay high and dont move. When I comment it out the clk and data pins move correctly. I've turned on the DMA and have it configured correctly I believe. Im using this chip to talk to a H7 and that chip receives data , when the dma is off, no problem and I have this DMA configured in the same way. I have the h7 disconnected for testing purposes. I've tried everything I can come up with and I'm completely lost and out of ideas.
I'm using HAL UART Receive with DMA (configured using CubeMX). I'm encountering a problem where data via UART, send in chunks, is corrupted if a chunk doesn't fit at the end of buffer perfectly. By chunks I mean a set of byte-sized data that is transmitted one following another in immediate manner.I'm using a simple circular buffer struct where DMA is writing to. I check the CNDTR DMA Channel register to update "head" index of this software buffer. The only process that writes to this buffer is the DMA channel assigned to UART RX.The following code shows how DMA and UART is configured from CubeMX: /** * @brief USART1 Initialization Function * @PAram None * @retval None */ static void MX_USART1_UART_Init(void) { huart1.Instance = USART1; huart1.Init.BaudRate = 115200; huart1.Init.WordLength = UART_WORDLENGTH_8B; huart1.Init.StopBits = UART_STOPBITS_1; huart1.Init.Parity = UART_PARITY_NONE; huart1.Init.Mode = UART_MODE_TX_RX; huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
Hi, i'm using STM32H750VB and i could previously make the Vbat measurement setting under Analog->ADC3 in the old version of cubemx (6.10), but this option has been removed in the new version (6.11). Also the temperature sensor setting is lost. Is this a bug ?
Hi,I've used many revisions of the CubeMX configuration tool to maintain a Keil uVision project for a product we are developing. In the past, upon an updated CubeMx version, I have had to re-add my custom files to the project but from then on CubeMx would leave them in the project. Now, with Ver. 6.9.0, any time CubeMx updates my Keil project it removes all my files and also steps on my include directory list. Pulling my stuff out.Does anyone have any guidance?Thanks.SR
I'm using a STM32G4 and communicating with multiple devices that use a 16 bit + 1 bit (write/read bit followed by six register address bits, 16 data bits, and a parity bit MSB first) on SPI. What I'm seeing is on transfers i have to shift my data 1 bit to the left for the devices to accept the write and reads vary but are mostly unusable. Is there a way to send non standard frame sizes, preferably with the clock and bits shifting continuously until the parity bit? I was hoping for a built in HAL or api method, but from my research it seems I may have to implement this completely in software, which i have not explored how to do just yet with this hardware.
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.