Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
condition 1. Start the STM32CubeIDE directly by mouse.(in windows 10 os)condition 2. Open the CubeMX software. Choose one project & click Code Generation. And wait for it finished then Click "open project" button. then the Stm32CubeIDE A.K.A eclipse Start.Condition2 the IDE look far more comfortable. Why? I want to get the same performance in condition 1. Any one can help me? Thanks a lot.above is condition 1: open IDE with mouse.above is condition 2: open IDE with CubeMX
Hallo,i dont unterstand how i can receive data in Spi Half-Duplex-Mode.My used Controller is STM32F446RET.STM32CubeMX is configured as followThats my Code: HAL_GPIO_WritePin(CS_GPIOxLib, CS_GPIO_PinLib, GPIO_PIN_RESET); status = HAL_SPI_Transmit(hspiLib, (uint8_t*)&register_Address_calculation, 1, 10000); status = HAL_SPI_Receive(hspiLib, (uint8_t*)Value, 1, 10000); if(status != HAL_OK) { Error_Handler(); } HAL_GPIO_WritePin(CS_GPIOxLib, CS_GPIO_PinLib, GPIO_PIN_SET);A Logic Analyser shows that there are same Errors on the SPI when i try to receive.But when i changedhspi3.Init.Direction = SPI_DIRECTION_1LINE;to hspi3.Init.Direction = SPI_DIRECTION_2LINES;the SPI looks better:Is this wrong implemented by STM32Cube?When i changed my Code back to hspi3.Init.Direction = SPI_DIRECTION_1LINE;&HAL_GPIO_WritePin(CS_GPIOxLib, CS_GPIO_PinLib, GPIO_PIN_RESET); status
Hi TeamUART DMA not works with STM32F767ZI and STM32F745VE.It does not transmit or receive data.Testing same code with STM32F405 and STM32G474, UART DMA works fine.Does anyone know why UART DMA doesn't work on STM32F?Is there anything to be care of RAM setting when use UART DMA?My dev. environment:STM32CubeIDE Ver1.8.0FW Package Ver: FW_F7 V1.16.2Below is my test code.※This code will not work unless the DMA and UART interrupts are enabled.main.c/* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ #ifdef __GNUC__ #define PUTCHAR_PROTOTYPE int __io_putchar(int ch) #define GETCHAR_PROTOTYPE int __io_getchar(void) #else #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) #define GETCHAR_PROTOTYPE int fgetc(FILE *f) #endif /* __GNUC__ */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private va
I am trying to add FreeRTOS support in an STM32CubeMX project, and import into Rowley CrossStudio.In CubeMX, I have tried all toolchains, and then import them into CrossStudio.But none of them works, and I get a ton of compiler errors.When generating an STM32Cube IDE project (GCC/Eclipse), and import into CrossStudio, I get problems with newlib library, which are impossible to solve.Has anyone experience with generating a CubeMX project with FreeRTOS enabled, and import into Rowley CrossStudio?I have made projects without FreeRTOS support, and importing into CrossStudio works fine.But when adding FreeRTOS, things gets messy...Thanks !Kaare
The PB7 pin is set as GPIO_EXTI7 and TIM17 is enabled for PWM output. In the generated code, the IRQ routine is generated wrongly as follow:void EXTI9_5_IRQHandler(void) { /* USER CODE BEGIN EXTI9_5_IRQn 0 */ /* USER CODE END EXTI9_5_IRQn 0 */ HAL_GPIO_EXTI_IRQHandler(TIM17_BUZZER_Pin); /* USER CODE BEGIN EXTI9_5_IRQn 1 */ /* USER CODE END EXTI9_5_IRQn 1 */ }
When I generate the code, Cube MX generates interrupt handler for EXTI9_5 and it is like that: /* USER CODE END EXTI9_5_IRQn 0 */ HAL_GPIO_EXTI_IRQHandler(DIN2_Pin); /* USER CODE BEGIN EXTI9_5_IRQn 1 */DIN2_Pin actually corresponds to PE8 and it is normal input not external interrupt source. I can easly workaround in this problem but I wonder it is mistake of Cube MX or it is normal? If it is mistake of Cube MX please correct it. If not please clarify me why PE8 send to IRQHandler instead of PD8 which is set to External interrupt source. Thank you very much in advance. Best Regards
STM32CubeMx will generate the code as below.HAL_GPIO_EXTI_IRQHandler (GPIO_OUTPUT_PA0_Pin);But I want it to be generated as follows:HAL_GPIO_EXTI_IRQHandler (PB0_EXTI0_Pin);orHAL_GPIO_EXTI_IRQHandler (GPIO_PIN_0);The user label of the pin assigned to the interrupt is replaced with the user label of another pin.
Processor STM32G473VET, for MDK-ARMThe generated code in stm32g4xx_it.c under EXTI2_IRQHandler() and EXTI15_10_IRQHandler() is passing the incorrect ***_Pin defines to HAL_GPIO_EXTI_IRQHandler(); I believe the port index number may be correct, but the signal is from the wrong port.e.g.,Only one of these signals is actually configured as interrupts in CubeMX, however each is on the same index as a configured interrupt on a different port (given the interrupt limitations of 1 per index across all ports, I think this code may actually function). HAL_GPIO_EXTI_IRQHandler(M1_FAULT_N_Pin); HAL_GPIO_EXTI_IRQHandler(M2_TEMP_FB_ADC_Pin); HAL_GPIO_EXTI_IRQHandler(SPI_SCK_Pin); HAL_GPIO_EXTI_IRQHandler(WAKEUP_Pin); HAL_GPIO_EXTI_IRQHandler(OSC32_OUT_Pin);
Hi Folks, Currently Stm32CubeMx Generator for STM32L151 creates an "LL_SPI_SetStandard" call in spi.c which is not available for that device. That seems to be a bug here.
I tested it with CubeMX version 6.2, 6.3 and 6.4, they all work up to STM32CubeF7 Firmware V1.16.0, but not newer versions.See also: https://github.com/STMicroelectronics/STM32CubeF7/issues/63
What is new in STM32CubeMX V6.5.0? • Added the support for new part numbers in the STM32U5 Series: STM32U599NJHxQ, STM32U599BJYxQ, STM32U595ZJTxQ, STM32U5A9NJHxQ, STM32U5A9BJYxQ, STM32U5A5ZJTxQ and STM32U599NIHxQ. • Added the support for new part numbers in the STM32C0 Series: STM32C011D6Yx, STM32C011F(4-6)Px, STM32C011F(4-6)Ux, STM32C011J(4-6)Mx, STM32C031C(4-6)Tx, STM32C031C(4-6)Ux, STM32C031K(4-6)Tx, STM32C031K(4-6)Ux, STM32C031G(4-6)Ux and STM32C031F(4-6)Px. • Added the support for 2 new part numbers in the STM32F7 Series: STM32F723VCYxTR and STM32F723VEYxTR. • Added the support for the P-L496G-CELL01 and P-L496G-CELL02 Discovery kits. • Added enhancements of search criteria organized into categories, with more accurate commercial product information and with more specific documentation. • Added the support for LPBAM firmware for the projects without Arm® TrustZone®(a) (TZEN=0) in the STM32U575/585 product line This new feature allows the easy design of low-power projects based on
HelloI am new to STMCubeMX and am no expert at using the STM32 Nucleo boards.However I am keen to learn.I heard that the STMCubeMX software is a great place to start as it has a great GUI for configuring Pins on the MCU.I recently tried this app, as an experiment, trying to set up the MCU to have as many GPIO external Interrupts as possible.But found that I was limited to configure only a small amount of the PINS as Interrupts, and if i tried to set up any more, a conflict of GPIO_EXTl address would occur, which results in one of the PINS that has the same name automatically changing to its former designation.Does this make any sense to anyone.Would appreciate any help. Thanks
When I generate the code for a simple STM32U5x project with a USART configured and GPDMA configure for the USART TX and/or RX, the initialization code in MX_GPDMA1_Init() will be properly generated if I have my project to generate all the initialization code in main.c. However, if I change the project settings by enabling "Generate peripheral initialization as a pair of '.c/.h' files per peripheral", the resulting MX_GPDMA1_Init() found in gpdma.c will not contain any code, just comments.The work around it to manually add the necessary initialization code into one of the /* USER */ sections in MX_GPDMA1_Init().Hopefully this can be fixed in a not-too-distant future release.Thanks,Craig
Relevant information in the datasheets and reference manual (RM0454) is lacking and/or confusion, but that 128Mhz can be achieved is clearly stated (STM32G030): Cube also does allow for me to put in a 128 value for the ABP timer clocks (tested for both the STM32G030 and STM32G070), as shown below: But when I look at the generated code (for TIM1), there is no code change when compared to the version generated for a 64Mhz input value. Note that Cube is erratic after changing values in this area: sometimes it updates the code sometimes it doesn't. So my question is how to configure 128Mhz operation. Is it through the timer clock, or some center-aligned PWM configuration as suggested below: That's it. Here's some extra tidbits found (from the refman): From the datasheet:
It's not a big deal but this got me confused for a moment when I suddenly got compiler warnings.Steps to reproduce:Start a new project in STM32CubeIDEUse STM32L422RBI MCU, default settings, finishCubeMX: Enable SPI1 peripheral, Full-Duplex Master, default configurationCubeMX: Project Manager > Code Generator > Enable "Generate peripheral initialization as a pair of '.c/.h' files per peripheral"Save IOC, generate code, build project: observe 0 errors, 0 warningsNote that in Core/main.c, there is a line #include "spi.h"Open IOC in CubeMX againCubeMX: Activate QUADSPI peripheral, Bank1 with Single/Dual Lines, default configurationSave IOC, generate code, build project: observe 0 errors, 1 warning: "implicit declaration of function 'MX_SPI1_Init'; did you mean 'MX_GPIO_Init'? [-Wimplicit-function-declaration]"Observe that #include "spi.h" has been replaced by #include "quadspi.h"This can easily be fixed manually by adding the missing include below in the user includes but still, it s
It is a hardware limitation or bug in STM32CubeMX ?
After migrating a project to STM32CubeMX Version 6.4.0 / HAL 1.9.1or after creation of a new project using the latest version of STM32CubeMX 6.4.0. / HAL 1.9.1. an include for spi.h is missing, which produces a compiler error! In the previous version all was fine.Processor: STM32H7A3ZITxactivated port: SPI3 and some Timers, USART, CAN, etc.After Code Creation with the new release, a line is missing in main.h: #include "spi.h" Please forward this to your responsibles. Thank you.BR GS
When set TX Pin Active Level Inversion to Enable, CubeMX generate a wrong statment:LL_USART_SetRXPinLevel(UART4, UART_ADVFEATURE_RXINV_ENABLE);
Hello all !I try to develop some usb host application. Just for a test, I write simple code. In usb_host.c file under static void USBH_UserProcess (USBH_HandleTypeDef *phost, uint8_t id) function case HOST_USER_DISCONNECTION: Appli_state = APPLICATION_DISCONNECT; HAL_GPIO_WritePin(LED_GPIO_Port,LED_Pin,GPIO_PIN_RESET); break; case HOST_USER_CLASS_ACTIVE: Appli_state = APPLICATION_READY; HAL_GPIO_WritePin(LED_GPIO_Port,LED_Pin,GPIO_PIN_SET); break; When I insert my usb disk, I expected to see my on board led to be on and when I remove my usb disk, my board led will be off. But it doesn't work and I realized LD7 (usb power led) is being off small amount of time after I run the code. You can see my cubemx configuration and STM32F4DISCOVERY OTG schematic on below. I'm pretty sure that I correctly selected everything to run this app. USB_HOST library created by Cube MX, What could be wrong?? My Firmware package version FW_F4 V1.26.2 on cube mx
Hello.I want to use USB HS with the STM32H755ZI-Nucleo Board. I am using the USB3300 from Waveshare as an external USB HS-PHY.The USB3300 is connected to the ULPI Interface of the STM32 with the requiered 12 Signals. And the USB3300 provides a 60 MHz Clock.My question now is, how do I configure the RCC correctly? Should I use HSE in bypass mode? Is the 60MHz from the USB3300 then correctly provided to the STM32? Or do I need to solder a external oscillator with 25MHz that I use for the STM32 setup? Unfortunately I can not find any information on High-Speed USB other then connect them to the ULPI. I wanted to use a Clock Config like this: Right now I thought I can use HSE as BYPASS Clock Source, but the USB Communication is not working. So do I need to solder external Oscillator or is this Clock Config useable for USB HS? Thanks in advance,Alexander
I set the LWIP_HTTPD_MAX_TAG_INSERT_LEN = 2600 with big value. I know that my message will be about 1500 characters.But I get only 907 characters, the rest part of message are cut off!Could you tell me why my message cuts?
..
I'm learning the makefile that generated by cubeMX, but there are some parameters I can't understand.In the part that called "build the application", I saw:$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@I don't know what the parameters `-Wa` , `-a` , `-ad` and `-alms` mean. I checked the GCC manual, but only found the description of -Wa:-Wa,optionPass option as an option to the assembler. If option contains commas, it is split into multiple options at the commas.These cant help of my question.I realy want to know what do these four parameters mean.
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.