Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
other SDIO cannot be configured after one of them configured with DMA.
Hello,I want to make a simple TCP/IP link from STM32 to Linux PC by using UART interface.I've also tried to configure LWIP + FreeRTOS using SLIP interface, however it still doesn't work.Hi everyone does anyone have experience of bring up LWIP with SLIP interface ?My code is bellow:https://github.com/kamejoko80/freertos_lwip_slip/tree/master/Src Thank you
Bug report in HAL.Under heavy load, the USB Host stack can hang due to the EPDIR flag on an IN Channel being incorrectly cleared by the HAL.stm32f4xx_ll_usb.c, function USB_HC_Halt, clears EPDIR in the case that the request queue is full. This routine is called by IN & OUT interrupt handlers and can there leave EPDIR wrongly reset for an IN channel.In the case of using DMA, tech ref says (in section 'Halting a Channel') that code does not need to check for request queue full - so I think the code should probably take DMA into account as well.I am using DMA, I have commented out the process queue check.
When I try to build and generate code for my model on matlab/simulink I recieve the following error:The call to stm32_make_rtw_hook, during the entry hook generated the following error: getSTM32CubeMxPath:PathNotFound for 'C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\STM32CubeMX.exe' ===> Install STM32CubeMX tool or Update/Apply path from: Configuration Parameters > Code Generation > STM32 OptionsThe build process will terminate as a result.Caused by: getSTM32CubeMxPath:PathNotFound for 'C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\STM32CubeMX.exe' ===> Install STM32CubeMX tool or Update/Apply path from: Configuration Parameters > Code Generation > STM32 OptionsEven though the path is correct MATLAB does not seem to be able to recognize the program. I could not find anyone else who encountered the same problem. Does anyone know the solution to this? Thanks in advance
STM32F334 DMA + DAC.After CubeMX: MX_DAC1_Init(); MX_DMA_Init(); MX_DAC2_Init();DAC2 working, DAC1 don't workingAfter editing: MX_DMA_Init(); MX_DAC1_Init(); MX_DAC2_Init();DAC1 and DAC2 working.The same for STM32F103. MX_DAC_Init(); MX_DMA_Init();Error MX_DMA_Init(); MX_DAC_Init();WorkingIt may be CubeMX error?
Try as I might in the STM32CubeMX I can't get TIM16 to use the LSI as the input. MX_TIM16_Init(); /* USER CODE BEGIN 2 */ // Start timer HAL_SuspendTick(); HAL_TIMEx_TISelection(&htim16, 1, TIM_CHANNEL_1); HAL_TIM_Base_Start_IT(&htim16);The call to HAL_TIMEx_TISelection() ends up performing this write to the TISEL register of TIM16MODIFY_REG(htim->Instance->TISEL, TIM_TISEL_TI1SEL, TISelection);Bit definitions Here is my STM32CubeMX setup.I am expecting roughly 1/2 Hz interrupt with a 16000 setting. Instead, I am getting 1mSec. Any help is appreciated.Thanks
CubeMX 6.5.0, CubeIDE 1.9.0No matter what I do, CubeMX always generates this:/* Initialize all configured peripherals */ MX_GPIO_Init(); MX_TIM2_Init(); MX_DMA_Init(); MX_TIM3_Init();While it should be:/* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); // <-- DMA first!! MX_TIM2_Init(); MX_TIM3_Init();So DMA fails miserably.Attached the ioc.
I am trying to use HSI16 on STM32L431KCU but the usart is not generating the correct baud rate. I can only get the correct baud rate if using MSI. I use CubeMX to generate my code from attached dmc300_l4.ioc. Below is the clock tree for usart1 and usart2 The output from 2 terminal for usart1 and usart2. We use other STM32L4 MCU, but it doesn't have this issue. Can you tell me why the STM32L431KCU HSI16 can not generate the correct baud rate?
H723ZGT6 Nucleo-144CubeMX 6.5.0CubeMX FW 1.10.0uVision 5.35.0.0STCubeMX has been updated 6.3.0-> 6.5.0I also updated the FW version 1.9.1-> 1.10.0After that, the user label will no longer be reflected.I'm using CubeMX to import a previous project and using the latest version to generate the code.Apparently, the label is peeling off at the timing of code generation.This is the state before code generation.User labels are well reflected hereAfter generating the code, let's take a look at uVision.The user label has come off.This is an old project, but it reflects the user label.Did you forget to set something when you generated the code?Please let me know if you have any ideas.
I am programming on the STM32L4R9I-EVAL dev board, but my project is configuredfor the STM32L4S9AII6. I am clocked at 120MHz.I have been fighting the following bug off and on for about 3 months. I queried for help on this a couple months ago and thought I had resolved the issue.https://community.st.com/s/question/0D53W00001PxcHZSAZ/can-you-have-too-many-peripheral-init-functionsI think I fix the issue and then it randomly pops back to ruin my day about every 2-4 days. The problem first manifest itself in my project as I was trying to get a one-shot timer configured. Since then I have observed enough to be 97% convinced that this is an interrupt configuration issue with MxCube, but as I debug the code and analyze the auto-generated code by MxCube everything seems correct.The cycle goes like this. I have to make some change to MxCube for various reasons like deleting a mutex or queue from FreeRTOS or adjusting settings with DMA or ADC interrupts. The ADC and DMA interrupts that I crawled
CubeMX version 6.5.0 generates the following line in <project>/LWIP/target/ethernetif.h:static void ethernetif_input(void const * argument);Previous version 6.4.0 generated this:void ethernetif_input(void const * argument);The 'static' storage class specifier causes warnings in any module that includes "ethernetif.h". The function could be declared static, but this would best be done modifying the ethernetif.c file. In this manner, removing the declaration entirely from ethernetif.h would be possible, as it really is completely local to ethernetif.c.In any case, unnecessary warnings are not desirable. Follow-up:Modifying ethernetif_header.ftl (C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\db\templates) fixes the issue. ST--please review why you added "static".6.4.0 (good):[#if use_rtos == 1][#-- rtos used --] [#if cmsis_version = "v1"][#-- cmsis_version v1 --] void ethernetif_input(void const * argument);6.5.0 (problem):[#if use_rtos == 1][#-- rtos used --] [#if cmsis
I would like to configure ADC1 and ADC2 as dual interleaved mode, for continues ADC conversion. And use DMA to transfer the converted data to RAM.The goal is to implement a continues ADC at the fastest sample rate with dual interleaved mode (4.5MSPS)But i am totally confused by the DMA data width and burst size settings.I know that when using ADC dual mode, the ADC conversion result is combined into the ADC_CDR register. So I would expect the Peripheral data width is "Word", not "half word".But when I try to set it to "word", it result in hard fault interruption.Only when I set it to "half word" it seems to work without hard fault.I also would like to turn on the FIFO here, and then I am also confused how to setup the Burst size here. I tried a few combinations but I still don't know what should be the correct value here.Attached is my .ioc file. Please help to guide me on what is the correct configuration to enable DMA with FIFO and get the data width/burst size right.Thanks a lo
..
I configured I2C4 for a H747 DISCO board.Here's generated code in main.c:static void MX_I2C4_Init(void); // ... MX_I2C4_Init(); // ... static void MX_I2C4_Init(void) { // ... }It doesn't compile because of function signature conflict withHAL_StatusTypeDef MX_I2C4_Init(I2C_HandleTypeDef *phi2c, uint32_t timing);defined in stm32h747i_discovery_bus.h.AFAIK in C you can't overload functions, so it's the reason it doesn't work.My workaround for this is either changing function signature in main.c by adding "1" to the name, or - change the function in stm32h747i_discovery_bus.h by adding "1" at the end of the name.The downside is at least in main.c the code is generated, so each time I would use code generation option my changes would be overwritten.Is there a better way to solve this issue?
I've installed STM32CubeH7 library 1.10.0 manually from github.I have CubeIDE 1.7 and CubeMX 6.3. Since they both do not understand STM32CubeH7 library version 1.10.0, I've installed CubeMX 6.5 side by side with v. 6.3.The package manager of CubeMX 6.5 sees installed libraries v. 1.10.0 and v. 1.9.1. Fine.But now both CubeIDE 1.7 and CubeMX 6.3 cease to see installed library v. 1.9.1, which they recognized before installation of CubeMX 6.5.All CubeMX 6.5 and 6.3 and CubeIDE 1.7 see same installed versions of STM32CubeF0 and F4 libraries. What's the problem with H7 libraries?OS: win11 home.Update:Ive removed subdirectory of v. 1.9.1. and reinstalled 1.9.0Then all CubeMX 6.3, CubeMX 6.5, CubeIDE 1.7 see the package H7 1.9,0.So it looks that patch H7 1.9.1 is too new for CubeMX 6.3/ CubeIDE 1.7I don't understand why it was detected before install of CubeMX 6.5.
Using an stm32f105RBt6 : i have a working project with canbus and USBdevice.i have another working project with canbus and FAtFS(SPI-sd card)None of them work once i include FATfs+USBCDCdevicei dont know what to make up from this, last time i had a similar error i had messed up my include logic.stm32f105RBt6 custom board.SD Card trough SPI2, sandisk ultra 16GB.CubeMx version 6.4.0, STM32Cube_FW_F1_V1.8.4 package which uses FatFs version R0.10c, Nov 09, 2014.CubeIDE Version: 1.8.0
I created a project with STM32MXCube for the STM32G030F6P6. No changes to the settings. Generate code, run it in STM32CubeIDE in the debugger (STLINK). No changes to the generated code. It stops at main. If I single step it gets to the while(1) loop. If I hit run, and then pause, but PC is somewhere there is no source code. Call stack displays Thread #1 [main] 1 [core:0 ] (Suspended : Signal : SIGINT:Interrupt)then lists0x1fff12c60x1fff1176I have no clue how the CPU gets there. I am just trying to start with something that works before I add one line of code. Any suggestions? I wish there was a WORKING example for this value line CPU.
I have a new project on an STM32H7A3 processor with a microSDHC Card. We want to read/write files with FatFS. In another project with STM32H7A3 we have SDHC Cards working perfectly. Code is created with the latest release of CubeMX 6.5.0 and HAL V: 1.10.0.In the new project we had to use microSD card for reduced space reasons. With the microSD the call to fmount returns "FR_NO_FILESYSTEM". But on the PC the card is readable and has one folder installed.I stepped through the source code and fount that the "find_volume" routine returns FR_NO_FILESYSTEM due to "fmt=3" .Currently we have no idea for a possible solution. The pins are working and pin connection is checked, data is sent/received on the MISO/MOSI lines.Clockspeed was 25 MHz, reducing to 20 and 16.6 MHz did not solve the problem.USE_SD_TRANSCEIVER = 0.Has anybody an idea where to look at further?Is there any futher switch necessary to specify "micro"SDHC cards instead of SDHC?Thank you for any comments.BR G
Dear Community,Time to time I am trying to use STM32CubeIDE and since STM32CubeMX started to declare itself as deprecated, I have tried it again - every time I had problems with it anyway.First, it wants to use the latest firmware for my MCU (F4 V1.27.0) which has a rewritten Ethernet handling but in inconsistent state so it will not compile.However, I can not go for an older firmware version which feature exists in STM32CubeMX but is missing in STM32CubeIDE although I also have older firmware(s) installed.Why isn't is possible to first build a fully functional IDE before pushing users from old method?...or at least to ensure basic generated firmware will compile?I don't know where to give feedback for ST to update firmware code for working Ethernet functionality and to work on missing functionality of CubeIDE...Still I feel STM32CubeIDE is not prepared for serious use... how are you feel about its current state?
HiIn this tutorial STM32 MCU is used to interface PCF8574 Pin Expander over I2C to control 8 LED sound level indicator using only 2 pins. Both hardware and software are explained in details. All tutorial materials are shared in the GitHub Repository in the video description.
When generate code via stm32cubeIDE from .ioc ,It Randomly generate line MX_DMA_Init(); Before / After other Module .Problem is, When other module have some DMA config inside , for me ,it ADC , But MX_DMA_Init(); generate after MX_ADC1_Init(); , That mean __HAL_RCC_DMA2_CLK_ENABLE(); and __HAL_RCC_DMA1_CLK_ENABLE(); inside MX_DMA_Init(); not ativate when ADC config DMA inside HAL_ADC_MspInit , Clock for DMA is not enable when ADC DMA config happen, So that configs are void and don't have effect.For me it appear randomly I temperaly fix by add __HAL_RCC_DMA2_CLK_ENABLE(); __HAL_RCC_DMA1_CLK_ENABLE(); in /* USER CODE BEGIN SysInit */Did we have some way to fixed the other of mx init sequence?Sorry for my english
I have two peripherals on my board that I need to communicate with using 3-wire, half-duplex SPI. I have tried every combination of settings I can think of, but I am unable to communicate with either chip.Here is my SPI1 init function:static void MX_SPI1_Init(void) { /* USER CODE BEGIN SPI1_Init 0 */ /* USER CODE END SPI1_Init 0 */ /* USER CODE BEGIN SPI1_Init 1 */ /* USER CODE END SPI1_Init 1 */ /* SPI1 parameter configuration*/ hspi1.Instance = SPI1; hspi1.Init.Mode = SPI_MODE_MASTER; hspi1.Init.Direction = SPI_DIRECTION_1LINE; hspi1.Init.DataSize = SPI_DATASIZE_8BIT; hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; hspi1.Init.NSS = SPI_NSS_SOFT; hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_64; hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi1.Init.TIMode = SPI_TIMODE_DISABLE; hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; hspi1.Init.CRCPolynomial = 0x0; hspi1.Init.NSSPMode = SPI_NSS_PULSE_DIS
Was old project, works well, need make minor changes with not related to ADC functions, not look press "migrate" to latest version. was confused all ADC operations fault. when check what wrong, found ADC lost clocking.Take new computer, install clean last version of Cube IDE 1.9.0, make new H750VBT6 project.look on the clock - ADC clocking tab gray color.enable ADC - look again, again gray colorAlso dissapear "clock prescaler" setting in the ADC settingsmeanwhile same test with USART for example on the clocking tab.if USART disabled - gray colorif USART enabled - instanly request adjust clockingEven if i force copy old sourse code, with latest libraries, ADC dead....
I am using stm32h7 with threadx where TIM6 is time timebase for HAL and systick is used by threadX. The project is generated using the standard cubeMX configuration. I am using tracelyzer to visualize my CPU utilization, and i found out that TIM6 ISR is taking almost 60 % of the CPU, which to me makes no sense as it takes few us to execute and has a period of 1ms. The remaining system (ISRs and Tasks) consume only 11% of the CPU. Am i doing somthing wrong because i cannot do proper RMA of my system.
Hi everyone,I am having a hard time getting the SDMMC interface working with my NUCLEO-L476RG.I feel like this should be an out-of-the-box solution using CubeMX, but somehow I can't get it to work.I am getting a chip detect but an error when establishing the card voltage.As for code, I am just using what CubeMX is giving me, SDMMC 1 bit wide (I tried 4bit, same situation), FATFS with SD card settings. For clock, the sdmmc clock is set to 36MHz (default) and clock divider of 16.Any help is greatly appreciated!
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.