Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi,I was playing around a bit with the clocks.I had it set up to run on 48MHz from MSI.I then choose PLL on 64MHz but couldn't get the 1µs timer pulse I wanted (prescaler on 63 for TIM2 got me something about 1,178µs)I then wanted to get back to MSI, but configuration tool found an issue with RCCFlash latency is marked as a problem with 3 waitstates.I can do nothing about it since its greyed outany idea how I can get back to 48MHz MSIcheers,Bob
Update 4:The definition of these variables was missing (FW_F4 1.25.0), the generated code did not insert this part:File Src/lwip.c (line 58)void MX_LWIP_Init(void) { /* IP addresses initialization */ IP_ADDRESS[0] = 192; IP_ADDRESS[1] = 168; IP_ADDRESS[2] = 1; IP_ADDRESS[3] = 111; NETMASK_ADDRESS[0] = 255; NETMASK_ADDRESS[1] = 255; NETMASK_ADDRESS[2] = 255; NETMASK_ADDRESS[3] = 0; GATEWAY_ADDRESS[0] = 192; GATEWAY_ADDRESS[1] = 168; GATEWAY_ADDRESS[2] = 1; GATEWAY_ADDRESS[3] = 1; /* Initilialize the LwIP stack without RTOS */ lwip_init();Update 3:STM32CubeMX version 5.6.0 (FW_F4 1.25.0) did not work.STM32CubeMX version 5.5.0 (FW_F4 ?) did not work.STM32CubeMX version 5.4.0 (FW_F4 1.24.2) worked.STM32CubeMX version 5.2.0 (FW_F4 1.24.1) worked.STM32CubeMX version 4.27.0 (FW_F4 1.19.0) worked.STM32CubeMX version 4.22.0 (FW_F4 1.16.0) worked.Update 2:I downloaded STM32CubeMX version 5.2.0 (FW 1.24.1) and it worked.STM32CubeMX version 5.6.0 did not work.I imported the
Getting started...I've installed STM32Cube MX 6.0.1 and IDE 1.4.2, and STM32L476 Package has been downloaded/installed (stm32cube_fw_l4_v1160.zip).When I go into the project examples in the package and try to open them they:1) have EWARM and MDK-ARM folders that aren't for MX/IDE2) have SW4STM32 folder that sort of works with IDE, but doesn't have ioc file for mx3) convert when I open .project file implying they are created with something other than latest IDEQuestions:a) Are there any examples actually created in recent STM32CubeMX/STM32CubeMX?b) If not how can I create .ioc file from the project examples that do exist, so I can evaluate the configuration settings, check/modify pinouts, and otherwise usefully mess with the examples.Paul
STM32CubeIDE v1.4.2STM32F4 v1.25.2STM32F446RCI generated my code and got this:RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;The HSE crystal is never turned on anywhere. Big bug.I change this to:RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; //RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;And now my USB finally works. =)HSE is configured in RCC as "Crystal/Ceramic Resonator". I have not added anything to the code. I can send you files if that would help.
It looks like a simple refactor bug. The ethernet_link_check_state function includes the line: struct netif *netif = (struct netif *) argument;but argument does not exist and netif is the name of the function argument. I assume a previous version had argument passed in as a void*. Deleting the line seems sufficient to fix it. Is there a way I can fix it so that it persists across a regeneration?
HiI'm currently using STM32CubeMX for STM32H743ZITx.However, I can't enable LWIP function. (Categories -> Middleware -> LWIP)Previously on STM32F429, I could use LWIP, but I can't even enable the function on this series.Can anybody help me with this?Thank you in advance.
I'm configuring an STM32G474VEH and I right clicked on pin PA3 and I get the attached popup dialog.The datasheet has OPAMP1_VINM / OPAMP1_VINP / OPAMP5_VINM.How do these each of these three items map to the entries in the list below?
Hello,In a project, we are using a STM32 and an Octavo (AM335x). Both are connected to a Microchip KSZ9567R Ethernet Switch.The Ethernet Switch has only one MIIM interface, and I guess I can't connect together STM32 MIIM and Octavo MIIM on this single switch MIIM Interface. The solution seems to use instead the switch SPI or I2C interface.But in CubeMX it seems the use of the STM32 MIIM interface is mandatory...How can I disable it ?Many thanks and best regards
New version STM32CubeMX v.5.2.0 "Project Manager" -> field "Firmware package" is not working properly if I choose older version package. The field "Firmware Package Version" shows only v1.24.0 and v1.24.1 although I am using v1.23.0 because new versions break down USB port registration (that's another problem : new library is not compatible with previous APIs). So I uncheck "use the latest firmware" and uncheck "use default Firmware location> Now it allows me to choose my library. So I choose v1.23.0 ... Now I see it only in "firmware location" field but "firmware package version" field still shows only the latest version (did not change to reflect my choice).Now I generate the project and compile it. Shows error "stm32xx_hal_exti.h: No such file or directory". Indeed there is no such file in v1.23.0 library. Yet why was included in the new generated stm32xx_hal_conf.h file ? Because somehow it was generated according to a new v1.24.1 library , included stm32xx_hal_conf.h file ,
Hi,I´ve just did some tests with my new F429ZI board. See bellow:1) Use cubeMX and cubeIDE to generate and test a RTOS with Thread example: OK2) Use cubeMX and cubeIDE to generate and test a LwIP example. NOKI could only ping the board after include the code "MX_LWIP_Process();" in the main loop.3) Now I´m trying an example with RTOS and LwIP. I inicialized the board selector to F429ZI and accepted the default values to the peripherals. And configure "Time base" of SYS to use TIM3. Increase the minimum heap size to 0x10000. Disable PB0, disable PA8 to PA12. 4) I configured FreeRTOS with CMSIS_v2. I´ve read to change the size of the default stack size to 256 words. So I tested with this value and with 128 words. 5) I configured enabled LwIP and configure it to static IP and to use DHCP. So I generated the code. I CubeIDE the code compile and run. But I can´t ping an IP address. Can anyone give me a hint? Or can suggest any tutorial to configure LwIP and RTOS with this board?I´ve attache
I am a new user of STM32CubeIDE using a NUCLEO-STM32WB-Nucleo board. I want to build an empty project using enabled BLE components using the STM32-WPAN pack version 1.9.0.After selectint RTC, HSEM and RF1 in addition to the default settings plus enabling the WPAN middleware (all default) it autocreates the code files. When I build the project I can reproducibly get the following error:arm-none-eabi-gcc "../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32WB55xx -c -I../Core/Inc -I../Drivers/STM32WBxx_HAL_Driver/Inc -I../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32WBxx/Include -I../Drivers/CMSIS/Include -I../STM32_WPAN/App -I../Utilities/lpm/tiny_lpm -I../tiny_lpm -I../Middlewares/ST/STM32_WPAN -I../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread -I../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl -I../Middlewares/ST/STM32_WPAN/interface/patterns/ble_threa
HelloI am using STM32CubeIDE 1.0.2 with CubeMX.Hardware: STM3240G-EVAL (Evaluation board with STM32F407IG)I have to use RS485 in the program.In CubeMX in UART options, I do not see the option "Hardware Flow Control (RS485).On the video https://youtu.be/x0p2p9RLtkA?t=60 I can see that there is such an option in CubeMX at UART. Can I turn it on somehow? Can I use CubeMX to generate the code for rs485? If so, in what way?
I want to enable RTC WKUP interrupt, so that I can use it later to wake the device up from sleep modes.Nevertheless, CubeMX will also add HAL_RTCEx_SetWakeUpTimer_IT in init. I don't want to launch the timer in init! I only want to set it up for later use (setup interrupt handlers, NVIC enable).Is this call 100% necessary? Why CubeMX generates it in init?What does it mean if WakeUpCounter parameter to this call is 0?
What has TIM6 to do with this? I do use it for System Core, SYS, Timebase Source. Why can I not disable the global underrrun interrupt? I use DMA for ADC1 and 2 and BDMA for ADC3.At startup HAL_DAC_IRQHandler gets called, DAC_FLAG_DMAUDR1 is set and hdac->State is assigned HAL_DAC_STATE_ERROR which in turn prohibits proper initialization in HAL_DAC_Init and HAL_DAC_SetValue will not work.
Hello, is it possible to add a feature in CubeMX deadtime section in HRTIM (STM32F3, STM32G4 and STM32H7)?In Time Base Setting, whenever you change the "Period" setting, the resulting frequency will show.Is it possible to add the same feature when you change the Rising/Falling value and will show how much time it consumes?
I have attached a screenshot of a comparison of a project that works (an old one that I created previously in an older version of STM32CubeMx) on the left hand side of the window versus one I just created today using the most recent version of STM32CubeMx (right hand side). Any idea why the project is not exporting to Keil correctly? I have uninstalled STM32CubeMx and reinstalled. I have also installed the latest STM32Cube MCU Package for the STM32F4 Series (1.25.1) .
I am using STM32F767NIH6 board.I would like to apply SD card this time.It works well in non os, but in free rtos, the sd card fails.if(HAL_GPIO_ReadPin(SD_DETECT_GPIO_PORT, SD_DETECT_PIN) == 0){ if(f_mount(&SDFatFS, (TCHAR const*)SDPath, 0)!=FR_OK) printf("mount err\r\n"); else { printf("mount ok\r\n"); if(f_open(&SDFile, "test.txt", FA_CREATE_ALWAYS | FA_WRITE) != FR_OK) { printf("Failed to open Write file\r\n"); } else { printf("Opened Write file successfully\r\n"); //Write data to text file res = f_write(&SDFile, wtext, strlen((char *)wtext), (void *)&byteswritten); if((byteswritten == 0) || (res != FR_OK)) { printf("Failed to write file!\r\n"); } else { printf("File written successfully\r\n"); printf("Write Content: %s\r\n", wtext); } f_close(&SDFile); } f_open(&SDFile, "test.txt", FA_READ); memset(rtext,0,sizeof(rtext)); res = f_read(&SDFile, rtext, sizeof(rtext), (UINT*)&bytesread); if((bytesread == 0) || (res != FR_OK)) { printf("Failed to read fi
I noticed that my .text section gets mapped at one of two different addresses depending on my build. In one instance the hex file had a small (8 byte) gap in it which was causing some issues with some hex file parsing that I do. I've since worked around that, but now I'm curious as to the root cause.I've been able to reproduce the two different results by commenting out a single print statement. I'm not an expert with linkers so I was hoping someone could help:Explain why this might happen?Suggest what I could do to ensure no gap in the hex fileThis is on an STM32F3, using the CubeMX generated System Workbench project. Here's the relevant part of the linked script (the .ld is unchanged from the auto generated one) and the relevant sections of the two resulting .map files./* Define output sections */ SECTIONS { /* The startup code goes first into FLASH */ .isr_vector : { . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); } >FLASH /* The program code an
Dear Friends.Can someone explain the warning in the picture attached?If I change the "Clock and chip enable" parameters, the warning keep on.Best Regards.Thank you!
when I run the CAN module in loopback mode - packets transferred to the bus - everything is OKwhen I run the CAN module in silent mode I will receive packets - everything is OKbut when I start the CAN module in normal mode - 15 pulses go out on the TX pin and everything stops ... packets are not transmitted ...what am I doing wrong???I generated the start configuration using:STM32CubeMX 5.6.1Firmwere STM32Cube FW_F1 V1.8.0Atollic TrueSTUDIO Version: 9.3.0 Build id: 20190212-0734I've been in conjunction with both ISO1050 and MCP2551 ...I looked at the bus using a Chinese logic analyzer ....connected to the parallel of RX and TX pinsCode:/* Private define ------------------------------------------------------------*//* USER CODE BEGIN PD */#define TxBroadcastVoltagIdentifier 0x5FF400C#define TxDeviceRegistrationFeedbeckIdentifier 0x5004804#define TxSetDefaultVoltageIdentifier 0x5FF400C/* USER CODE END PD *//* Private variables ---------------------------------------------
Reported here, and was directed to this sitehttps://github.com/STMicroelectronics/STM32CubeH7/issues/54
Hi, I am using STM32F746 discovery board and I generated code using STM32CUBEM MX. I just enabled external crystal as clock and UART. My .text session code size is 10188 bytes which is like 10KB. I wanted to add this code as bootloader but I feel 10KB size just for HAL library initialization is too much.Does generally STM HAL take this much size or I made any mistake? This is for my bootloader code so I don't want to give so much space to it.Thanks
I have been experimenting with adding the USB DFU to firmware using the Stm32CubeMX. On both a "black pill" STM32F411 and a home made STM32F405 board, pulling boot0 high during reset, the device will show up as DFU and I can flash new firmware using something like:dfu-util -a 0 -s 0x8000000 -D c13blink.bin(from Linux. IF I include the DFU in the firmware, the USB device enumerate correctly and show up as:Bus 001 Device 106: ID 0483:df11 STMicroelectronics STM Device in DFU Modedfu-util -l reports:Found DFU: [0483:df11] ver=0200, devnum=106, cfg=1, intf=0, path="1-14.5.3", alt=0, name="@Internal Flash /0x08000000/03*016Ka,01*016Kg,01*064Kg,07*128Kg,04*016Kg,01*064Kg,07*128Kg", serial="387D326E3439"But if I try to flash - the same which worked with the internal bootloader - the result is:Opening DFU capable USB device... ID 0483:df11 Run-time device DFU version 011a Claiming USB DFU Interface... Setting Alternate Setting #0 ... Determining device status: state = dfuIDLE, statu
I am using NUCLEO-64 stm32f401 and had to replace the IC with a new one of the same type since the old one got damaged. After soldering the new IC I downloaded my l test code(LED Blinking) but the debugger stopped in HARDFAULT_HANDLER. None of my GPIOs are working. Should I should download a new boot loader or is it already built in to it. What are the procedures I should follow to make my Nucleo-Board working. Is there any material available which can help me through the procedure. Please excuse me , as I just started learning the board. Thank you in Advance.
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.