Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
In a STM32 project using FREERTOS with CMSIS V2, there is not automatic generation of thread creation calls in main function, likedefaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);Is it supposed to be the programmer who now has to add these instructions, or can STM32CubeIDE be instructed to generate this code automatically, as in previous versions?
I am using custom designed board having STM32H745BIT6 and 25MHz external crystal with LDO Only as Power Selection from RCC settings.I am trying to check UART4 with pins PC10 and PC11 and flow control disabled.So Transmission is working well using Polling and Interrupt mode but reception is not working when using Interrupt or DMA mode. Reception is working in Polling mode.Attaching .ioc file for reference.Please check and suggest a way to resolve this issue.
STM32CubeIDEVersion: 1.9.0Build: 12015_20220302_0855 (UTC)Processor: STM32H7My issue is when i start debugging my project, it crashes while configuring my System Clock Config, but there is no real error. The debug just says "Target Lost" and tries to reconnect but cannot. It always crashes at lineMODIFY_REG(RCC->CFGR, RCC_CFGR_SW, RCC_ClkInitStruct->SYSCLKSource);What is interesting is it works fine on my nucleo (STM32H743) but not on my board I layed out. So that would seem to point to a hardware issue on my side, but what could that be? I tried pulling the crystal (x3) off the nucleo just to see if it would cause the same problem, it still runs (granted the application part doesnt but thats to be expected). Anyone seen this issue before?
void Tcp_Task(void const * argument) { /* USER CODE BEGIN Tcp_Task */ struct netconn *conn, *newconn; err_t err, accept_err; struct netbuf *buf; void *data; u16_t len; LWIP_UNUSED_ARG(argument); conn = netconn_new(NETCONN_TCP); if (conn!=NULL) { // netconn_bind(conn, NULL, port 번호) err = netconn_bind(conn, NULL, 5001); if (err == ERR_OK) { netconn_listen(conn); while (1) { accept_err = netconn_accept(conn, &newconn); if (accept_err == ERR_OK) { while (netconn_recv(newconn, &buf) == ERR_OK) { HAL_GPIO_WritePin(GPIOK, GPIO_PIN_3, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOK, GPIO_PIN_5, GPIO_PIN_SET); osDelay(100); HAL_GPIO_WritePin(GPIOK, GPIO_PIN_3, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOK, GPIO_PIN_5, GPIO_PIN_RESET);
Hello!i am working with the STM32H747, i have a cubeMX generated project which uses LWIP for ETH connection and managment.I've encountered an issue - i have a LWIP tcp server, which connect clients and runs properly. when i disconnect the ethernet cable with out disconnecting rom client first i am not able to recover connection after the cable is reconnected. the only thing that works is restating and this is not an option.Please advise on possible ways to resolve this issue :)thanks
Hello everyone.Is there a way to generate the report files (pdf and txt) from command line in CubeMX?I run STM32CubeMX in command-line mode getting commands from a script,but I didn't find any commands about report generation in the command line summary table.Greetings
Using an STM32L562Q part: configured the clock tree to use LSI, MSI, and HSI48 internal clocks. Odd that RCC_OscInitStruct.OscillatorType = 0x3CCode generator is setting RCC_OSCILLATORTYPE_LSE as one of clocks to init but I don't have an external LSE crystal. When main calls the clock config, it executes this code: /* Set the new LSE configuration -----------------------------------------*/ if ((RCC_OscInitStruct->LSEState & RCC_BDCR_LSEON) != 0U) { if ((RCC_OscInitStruct->LSEState & RCC_BDCR_LSEBYP) != 0U) { /* LSE oscillator bypass enable */ SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); }Code then fails 5 seconds later when the non-existent LSE doesn't come ready: /* Check the LSE State */ if (RCC_OscInitStruct->LSEState != RCC_LSE_OFF) { /*
Hello everyone. For some days I have been trying to solve a problem that occurs in CubeMX when generating the code for STM32CubeIDE. I state the following:1) The error occurs both when starting from a new project (from STM32CubeMX or STM32CubeIDE) and when importing an already made one.2) The error occurs only with the generation of the code for STM32CubeIDE, while with all the other IDEs the procedure is successful.3) The error occurs with the two attached pop-ups4) The Driver folder is generated incompletely and no Middleware and STM32CubeIDE projects are generated.Finally, just to complicate things:5) The error occurs on systems based on OpenSUSE Leap 15.3.6) The error does not occur on an Ubuntu 20.4.4 LTS machine.Some idea? Has anyone experienced the same problem?Greetings
If I open cubemx using the terminal., I can find log messsge like: ThirdPartyUpdaterWithRetryManager:70 - Updater plugin not ready yet. [12/15]. Finally, cubemx reports IntegrityCheckThread:98 - exiting critical section [integrity check]. And It was stuck on the cover of cubemx.PS: I using Apple M1 Pro on macos 13.0.1 (22A400)
..
Hi all,I'm currently working on a GPS tracker module with STM32F446RE. We have the whole GPS feature done but now we are trying to implement communication.When it comes to sending messages (SMS) or doing phone calls everything is fine. But now we want to do some secure connection to AWS server. They require TLS 1.2 so we can't use our module to communicate with AWS.So far so good, we just need to use lwip + mbedtls with our board! But CubeMX does not allow us to do so because we don't have Ethernet, that firstly seems logical, but we want to do PPP over serial, so we don't need (and don't have anyway) Ethernet enabled.So that is our first problem; the second problem we are facing is that we can't find any good resources or example for the use of lwip (ppp os) + mbed tls + stm32. Does any one have an example of lwip working with pppos and also using Mbed TLS ? If one would only have an example working with lwip and pppos that would be wonderful and would help us advance in the project.R
I am trying to use STM32F401 and FT811. I still can't read REG_ID for about 1 month. I usually get values 0x42 and 0xFF when I try to read. As I do not have a Logic Analyzer, it is not possible for me to check the lines at the moment. I can't understand where I went wrong. I would be very happy if you could help with this. Thanks in advance.
I am using an STM32H7 (though this would apply to any other STM32 with different RAM sections) and want to put the Stack in the fast DTCMRAM section, while freeing up the D1RAM for the Heap.This did in fact work with the old toolchain of GPDSC, but not with the current CUBE-IDE Toolchain.The symptoms are: in __libc_init_array the program hits an exception and hangs up while trying to get the new handler.The base of the problem seems to be: In the sysmem.c -> function _sbrk the max_heap and the stack_limit are associated. This is kind of useful when both are in the same section, but does not let the program use separate sections.Since that file is cube-mx generated, a custom implementation of the sbreak routine does not look like a good practice, since it would get overwritten on each generation.Is there another way to achieve this separation of heap and stack? Best Regards,Jan
I've a question related to how AWD works in case of STM32G030 controller. As per my understanding, AWD analog watchdog status bit is set if the analog voltage converted by the ADC is below a low threshold or above a high threshold. These thresholds are programmed in the 12 least significant bits of the ADC_HTR and ADC_LTR 16-bit registers. An interrupt can be enabled by using the AWDIE bit in the ADC_CR1 register. However, STM32Cube IDE doesn't allow to configure low threshold value other than 0 and according to parameter description "low threshold value must be set to 0". In that case how STM32G030 generates an interrupt if it goes below 2.5V?
If I look at the STM32F410RB datasheet on page , I can see the following pin name:PB13 - I2C4_SMBAPB14 - I2C4_SDA (FM+) used for Fm+ mode (1MHz)PB15 - I2C4_SCL (FM+) used for Fm+ mode (1MHz)So far, so good, but when I try to configure these pins in the STM32CubeIDE, I can only see they are named:PB13 - FMI2C1_SMBAPB14 - FMI2C1_SDA used for Fm+ mode (1MHz)PB15 - FMI2C1_SCL used for Fm+ mode (1MHz)In the datasheet, I2C1 and I2C2 have speeds up to 400kHz, whereas I2C4 is the 1MHz (Fm+) bus which I want to use in my application.When I generate the code STM32CubeIDE, it also generates pin names with I2C1 in it.Can I still use these pins, or are the pin names in the STM32CubeIDE a bug, that I will have to correct manually?
Cube mx is generating this order of init code.Stm32cube ide 1.9.0stm32cubeh7 1.10.0
I am using cubeMX and I wonder how to set I2C fast mode plus(SCL 1Mhz) in cubeMX.If it is not possible to set it in cubex, I wonder what the other way is.
Dear ST,I was not able to find any documentation for composite builder feature of your USB MW library. Is it documented somewhere?I was able to get USB composite device running after enabling USE_USBD_COMPOSITE define. But I had to fix some bugs, that possibly exist in the library and there are still more issues to solve.When will STM32CubeMX tool support USB composite devices?kind regards,Tomasz
Dear All,I have a nucleo-l010rb board and I am generating a code to read 24C512 EEPROM on I2C. I have tried CubeMX Firmware Version 1.12.1 and 1.11.3. When I generate the code for the IDE default PA9 and PA10 following is the HAL_I2C_MspInit function generated in stm32l0xx_hal_msp.c file.void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c) { GPIO_InitTypeDef GPIO_InitStruct = {0}; if(hi2c->Instance==I2C1) { /* USER CODE BEGIN I2C1_MspInit 0 */ /* USER CODE END I2C1_MspInit 0 */ __HAL_RCC_GPIOA_CLK_ENABLE(); /**I2C1 GPIO Configuration PA9 ------> I2C1_SCL PA10 ------> I2C1_SDA */ GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStruct.Alternate = GPIO_AF6_I2C1; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); /* Peripheral clock enable */ __HAL_RCC_I2C1_CLK_ENABLE(); /* USER CODE BEGIN I2C1_MspInit 1 */ /* USER
Hello,I use CubeMx (6.6.1), STM32F411CCUxCubeMx causes a problem when 'PB4' pin and JTAG (4 pin) are used together.If JTAG (4pin) is set in CubeMx, PB4 is not used.If i set something in PB4, JTAG is released. In the datasheet, PB4 and debug have nothing to do with it.What should I do...Thanks for reading.
Hi,I'm using STM32Cube to configure an STM32U575. I'm trying to configure the ADC4 so that oversampling is used. I need to set the Sequencer option to "Sequencer set to not fully configurable" so I have access to the additional channel inputs (IN15, IN16). However, when I set the Oversampling Mode to "Enabled", there is no way to set the Oversampling Ratio value. Only the Oversampling Right Shift value can be set. If I change the Sequencer option to "Sequencer set to fully configurable", the Oversampling Ratio option appears.I can't find anywhere in the reference manual as to why the Oversampling Ratio value can't be set when in this configuration. Can someone help me understand why this option isn't available?
In STM32CubeMX clock schematic and in the clock schematic of the reference manual CK_PWR is mentioned. It is never explained what it does and what it is for.I'd like to know what it is for and how it affects current consumption (since it is before the AHB prescaler).
In adc.c (HAL driver), line 89 there are wrong constants generated:LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_PATH_VREFINT|LL_ADC_PATH_TEMPSENSOR);correct is:LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_PATH_INTERNAL_VREFINT|LL_ADC_PATH_INTERNAL_TEMPSENSOR);
The ADC and SPI use the DMA, but the CubeIDE initialize the DMA at last ant the SPI initialization fails. See screenshot.CubeMX Version 6.6.1Please fix this mistake. Attachment, the Screenshot.The second problem: I cannot chage the "Rank" order from initialization.The correct rank will be:first "SystemClock"second "GPIO"third "DMA"then the rest.Other controllers like STM32G484 is the CubeMX code generation correct.
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.