Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I have generated a project for the STM32f769 Discovery board using STM32CubeMX, to read in audio from the Line In jack, convolve the audio with a long FIR filter then output the audio to the Line Out jack. I am using the EWARM IDE. stm32f7xx_hal_def.h defines HAL_Status_TypeDef and HAL_LockTypedef, and they are #included in the .h files in which the HAL_ items are defined.
..
When generating code on an existing Makefile project any existing C_DEFS are corruptedC_DEFS = \ -DUSE_HAL_DRIVER \ -DSTM32F301x8 becomes-DC_DEFS = USE_HAL_DRIVER \ -DSTM32F301x8 so the definition of C_DEFS is lost and random errors result from the dangling defines.This is on version 5.6.1 but is has been an issue for a long time (at least a year).I've also seen other strange behaviour on Makefile - like "# compile gcc flags" gets repeated every time the code is generated - one makefile now has the string 15 times on one line!!Another is -isystem for system include file path, CubemX insists on prefixing it with -I so it fails with -Iisystem ....I'll save all the other bugs I've found for another day! - the above are the most annoying!
Hello,I'm working with the NUCLEO-F722ZE EVB on STM32CubeIDE.My design has a DAC output connected via a jumper wire to an ADC input (see the red wire in the attached picture.The DAC is successfully generating a sawtooth wave - verified via an oscilloscope.However the ADC isn't working properly. I'm using a break point to stop the code and I see "semi constant" values.By "semi constant" I mean that the reading is changes between compilations but is constant during runtime and seems to be unaffected by the DAC that's driving it.What am I doing wrong ?This is my code:#include "main.h" ADC_HandleTypeDef hadc3; DAC_HandleTypeDef hdac; UART_HandleTypeDef huart3; uint32_t voltage_in = 0 ; uint32_t voltage_out = 0 ; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_USART3_UART_Init(void); static void MX_DAC_Init(void); static void MX_ADC3_Init(void); int main(void) { HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_USART3_UART_Init(); MX_DAC_I
Hello, I am using STM32F746 discovery board and trying to store data at external SDRAM but seems like data is not getting stored. I generated driver code using CUBEMX. When I tried checking example code , Found SRAM is getting initialized with "HAL_SDRAM_Init" but "BSP_SDRAM_Initialization_Sequence" function is not generated by CUBEMX, Not sure if we need this to store data.Please suggestion. Attaching my project for reference.Thanks
USB CDC is not properly recognized by Windows 10.How to recover :\Inc\usbd_conf.hSource code change/** Alias for memory allocation. *///#define USBD_malloc malloc#define USBD_malloc (USBD_CDC_HandleTypeDef *) USBD_static_malloc/** Alias for memory release. *///#define USBD_free free#define USBD_free USBD_static_freeSource code addition/* Exported functions -------------------------------------------------------*/void *USBD_static_malloc(uint32_t size);void USBD_static_free(void *p);
I want to use the CMSIS DSP library for doing some FFTs. I am planning to use a STM32H745 micro and am prototyping on a NUCLEO-144 (H745ZI-Q) board. It seems that CubeMX does not support adding the DSP library for the 745 micro, I am guessing because it has both an M7 and M4 core in it, which is confusing CubeMX. Adding the DSP library is an option for the similar, M7-only 743 micro (though, I tried making a project for a 743 for reference, and the resulting code did not work). I was able to copy files manually and use a function from the DSP library that way, but this did not survive regenerating the code.Is there an easy way I can get the tools to cooperate and let me use the CMSIS DSP library? Does anyone know the correct #defines to use? I think I added ARM_MATH_CM7 and __FPU_PRESENT=1 to get it to compile.
I have meanwhile a running uSD card. I have the need to reinitialize the card.In FatFS I do an unmount (it is a mount with certain parameters).It looks like the following is missing:void MX_FATFS_DeInit(void){ /*## FatFS: UnLink the SD driver ###########################*/ retSD = FATFS_UnLinkDriver(SDPath); /* USER CODE BEGIN Init */ /* additional user code for init */ /* USER CODE END Init */}But now when I reinit the SDIO, it looks like there is a hen-and-egg-problem:SD_WideBus_Enable / SD_WideBus_Disableuses SD_FindSCR to get supported bus wide modes.SD_FindSCR callsSDMMC_CmdSendSCRwhich configures how to transfers data over DAT0 or DAT0 to DAT3 lines (depending on the previous configuration of SDIO bus width). I am not completely sure, if I am correct.I know or I can store if I was at 4 bit wide mode, but if SDIO bus wide does not fit uSD bus wide, I cannot switch to be able to communicate again.I don't know yet how to solve it.Is there perhaps something likeSD_deinitializeneeded i
Hello, and thank you for the time spent reading my message !There are others topics on the internet about ethernet and cubemx (not with my Phy) but I am blocked for 2 weeks, and I don't find a solution.My problem : cubemx generate code with ethernet, lwip, dhcp enable and without freertos (try with freertos too, same problem). With Rmii.I have a dhcp server in background on my pc.To begin, I have already done tests with nucleo F746ZG with its Lan8742 phy and it works.Now I try to do the same on the final board (personnaly I have only the Ethernet part to do) with F746 chip and a tlk106 phy (choice of tlk106 was done before I begin in the society).The problem is that the F746ZG send dhcp request (I can see it on my) but i never have the validation on my dhcp server on my final board with tlk 106.Whereas with nucleo board ans lan8742 I have the dhcp with good allocation.I know I have to modify few registers (tlk106 datasheet is very close to DP84846) so I put in ethernet_conf PhySr to 0x
When will be support available for following board in CubeMXNUCLEO-L4A6ZG Development Board, STM32 Nucleo-144, STM32L4A6ZG MCUHowever ST is selling this board but development support for this board is not available ? IS their any plan for release ?
Dear ST,When is the next release of CubeMX and CubeIDE coming?Based on a few sentences in this forum, you promised to release in the 27th or 28th week ...Thank You!
Generated code for F429 Nucleo with USB CDC fails to compile Src\freertos.c etc. with messages:..\Src\usb_device.c:55:22: fatal error: usbd_cdc.h: No such file or directory ..\Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Src\usbd_cdc.c:62:22: fatal error: usbd_cdc.h: No such file or directory In file included from ..\Src\usb_device.c:56:0: ../Inc/usbd_cdc_if.h:59:22: fatal error: usbd_cdc.h: No such file or directoryI've attached IOC for easy reproduction of bug.Thanks for any help or bugfix,Best Regards, DavePS: Attention @Markus GIRDLAND @Imen DAHMEN
I define two channels scan mode ADC and need it leave run alltime over DMA.CubeMX have this settings only disabled.I overwrite init and it works, then i dont understand why CubeMX block this ?ADC i need dma hw based and RTOS calculate over memory buffer .Now i use 1024 samples per channel and ADC_SAMPLETIME_112CYCLES
Hello,When creating the default configuration for STM32F769I-Eval with CubeMX (using default configuration), the FMC is configurated to 22bits address.On the schematics, address goes from A0 to A20, so 21 bits address.Is this an error of the default configuration and should I change it to 21? Is there a purpose to do that (purpose that I do not understand)?Thank youAntoine
Hi !I need to overwrite the "normally" weak defined generated function HAL_TIM_PeriodElapsedCallback().But if a timer other than SysTick is used as Timebase Source (which is recommended when FreeRTOS is used) than STM32CubeMx is generating this function directly in main.c without the weak property.Therefore I'm looking for a macro or definition which can be used at compile time to know which timer is used ... Thanks !Michael.
I recently upgraded from CubeMX 5.3 to the new 6. Some project settings get changed when I do so and it's kind of annoying. I am looking at the raw .ioc file so make it easier to copy and paste exactly what's changing.First)ProjectManager.LibraryCopy=2gets changed to ProjectManager.LibraryCopy=1This results in a bunch of files being copied into the output folder. Granted I can ignore them but it's kind of annoying as I specifically set the setting so this wouldn't happen and version 6 reverted that change. I have tested this on an H7 project that was built using CubeMX 5.3 and an L4 project built using CubeMX 5.0.1 and the same thing happened on both.Second)It changes all the NVIC interrupt settings.old:NVIC.DMA1_Stream0_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:truenew:NVIC.DMA1_Stream0_IRQn=true\:5\:0\:false\:false\:true\:true\:falseSomething changed in the program with the way that line gets interpreted because this means that all of the interrupt handlers no longer called t
I am using STMCubeMX to generate HAL code to control the GPIO on a STM32L071Rb MCU.I have set GPIO PA6 as "GPIO Input". The generated code initializes the GPIO by calling the function MX_GPIO_Init() where it "appears to be setting up the PA6 correctly".This pin is pulled up on my PCB and reads properly under normal operating ocnditions.However, the very first time that my program attempts to read this pin the HAL function returns a '0'. Subsequent calls to this same function and same pin return a '1'. I copied the HAL code for reading a GPIO pin below. When I step through this code it looks like the first time for the PA6, the condition at line 8 FAILS and therefore the function returns the value GPIO_PIN_RESET. In the debugger, the value of GPIOx->IDR shows as 0x6000 and the value of GPIO_pin shows up as 0x40. Do I need to take some extra steps in my initialization code such as: read all the GPIO once before starting any analysis, or change something in the STMCubeMx input configur
I just generated the Default Project for the Nucleo STM32F103RB with CubeMX. I want to transmit messages with UART2, but it is not fully initialized in my opinion.Can anyone help me to transmit by UART? See my Code below.In examples there is always set GPIO_InitStruct.Alternate, but in my struct, created by CubeMX, there is no Alternate Parameter./* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2020 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 written a custom driver for Modbus protocol and I want to share it with others, I think CubeMX is the most convenient way to share it.I found that CubeMx does use .pdsc files to install packages, and I have written a simple .pdsc file to test. However, after searching the installation directory: "...\Repository\Packs", I found that the package rules are more complicated than simple .pdsc files. For example, this file: STMicroelectronics.X-CUBE-AI.5.1.2_Modes.xml , defined how to show and modify Configuration in CubeMX. And I could not find the rule of how to write it.So, I'd like to konw that how to write a custom CubeMX package, is there any guide for it ? Any help is greatly appreciated.Thanks for your reading.
Posted on September 27, 2016 at 11:50hi I working with stm 32 f 429 with cubemx (to init ethernet)in cubemx PHY is DP83848 but i using LAN8720aWhat changes should be in Keil (FOR Lan8720a) ?any body know?There is contents dispersed in some page in this forum but incomplete Does anyone have sample code with LAN8720a & HAL driver? #cubemx #stm32f4 #ethernet #lwip
When STM32CubeMX v.5 generates project, it does not insert HAL_SYSTICK_IRQHander() inside SysTick_Handler(). As a result, your HAL_SYSTICK_Callback() no longer works. Previous versions of CubeMX used to generate following code for SysTick_Handler()/** * @brief This function handles System tick timer. */ void SysTick_Handler(void) { /* USER CODE BEGIN SysTick_IRQn 0 */ /* USER CODE END SysTick_IRQn 0 */ HAL_IncTick(); HAL_SYSTICK_IRQHandler(); /* USER CODE BEGIN SysTick_IRQn 1 */ /* USER CODE END SysTick_IRQn 1 */ }In version 5. it becomes/** * @brief This function handles System tick timer. */ void SysTick_Handler(void) { /* USER CODE BEGIN SysTick_IRQn 0 */ /* USER CODE END SysTick_IRQn 0 */ HAL_IncTick(); /* USER CODE BEGIN SysTick_IRQn 1 */ /* USER CODE END SysTick_IRQn 1 */ }
Detailed configuration steps would be appreciated or any link to the resources would be appreciated .Thanks in advance
I am using STM32f769Ni discovery board. I need to transfer the data from discovery board to another node via ethernet. Here i have to use the discovery board as client.Another node acting as server. I need to use the Ipv6 self-assigned address(stateless autoconfiguration). I don't know how to configure this in STM32Cue MX. I am using LWIP. Could anybody explain how to do this.I am totally beginner to this topic. And also is there any example program for sending and receiving the data from server.Thanks in advance.
Hello everyone,In CubeMX 5.3.0 I have configured FATFS+DMA+SDMMC for a card running STM32F777VI. i've been trying to save some data into a .txt file.It works fine, but i can't write data to SD card as fast as I want. Requirement is to save 25 bytes every 3ms (which I receive from UART at 330Hz), but it seems doing so affects speed of other UART communications/ stops communication for a moment. What's the maximum write speed I can achieve without affecting other peripheral behavior? I was playing with clock settings/SDMMC CLK divide factor to figure out if it's low clock setting issue. Attaching system clk config and SDMMC settings,can anyone see a potential problem in clock settings?
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.