Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I have completed a design using STM32F303RE Nucleo-64 board. Using STM32CubeMX and SW4STM32 (IDE). My design is done, I have build the design and there are no errors. Now I'm ready to physically download and test the design. I realize one of the PINS that was selected needs to be changed. When I go back and make this change in MX, what will happen on the IDE side. Will the MX overwrite the older source files? Note, I started the design by selecting the MCU and not the EVAL Board.
I have a fresh installation of Windows 10 pro, so I need to install other things for STM, such as CubeMX. I downloaded from the site ver. 5.3.0 - installation was normal, but when I want to install FW packages for individual MCU series, I can't.Sometimes I do not know why it is possible to install and I have information on the list that a specific version is installed. It will restart the program and again nothing is installed. I changed the permissions for the Cube root directory, started the program as admin and nothing. Often an error appears as in the attached picture. Any sugestion how to handle with that problem
Hello everyone,I have a system with two STM32F446 which are connected over the USART2 interface to be able to communicate with each other. One of the STM32F446 is powered with 3V3 and the other one with 3V. I used CubeMX (version 5.3.0) to configure the USART mode as asynchronous. The GPIO's I would like to configure as alternate function push pull without any pull-up because of the different power levels. But in CubeMX I have to select a pull-up. Why I have to do this? How can I configure an asynchronus UART without pull-up on Tx line in CubeMX?
Hi all!I am wondering what possibilities (and how) there are when it comes to customizing the code generation from STM32CubeMX.I would like to be able to output the stuff that goes in /Src and /Inc to another folder instead in order to keep my project structure clean and dont mix it up with my own Source files. Also I am interested in knowing how to disable generation of linker script by cube since I modified the linker script a lot and put it in another folder I dont need the default generated one.BR
After creating a project, using the STM32CubeMx feature within STM32CubeIde, I typically add some additional include paths using project>properties>C /C++ General>Path and Symbols>Includes. However, if I go back into the STM32Cube ioc file and add features followed by saving and generating new feature code all of my custom include paths are wiped out. What pain!STM32CubeMx is good about leaving custom code untouched (if located in the proper areas) but isn't user friendly when any project properties are added. Am I missing a control option that might prevent this from happening?
I have just changed from STM32F (works fine) to STM32H and have used MX to generate the Code for a SRAM 16 bits wide and 6 Address lines. The FMC outputs the NE clock but depending on the Data Bus Setting 8, 16, or 32, NE produces either 8, 4, or 2 Clocks respectively within the NE Clock, the Address also increments for each down clock within the NE. My reqiuirements are for a single NE Clock for a 16 Data Bus. It appears that the FMC always wants to clock a 64 bit word what ever the Data Bus size. Regards JohnW
Hello!I have found a lot of examples about simple ADC reads, with:-single channel single conversion-single channel continuous conversion-multi channel single conversion-multi channel continuous conversionAnd these with polling, interrupt and DMA.I need to measure singple phase AC voltage and current.Hardware built up:-VDDA 3.3V -VSSA AGND-Vref 3V-PA6-PA7 differential pair AC voltage-PC4-PC5 differential pair AC currentI need Dual Regular mode plus Differential read.Hardware side without load (0V AC) on both pair I have 1.5V. For example if there is 100V AC then PA6 bigger than 1.5V, PA7 smaller than 1.5V. This differential value I need to measure.Right now without success. In stm32cubeL4 examples have found this: Diff conversion result = mid-range + (channel_high-channel_low)/2In 16bit case this means: (let's say 1.5V = ~33500)without load: 32768-65536 + (33500 - 33500) / 2 = -32768 ???with load: 32768-65536 + (33800 - 33200) / 2 = -32468 ???I need only the difference: 33800 - 33200 =
When the embedded tracer is active in the MXcube for the STM32G474, the following files are missing:#include "stm32g4xx_ll_bus.h" #include "stm32g4xx_ll_dma.h" #include "stm32g4xx_ll_gpio.h" #include "stm32g4xx_ll_rcc.h" #include "stm32g4xx_ll_usart.h"See file tracer_emb_config.hThese files aren't added after generating the codeConditions:Used tool chain: STM32CubeIDE or STM32CubeMX Version 5.3.0In project manager: Copy only the necessary library files is selected
I just want to point out: this issue with the code generator still hasn't been fixed.It would be really cool to have a popup like when selecting FreeRTOS that the tick needs to be based off something other than the systick - instead simply detect when FreeRTOS + USB_CDC are selected and recommend increasing the HEAP size.
Tried to configure STM32F429I-DISC1 board in latest CubeMx, but found USB_OTG_FS is disabled under "Connectivity" category. How to configure USB device of this discovery board? Is there an example using STM32CubeMX 5.3.0 for this? Thanks!
Hello !My project works with FreeRTOS and HAL library (generate by CubeMX) on STM32L496 and I use TIM1 as timebase source instead of SystTick.I have a problem with osDelay().I have these functions to print what I want with an UART :/* --------------------------------------------------------------------------*/ uint8_t TUTxPutByte(uint8_t p_data) { //Push character on UART return HAL_UART_Transmit(&huart3, &p_data, 1, 1); }//end TUTxPutByte /* --------------------------------------------------------------------------*/ /* --------------------------------------------------------------------------*/ uint8_t sendMsg(char * p_msg_to_send, uint8_t p_CRLF) { uint8_t i = 0; //Loop variable uint8_t lengthMsg = 0; //Length of ASCII data uint8_t statusReturn = HAL_OK; //Error function return //Calculate length of message lengthMsg = strlen(p_msg_to_send); //Transmit loop for(i = 0; i < lengthMsg; i++){ //Send char by cha
Hi everyone,I have an STM32H743 Nucleo kit with ethernet interface. I'm trying to make alive a simple TCP/IP demo with the raw LwIP stack. I'm using STM32CubeMX with TrueStudio.In the Cube I have configured the followings:- Clock is set to th highest at every bus- PHY is set to LAN8742. IOs are configured by Cube to their special function - MPU is not used, nor cache (I and D also set to off)- LwIP is used without FreeRTOS- Ethernet IRQs are enabled in the Cube- DHCP, ICMP, UDP enabled in the settings of the LwIPIn the TrueStudio project:- I have modified the linker to place ETH_DMADescTypeDef DMARxDscrTab, ETH_DMADescTypeDef DMATxDscrTab and Rx_Buff into the D2_RAM at the mentioned addresses- I have call the MX_LWIP_Process() in the main/while(1)With these settings, I'm still not seeing my device on my network (I have tried WireShark also). What else do I miss to be able to ping it? Thank in advance for any kind of idea!Best regards,Attila
Hello community,I am using X-CUBE_GCP package with B-L475E-IOTA discovery kit. I downloaded the package from the ST website and ran the sample code. It worked fine. Now I have a SAM8Q GPS module (https://www.mikroe.com/gnss-4-click) hooked up at UART4 and a CO-sensor (https://www.spec-sensors.com/product/iot-co-1000-digital-co-sensor-module/) hooked up at USART2 (PA2-->TX PA3-->RX) , both working at a baud rate of 9600bps. I am using STM32CUBEMX to generate initialization code for UART4, USART2 and enable Freertos CMSIS V1.My main goal is to take GPS and CO sensor data and send it to Google cloud. I am using 3 threads : first thread for GPS, second thread for CO-Sensor and third thread for cloud ( calling cloud_test(0) inside 3rd task). I tried running the FreeRTOS and was able to get GPS and CO sensor data using HAL_Receive_IT(), but my cloud thread fails to allocate memory. I get the below error:"L #57 net_init() failed: allocation failed" I searched and found it to be a heap p
About STM32H743VGT6Selector of STM32CubeMX show that flash size of STM32H743VGT6 is 1024K.but when i used STM32CubeProgrammer to connect it,that show flash size if 2048K。even the sector from 0x0810 0000 to 0x081f ffff can be erase and program to。so the flash size of STM32H743VGT6 is 1M or 2M?
Hi,i am not able to activate TRACE SWO (Pin PB3) in CubeMX.There is a hint that for SYS_JTDO-SWO (no mode).How can i solve this?
Hi I am using stm32CubeMx to set one gpio and then trying to execute the code. I have tried both Atollic and STM32IDE both give me an error somewhere is system memory. Error: 1fffdab8: Failed to execute MI command: -data-disassemble -s 536861368 -e 536861400 -- 2 Error message from debugger back end: Cannot access memory at address 0x1fffdab8I am using the STM32F030CCT6 MCU. Code builds fine but does not even allow me to set a break in main. Where I first experienced the problem was with code I merged with code of the STM32F030k6 MCU. The code would step to GPIO_init and then fail at a certain point. To try and debug I did a setup in the cube with only one IO selected as output and the rest I ticked as analog.
1�?why datasheet show that STM32G474RB has 512K Flash。But STM32CubeMX show 128K?2�?does the STM32G474RB has dual bank mode?3�?STM32G474RE,when dual bank,bank1——0x0800 0000~0x0803 FFFF,bank2——0x0804 0000~0x0807 FFFF。so if STM32G474RB has dual bank mode,then bank1——0x0800 0000~0x0800 FFFF,bank2——0x0801 0000~0x0801 FFFF??thanks very much�?�?
Hi Community, I find a method to reset a buffer of USART DMA Buffer.because I use USART DMA basically.my system is consist of android smartphone, bluetooth and microcontroller(STM32F407VET), PCwhen I click a button that implemented in a android, some packet is send to the bluetooth RXand Bluetooth TX that connected to micro controller USART3 RX.than Received USART3 Data directly send to USART1 and I can see the packet in PC program.(So... long)I learned about HAL USART DMA is need a fixed buffer size.so I designed the system the length of the packet is always fixed.But! when the Bluetooth is connected, the packet is occurred by Bluetooth like "Connected X" (X is MAC address of Bluetooth)Due to the packet that I don't want, DMA buffer is shifted.like under example.ex)Normal Statebuffer size 5send "12345" => receive "12345"Abnormal statesend "12345" => add packet "ab"=>receive "ab123"For this reason, I would like to ask community How to reset DMA buffer.Of cours
STM32G4 IS VERY GOOD! BUT CUBE MX DONT WORK, Will be cube mx for G4?
Used cube to generate a project with default settings for STM32F429I disco board plus CMSIS V2 RTOS and USART 2 half duplex transmit only . Generated the code for System Workbench.I retargeted _write() and provided __io_putchar(). I added -u _printf_float to the linker flags.In the StartDefaultTask I added float fVal = 345.678; printf("Hello World\r\n"); printf("fVal %f\r\n",fVal);OutputHello WorldfVal . !IssuesWith -specs = nosys.specs -specs= nano.specs -u _printf_float - printf causes a hard fault.With specs = nosys.specs -specs -u _printf_float - 1st printf OK 2nd printf produces incorrect output
I am trying to use the DMA of the STM32H750 to generate a specific PWM, but it does not output any waves.HAL_TIM_PWM_Start(&htim2,TIM_CHANNEL_4); __HAL_TIM_SET_COMPARE(&htim2,TIM_CHANNEL_4,50);This is the code that usually generates pwm, it works, I can see pwm on the logic analyzer.But if I use DMA, it will not output anything.uint16_t buffer[10]={0}; buffer[0]=50; buffer[1]=50; buffer[2]=50; HAL_TIM_PWM_Start_DMA(&htim2, TIM_CHANNEL_4, (uint32_t *)buffer, 10); while(HAL_TIM_PWM_GetState(&htim2) != HAL_TIM_STATE_READY); // HAL_TIM_PWM_GetState will get HAL_TIM_STATE_READYIt will get...I passed the debugger and found that it fell into TIM_DMAError.I observed that the value of ErrorCode for HDMA becomes 1, which is defined in stm32h7xx_hal_dma.h as... #define HAL_DMA_ERROR_TE (0x00000001U) /*!< Transfer error */ ...How can I solve this problem? I used the same code in STM32F042 and it works.My cubemx configurationClockTIMDMALinker Strrings(default value)
Dear All,Please consider STM32F407. I tried to configured its three ADCs: ADC1 and ADC2 in dual intereleved and ADC3 in independent mode using CubeMX. BUT it is impossibe the job using that. Is it possible to moddify the CubeMX's generated code to work correctly? How can I do the project?Regards, Rasool
I have a new project on an STM32H743 and thought it is a good idea to start this one with the latest version of CubeMX (5.3.0.) and the latest HAL library (1.5.).As I already have several systems running with USB VCP (STM32F746 and STM32H743) which were created with older releases of the Cube/HAL, I applied the necessary changes to the USB routines and thought it should work like in the old projects.But I get failures on the PC side "The device cannot start (Code 10)" when attaching the new system. Some rare times it works, but most times I get errors. I already increase Stack and Heap size to 2000. So this should not be the reason. Hardware should be ok as this also has been done like on the other systems.Has anybody an idea what I should have a look at? I use a Win10 - 64Bit PC and the driver version of the VCP is automatically installed (V. 1.4.0). My other systems are performing USB VCP without issues on that PC.Any comments very much appreciated!
When using an external crystal in the MXcube for the STM32G474 mcu.conditions:Change High Speed Clock (HSE) to Crystal/Ceramic Resonator in the pinout & Configuration tab pageChange the input frequency to 16Mhz in the Clock configuration tab pageAfter generation the code, op the file 'system_stm32G4xx.c file.The HSE_VALUE isn't changed to 16000000U#define HSE_VALUE 8000000U
Hello,i am struggling with ADC conversion with STM32L010 because every new conversion overide the other channels. So i got on each channel the same result when i change the resistance on PA6. On PA4 and PA5 there is a 100k NTC connected.I use PA4 (ADC_IN4), PA5 (ADC_IN5) and PA6 (ADC_IN6) for conversion.For changing the channels i did this:/* Temperature inside (PA4) */ sConfig.Channel = ADC_CHANNEL_4; HAL_ADC_ConfigChannel(&hadc, &sConfig); ADC_Conversion(); ... ... ... /* Temperature outside (PA5) */ sConfig.Channel = ADC_CHANNEL_5; HAL_ADC_ConfigChannel(&hadc, &sConfig); ADC_Conversion(); ... ... ...My initialization code with CubeMX is here:static void MX_ADC_Init(void) { ADC_ChannelConfTypeDef sConfig = {0}; /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) */ hadc.Instance = ADC1; hadc.Init.OversamplingMode = DISABLE; hadc.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV4; hadc.Init.Resolution = ADC_R
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.