Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi,Basically, my new design will use a STM32F767VGT (LQFP100) and I have a NUCLEO-F767ZI development board (STM32F767ZI LQFP144).All of the ports and functionality I'm using in the new project are available on the development board. I'm using 4 * Uarts, SPI, 2*I2C, SDCARD, USB etc and approximately 20 I/O pins. I want to develop my STM32MXCube project (ioc file) using the STM32F767VGT and use it to set up all of the ports and name I/O ports as per project function etc etc.Can I then make a copy of this ioc file and change the processor to the STM32F767ZI LQFP144 for development using the NUCLEO board?Bringing all hardware configuration across with it?Thanks,Neil.
I'm debugging STM32G071RB by using Nucle-G071.The code I use is generated by STM32CubeMX, and I try to put break point to variable in "static void MX_ADC1_Init" but it semms like not to initialize because I cannot put break point there.I confirmed that sample code in L0 is fine without any trouble.I only generated initial code and never write user code.Does anyone find this problem before?If you have any advice please teach me, thank you.
Hi,I am trying for a while now to configure a one pulse timer with cubeMX without success. I am using a nucleo-L433RC for my tests.I was able to make the one pulse work by manually configure it. I used the example of the L432KC in the package to do so. The function HAL_TIM_OnePulse_ConfigChannel seems to never be called with the cubeMX configuration.I followed several examples I found on the forum without success:https://community.st.com/s/question/0D50X00009XkXgN/retriggerable-one-pulse-mode-in-cubemxhttps://community.st.com/s/question/0D50X00009XkY3D/cubemx-and-one-pulse-modehttps://community.st.com/s/question/0D50X00009XkeN1/cubemx-support-of-one-pulse-modes-for-timershttps://community.st.com/s/question/0D50X00009XkXXV/tim15-pwm-ch1ch1n-one-pulse-mode-how-to-avoid-glitch-https://community.st.com/s/question/0D50X0000BFDrGpSQL/one-pulse-mode-input-can-not-be-driven-high-enoughThere is also an example with cubeMX on a F0 but the generated code from cubeMX in the example does not match
Hi All,I'm using an STM32F429ZIT6 (on a Nucleo-144), with PHY LAN8720A ethernet. The application base was generated by CubeMX, and it is using the HAL libraries. I'm using FreeRTOS threads, also for managing the ethernet and lwip stack.The Nucleo board is using an ethernet connection to send/receive data to the cloud, however after about 20-24 hours, the ethernet goes down, and the connection can only be recovered after a reset.The PHY interface (LAN8720A) is reporting a link down, though the ethernet cable is plugged in.The switch also shows a link up, up until that point when the netif_set_link_down() is called from ethernetif.c. From this point the link does not recover until a reset.Please advise what I should check to progress with the troubleshooting.Thank you!
CubeMX will not correctly re-generate code after changing STM firmware versions.I want to be able to modify my project's version of STM firmware throughout the course of development. For example, to pickup any upcoming bug fixes, or to point to a patched version. I also want to include STM FW by reference in our projects to reduce code duplication.Here are the steps to reproduce this issue:Create a project with these settings:Generate codeTrack output in version controlNote that code must be generated a second time to pick-up these additional unexpected changes.Change to another firmware version (e.g. V1.24.1)Run code generationI expect that all V1.25.0 instances would be changed to V1.24.1, but there are leftover uses:// test1.ioc // I believe this represent's the greyed-out setting in CubeMX (above where we can specify a custom firmware path). So this doesn't seem to be cause for concern. 8:ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.25.0 // .cproject // This appears to
Hello everyone! Is it possible to initialize an I2S interface using LL drivers?There is only one option in the CubeMX (project manager->advanced settings): HAL. Other peripherals (for example I2C, TIM, USART, SPI) have 2 options HAL/LL. Is it any sense to use LL with I2S at all?Thanks for response!
Hello.I found a bug in STM32CubeMX software which is briefly described above in the title.In the "Pinout & Configuration" tab, select SAI and enable itSet "Number of Slots" to 2Set basic parameters (other than "Output Mode") correctlySet "Output Mode" to "Mono"After setting "Output Mode", auto-calculated "Slot Active Final Value" is set to "0x00030000".This value is not valid and cannot be changed using the CubeMX software.So, you should modify the "Slot Active Final Value" by opening .ioc file in text editor or modify SlotInit.SlotActive value in the generated C source code.I found this bug affects many (presumably all) devices such as F446 and F767, and can be reproduced in many CubeMX versions including 6.0.0.
USART1 is configured using code generated by CubeMX to run at 9600 8N1 in FIFO mode with Rx FIFO threshold set to 7/8 full. Receive is done via interrupts into an 80-byte buffer and callbacks are used to transfer data out of the 80-byte buffer. Everything seems to run as expected here.Then I configure receive timeout and enable the interrupt. That's when I observe (using a GPIO toggle) the USART1 ISR running every 1.5 us or so even when no data is being received. When I break execution with a debugger, the overrun flag is set.Why is it that when receive timeout is enabled, I get rx overruns? I noted that the overruns start about 4 UART bytes after a call to HAL_UART_Receive_IT(). Without receive timeout interrupt enabled, the ISR runs every 7 UART bytes, which is expected for a 7/8 Rx FIFO threshold.This is using stm32h7xx HAL v1.6.0.Thanks! (code and scope trace are below)#define RX_BUF_SZ 80 static unsigned char rx_buf[RX_BUF_SZ]; static void MX_USART1_UART_Init(void) { huart1.Insta
Hello,I found in CubeIDE awesome feature, where it generate peripheral initialization as pair of ".c/.h" files per peripheral. So far, it works perfectly, but I noticed, that I can't anymore define user-code in some functions. For example:This is how FMC Init function looks like, when everything is in main.cBut when is code generated in separate .c / .h file, it doesn't have user-code regions:So, where should I put my code now? I know that I can make my own functions in those files and call them from main.c, but having user-code regions would be most elegant solution. Also, the other functions like "HAL_SDRAM_MspInit" have user code regions. Any ideas?Thanks.EDIT: Also, fmc.c miss USER CODE 1 region :(
I'm trying to add FATFS to by CubeMX project targeting the STM32F767 processor. Even though I've enabled the SDMMC1 interface the only FATFS mode I can tick is 'User-defined'. Why is the 'SD Card' greyed.
I did some modifications of several projects without relaunching STM32CubeMX. When I went back to the project that was the main focus everything except the .ioc file had been erased. No directories. No generated code. Nothing but a .ioc file! I restored from my github repo and continued. A week later I discovered that all the other repos in the git organization were in the same condition even though I had not accessed them. Just .ioc files remained.I am using Ubuntu 16.04.LTS, STM32CubeMX 6.0.1, Sublime editor, gcc, and each project is a git repository in a separate directory under the github organization. Very puzzling. The fact that only .ioc files remained suggests STM32CubeMX had something to do with it. Having more than one repo wiped out indicates that git might be involved. The Sublime editor seems unlikely to be involved.Less dramatic, I have had other occasions where after doing a code generation STM32CubeMX has to be relaunched to get the gpio pin tab to show up in some of th
I am writing a simple code. Receiving ADC data from I2S3. (ADC is PCM1808 and 96kHz Stereo 24bit in 32bit frame, I2S Philips)Buffers: uint16_t ADC_Data [BUF_LEN*2*2*2] ; // 16bit*2 * stereo * double buffer (I2S buffer)int32_t ADC1_Data[BUF_LEN*2*2] ; // (4byte) * stereo * double buffer (output data converted from 0-2^24 to +/- 2^23) After initialization, start I2S with DMA mode.HAL_I2S_Receive_DMA(&hi2s3, (uint16_t *) ADC_Data, (uint16_t) (BUF_LEN*2) * 4) ;Then, Callbackvoid HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef * hi2s3) { for (int i=0 ; i < BUF_LEN*2; i++) { ADC1_Data[i] = (((int32_t) ADC_Data[i*2] << 8) | ((ADC_Data[i*2+1] >>8) & 0x0FF)) - 8388608 ; // Adjust to zero (2^23) // ***** ADC_Data[i*2] does not load correct value (or from wrong Address, I suppose.) } ADC1_ptr = BUF_LEN*2 ; //***** After return from callback, Hard fault occurs. (DMA Xfer Error)}Code is Simple, and I do not find any trouble in Sending Data with I2S or
Hi, I'm using CubeIDE 1.4.2 with CubeMX 6.0.1-RC3 and target is STM32L452.This problem only occured with VDDUSB independent from VDD.I had problems with USB FS device initialization (using CDC class but I guess it applies to other classes as well).The problem was that after boot, when calling MX_USB_DEVICE_Init() with VDDUSB not present (usb not plugged in), the program was endlessly interrupted and stuck in USB_IRQHandler(), after calling USB_DevInit() in HAL_PCD_Init() in the file stm32l4xx_hal_pcd.c.The problem never occured when VDDUSB was present (usb plugged in).Here's the call hierachy :Reading the Reference Manual RM0394, it's mentioned page 137 : As specified in the title, MX_USB_DEVICE_Init() never follows this sequence before removing the power isolation by setting the USV bit in PWR_CR2 by calling HAL_PWREx_EnableVddUSB(). The PVMO1 bit is never checked, which surely caused problems in further USBD initialization.Call hierachy : Checking if VDDUSB is present before calling
Using CUBEMX 6 to configure the two comparators in STM32L053 in window mode this initialization code is generated:COMP_HandleTypeDef hcomp1; COMP_HandleTypeDef hcomp2; /* COMP1 init function */ void MX_COMP1_Init(void) { hcomp1.Instance = COMP1; hcomp1.Init.InvertingInput = COMP_INPUT_MINUS_DAC1_CH1; hcomp1.Init.NonInvertingInput = COMP_INPUT_PLUS_IO1; hcomp1.Init.LPTIMConnection = COMP_LPTIMCONNECTION_DISABLED; hcomp1.Init.OutputPol = COMP_OUTPUTPOL_NONINVERTED; hcomp1.Init.Mode = COMP_POWERMODE_ULTRALOWPOWER; hcomp1.Init.WindowMode = COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON; hcomp1.Init.TriggerMode = COMP_TRIGGERMODE_IT_FALLING; if (HAL_COMP_Init(&hcomp1) != HAL_OK) { Error_Handler(); } } /* COMP2 init function */ void MX_COMP2_Init(void) { hcomp2.Instance = COMP2; hcomp2.Init.InvertingInput = COMP_INPUT_MINUS_IO1; hcomp2.Init.NonInvertingInput = COMP_INPUT_PLUS_IO1; hcomp2.Init.LPTIMConnection = COMP_LPTIMCONNECTION_DISABLED; hcomp2.In
STM32CubeMX in version 6.0.1 does not generate the necessary alternate function for PE6 and TIM9_CH2 correctly for STM32L151QC. The datasheet states that this should be alternate function 3. A look into the relevant GPIO-STM32L162xD_gpio_v1_0_Modes.xml file reveals that the signal description for TIM9_CH2 is missing for GPIO pin PE6.
..
I'm creating a STM32Cube project, for the STM32H7B3I-DK. When selecting CMSIS Core and DSP in CubeMX, via Software Packs, then click ok, save, generate code, nothing happens. CMSIS or DSP lib aren't added. No module appears in the Software Package section of the .ioc editor.If I close eclipse and open it again, the selected package sections are gone, not saved with the project.STM32CubeIDE Version: 1.4.2STM32CubeH7 Firmware Package V1.8.0 / 29-May-2020CMSIS Release version : 5.7.0 Release date : 2020-04-09
Dear TeamFacing a problem with the STM32CubeMx generated code for the SDIO interface when FreeRTOS CMSIS_v1 is enabled. Without FreeRTOS SDIO communication works fine.We use the FatFS library for file handling operation and DMA is enabled. Whenever the program runs, the f_mount function fails. It returns error code 3 - FR_NOT_READY.Few details,Target - STM32F407vetSTM32CubeMx - 6.0.1STM32CubeIDE - 1.4.0STM32CubeF4 Firmware Package - V1.25.0 12-February-2020CMSIS
Hi,I am attempting to communicate with a LAN9252 via QSPI and had success in a polling mode. I've attempted to do the same thing with MDMA setup in the CubeMX, all default settings, and was unable to achieve communciation. From the use of HAL_QSPI_Receive_DMA, the SPI peripheral got stuck in HAL_QSPI_STATE_BUSY_INDIRECT_TX. Is there a tutorial of some sort I can refer to for properly setting up the MDMA controller? Thanks a lot.
Hi!I trying to follow this manual to set upp a HTTPD web server in STM32 Nucleo H7 board. But I got a issue because fsdata_custom.c is missing and it seems that I cannot set HTTPD_USE_CUSTOM_FSDATA to false neither. Is this a bug in CubeMX?How can I solve it? I posted a screen shot and it will give you all the information about my board I'm using.
Dear ST hello,I am working on SPI communication between two boards, of two different companies.TMS320F28397D of TI and STM32F429 of ST.My question is about the SPI configuration in CubeMx, should I chose the Frame format TI?2/When I chose The TI configuration CubeMx don't accept this frame? should I download any framework to let CubeMx accept this chose?The issue is I am always receiving 255 side TI.Thank you in advance,S.Tarik,
Dear ST Hello,I couldn't understand why I couldn't set and reset the PB4 GPIO. I am trying to visualize the GpIO signal using an oscilloscope.I am using CubeMx for this projectI am using this GPIO for CS with SPI3. HAL_GPIO_WritePin(SPI3_CS_GPIO_Port, SPI3_CS_Pin, GPIO_PIN_RESET); status = HAL_SPI_TransmitReceive(&hspi3, (uint8_t*)aTxBuffer, (uint8_t *)aRxBuffer, BUFFERSIZE, 5000); HAL_GPIO_WritePin(SPI3_CS_GPIO_Port, SPI3_CS_Pin, GPIO_PIN_SET);Thank you in advance S.Tarik
When selecting COMP3 or COMP4 as clearing source for OC channels 3 or 4, the LL call required to set the clearing source is not emitted. It works with HAL and when using different combinations of channel and comparator output. The behaviour applies at least to TIM1 and TIM8. It doesn't make a difference whether the comparator is configured or not. I attached an .ioc file which shows the behaviour in both CubeMX 6.0.1 and CubeIDE 1.4.1.
I have a project using STM32G031G6Ux(UFQFPN28), so in CubeMX I could not find the external crystal oscillator pins.So I want to know that whether this MCU has the pin to connect external crystal oscillator?Dose there have any documents about the design about this MCU,thanks.
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.