Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi all,I read STM32F4 MCU family doesn't support SMBus because of hardware limitations in the I2C cell. For this reason SMBus is not included in the HAL driver. If I choose STM32F439ZI in STM32CubeMX and I activate I2C, I can select between 3 different modes, as shown in the picture below. So I'm very confused. Does STM32F4 family support or not SMBus? Is there STM32F4 family SMBus HAL Driver? Thank youBest regards,Antonio
Hello,Doing a "git diff" on my project IOC file notably highlights these changes:-Mcu.Pin6=PA2-Mcu.Pin7=PA3+Mcu.Pin6=PA0+Mcu.Pin7=PA1Looking at the IOC file, I do not think that these Mcu.PinXXX parameters define the actual pin name associated with a physical pin number.So I am wondering what these Mcu.PinXXX parameters represent. And an even more important question: where are all STM32CubeMX IOC file parameters documented by ST? Googling them leads to no results.Thanks!
As a long time bare metal and STM32 Std Library user, I am trying to brush up my skills to use the HAL interface (and other things). Using STM32CubeMX V6.2.0, from the New Project from Example form, I double clicked on the example UART_ReceptionToIdle_CircularDMA and it downloaded a project. When I try to open the example it just gives the message "Try to load a project generated with a more recent version of MXCube". This happens with some other USART examples, for example UART_Console. My main interest in this is to see what source code it generates, specifically for using a circular DMA USART buffer, so the ability to load the actual project is not important. Maybe I am missing something about the concepts behind STM32CubeMX, but the Example Selector for most examples seems to not find or be able to load some needed software e.g. "STM32Cube FW_F4 V1.26.0 NOT FOUND, Do you want to check for updates?" Clicking Yes just brings up a dialog that is only on the screen for a second or so (
hello,is't possible to make porting between different cpu using cubeMX ( and using the import option) when the pinout are not compatible? i'm interesting to porting project that running on stm32h743(BGA package with 176 pinout) to stm32743ZIT ( LQFP package with 144 pin)the main relevant difference is that in the cpu with 176 pins, there is another port, Port H . therefore, the cpu's are not pin compatible. i use the use cubemx (version 6.0.0 ) and using import option . and of course that nothing map to Port H . but while i generate code , i pay attention that in the init_gpio file, there is a code that try to configure Port H which is not exist in stm32743ZIT ( LQFP package with 144 pin) so, what is wrong? and how to fix it? regards.
I upgraded from STM32CubeIDE 1.3.1 to 1.4.2, and got issues with UART speed. To eliminate error sources, I just made a minimum project with UART transmit. At 115200bps, the bit-time should be 8.68us (and it is with IDE1.3.1), but it comes out as 7.82us with IDE 1.4.2, which just gives garble.The clock config was done with the GUI. This is with HSI clock source. It does not matter if the HSI is used directly or with PLL, still wrong bit-timing. It will give correct timing if the MSI (4MHz) clock is used. I could not see immediately from the code generation what was wrong.Could you please confirm issue, or is there a work-around, or something I am missing? In the mean-time I need to get back to IDE1.3.FYI: Chip: STM32L431VC - same issue on both UART1 and UART2.
Hi,I tried to use SDIO with 4 bit and 1 bit mode with FatFS. I use STM32F407 Discovery board and I wired a micro SD card board to it. The SD card is a 16 GB micro SDHC card formatted to FAT32. I used STM32cubemx V6.2 .0 and Atollic TrueSTUDIO for STM32 9.3.0.but it doesn't work. Please help me how can I solve this.Thank you in advance!
Here is my program, but only the first route has AD change, but I give 3.3V or 0V.I use Cubelde 1.3.0 and CuBlemx6.2.0 software.I don't know why not enter the ADC callback function?typedef struct tagAdcStatus{ INT8U AdcChFlags; uint16_t AdcConvertedValue[12];}TAG_ADC_STATUS;TAG_ADC_STATUS TagAdcStatus;HAL_ADC_Start_DMA(&hadc1, (uint32_t *)TagAdcStatus.AdcConvertedValue, ADC_MAX_CH_LEN)/* USER CODE END 0 */ADC_HandleTypeDef hadc1;DMA_HandleTypeDef hdma_adc1;/* ADC1 init function */void MX_ADC1_Init(void){ /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC1_Init 1 */// HAL_ADC_MspInit(&hadc1); /* USER CODE END ADC1_Init 1 */ /** Common config */ hadc1.Instance = ADC1; hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc1.Init.ContinuousConvMode = ENABLE; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConv
I am newbie getting lost in the HAL functions/features to use. I use STM32CubeMx to generate the code and use Keil uvision5 for development. I use STM32G071 Nucleo-64 development kit. I wish to measure a ‘start’ pulse of a proprietary protocol. The pulse, if low for 55 microseconds is considered start pulse.A port pin has been configured as input. Idea is to poll the line and when a low level is detected, measure the time for how long pulse remains low.I have used timer 3 with no prescalar, in up counting mode. The ARR count is 3520@64MHz. So far, I have not used any interrupt.After a low level is detected, the timer is started byHAL_TIM_Base_Start(&htim3);As a next step, I wish to poll the UIF flag to check whether the time has elapsed.I do not know which HAL function or what should I use to check the status of the flag.Once detected I will need to clear it as well
I am trying to configure the ADC of STM32L476RGTx to scan three channels, but STM32CubeMX only shows Disabled as an option to select for Scan Conversion Mode. I have also tried this with STM32L471VETx and the same problem exists.Am I missing a prerequisite setting that needs to be enabled before Scan Conversion Mode can be enabled, or is this a problem with the device definition?
Just update from 1.5.1 to 1.6.0 and now i can't tick to any checkboxes, for example in the embedded package manager as below: I use MacOS 10.14.6 (Mojave)Regards,
We are sorry to announce that the refresh data feature is temporarily unavailable for STM32CubeMX, STM32CubeIDE and STMCUFinder. We are working on a solution for this issue. Please note that the FW download stay available. RegardsNawres
Hi, when I want to generate code for an STM32H743ZI, a popup appears:"The Firmware Package (STM32Cube FW_H7 V1.3.0) or one of its dependencies required by the Project is not available in your STM32CubeMX Repository. Do you want to download this now ?"Sure enough I do, and then it ends with this error:"Error downloading the following files:stm32cube_fw_h7_v130.zip (Target directory already exists)"and"Unzip File : stm32cube_fw_h7_v130.zipProblem during Download and/or Unzip of selected Files"I run STM32CubeMX in admin mode on windows 10.What can be the problem? How do I solve it?Regards, Jack.
Hello,After access to board selector > STM32F446RE does not ask for the default peripheral configuration and it started as a plan board.What can be the reason not initialization of the default pin of the board?Thanks.
The first one is a minor typo I guess. The init code for the ADC has these lines in it:/* Enable ADC internal voltage regulator */ LL_ADC_EnableInternalRegulator(ADC); /* Delay for ADC internal voltage regulator stabilization. */ /* Compute number of CPU cycles to wait for, from delay in us. */ /* Note: Variable divided by 2 to compensate partially */ /* CPU processing cycles (depends on compilation optimization). */ /* Note: If system core clock frequency is below 200kHz, wait time */ /* is only a few CPU processing cycles. */ uint32_t wait_loop_index; wait_loop_index = ((LL_ADC_DELAY_INTERNAL_REGUL_STAB_US * (SystemCoreClock / (100000 * 2))) / 10); while(wait_loop_index != 0) { wait_loop_index--; }The first line should be: LL_ADC_EnableInternalRegulator(ADC1);And the other bug happens when you select both the internal temperature sensor AND the vrefint on the ADC.This does not work:LL_ADC_REG_SetSequencerChAdd(ADC1, LL_ADC_CHANNEL_TEMPSENSOR); LL_ADC_SetCommonPathInterna
I get this compiler error in main.hUsing C and cubeMX autogenerated code
The max ADC clock is 50MHz but the source can be divided by up to 256 so there is no need to limit the source frequency@Khouloud ZEMMELI
If I attend FreeRTOS training, how many changes or modification would have to be made, to implement a project starting with the FreeRTOS from ST32CubeMXAny help appreciated
..
Hello @Khouloud ZEMMELI ,I am observing download issues:When trying to go to example related windowWhen trying to start a new project via option "Start my project from MCU"Please help with fixing the issue.Thanks,Rajeev
I am using stm32h743ii board. I am adding two adc channels of adc 1. I am using scanning mode and continuous conversion mode. I am geeting the data using HAL_ADC_START_DMA.I am Storing the data of channel 1 in data_read[0] and the data of channel 2 in data_read[1] .I am getting the data of both the channel .While i interface any one of the channel i am getting the data correctly . But while i am interfacing both the channels with the analog input together at the same time , i am getting the data error. the value range changes automatically.i am using the reference voltage of 3.3 voltt.If i get adc voltage for channel 1 as 2.8 volt separately and adc voltage for channel 2 as 1.5 volt separately , while together i get adc voltage for channel 1 as 2.8volt or something and adc voltage for channel 2 as 2.2 volt.
Hello,my project expands and i need more than 32k flash.In the CubeMX it is not possible to change the Mcu Referenc.It is possible without to generate the project new to change the Mcu?Thanks
Using Cube IDE. Generated a fresh project for a stm32f446ve target.Activated with CubeMX uinder I2C a port with "SMBUS-two-wire-interface".Then, without doing nothing more i have builded the configuration and flashed to target.as soon as i start the mcu, it goes to hardfault.Further investigation led to a DIVISION_BY_ZERO during SMSUS peripheral initialization (HAL_SMBUS_Init(&hsmbus1) ).The division by zero arise when doing :MODIFY_REG(hsmbus->Instance->CCR, (I2C_CCR_FS | I2C_CCR_DUTY | I2C_CCR_CCR), SMBUS_SPEED_STANDARD(pclk1, hsmbus->Init.ClockSpeed));hsmbus->Init.ClockSpeed is not set, nor in the cube-mx i have the entry to input it.Is that a bug or i am not using correctly that ?i was succesfull in interfacing a fuel gauge with an F3 (STM32F302) mcu and HAL.thanks !
This is 3 year old question coming back again in a hope that the way was found or newly implemented to turn any STM32 example project into the configurable one to use the advantage of STM32CubeMX tool. Again, as in the past, I don't see project configuration files in all the examples I looked into and once I imported the example project, the STM32CubeIDE does not even have means to launch CubeMX ... this icon only appears when a new project created using CubeMX...Please anybody who knows any way to make the provided examples into the CubeMX configurable project without a thousand of clicks to manually match the newly create project with a working example, please let people know .Thanks in advanceVlad
With a fresh installation of STM32CubeIDE, after adding X-CUBE-AI 5.2.0 Validation template to a project, build fails with:../Core/Src/main.c:55:13: error: static declaration of 'MX_USART2_UART_Init' follows non-static declarationHow to reproduce:Create a new STM32 project.In the board selector choose (for example) Nucleo-L476RE-P, validate project creation.Add the X-CUBE-AI 5.2.0 software pack to the project with the Validation application template.Set the Platform settings in the X-CUBE-AI configuration to the UART as needed.Create a new network and import your model (TFLite used here).Save and generate code.Try to build project.Actual behaviour:Build fails with:arm-none-eabi-gcc "../Core/Src/system_stm32l4xx.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DSTM32L452xx -DDEBUG -c -I../Core/Inc -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../X-CUBE-AI/App -I../X-CUBE-A
/* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "i2s.h" #include "gpio.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include <stdio.h> #include "SEGGER_RTT.h" #include "debug_helper.h" #define HAL_TIMEOUT 1000 #define MIC_BUFF_SIZE 256 int32_t mic_buff[MIC_BUFF_SIZE]; void sph0645_test(void) { HAL_StatusTypeDef hal_st; while(1) { hal_st = HAL_I2S_Receive(&hi2s2, (uint16_t*)mic_buff, MIC_BUFF_SIZE, HAL_TIMEOUT); if(hal_st != HAL_OK) { printf("HAL_I2S hal_st=%i\n",hal_st); HAL_Delay(5000); } for(uint32_t i=0; i<MIC_BUFF_SIZE; i++) { printf("\nM="); printBits(sizeof(mic_buff[i]), &mic_buff[i]); HAL_Delay(10); } } } /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ /* U
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.