Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I have generated a project in Cube MX for my custom application board with STM32H745IIK6. I have configured system clock from the HSI to 64MHz and allocated PC0 for GPIO output (blinky application) in CM4 core. My initial hardware semaphore handshaking is not happening in the project and upon debugging I was able to figure out that the HAL_GetCurrentCPUID function is always returning CM7 ID in context of CM4. With this happening my CM4 is not able to enter into STOP mode and with breaks the initial handshaking mechanism in the project. There are no changes made in the Cube MX project apart from usage of GPIO. Can someone help me identify I am doing something wrong. Please find the link for GitHub project below. akhilpanayamparambil/cubeMXblinky (github.com)The steps followed to generate the project is described in README.md.Also, the low power implementation for project looks adhered to AN5215 document.Also note that I am using JLINK Compact in SWD mode for debugging. One more observat
Hello,when I try to receive a CAN-Frame it is not received by the Microcontroller, it is within the range, I have no idea what the issue is.Thanks to everybody in advance, Best Regards, Seppel void FDCAN_Config(FDCAN_HandleTypeDef *pHfdcan) { pHandleToFdCan = pHfdcan; /* Configure Rx filter */ sFilterConfig.IdType = FDCAN_STANDARD_ID; sFilterConfig.FilterIndex = 0; sFilterConfig.FilterType = FDCAN_FILTER_RANGE; sFilterConfig.FilterConfig = FDCAN_FILTER_TO_RXFIFO0; sFilterConfig.FilterID1 = 0x700; sFilterConfig.FilterID2 = 0x7FF; if (HAL_FDCAN_ConfigFilter(pHandleToFdCan, &sFilterConfig) != HAL_OK) { Error_Handler(); } /* Configure global filter: Filter all remote frames with STD and EXT ID Reject non matching frames with STD ID and EXT ID */ if (HAL_FDCAN_ConfigGlobalFilter(pHandleToFdCan, FDCAN_REJECT, FDCAN_REJECT, FDCAN_REJECT, FDCAN_REJECT) != HAL_OK) { Error_Handler(); } /* Start the FDCAN module */ if (
Insted of using the computer as the Host, i want to work with an STM32 microcontroller usb host. The device uses a standard FTDI USB to serial converter as the main mechanism to communicate between the computer and controller. Instead of using the computer, I want to use STM32F4 as a host to communicate with the device.STM32 -> USB -> FTDI -> Machine controllerWhich class i have to choose in cubeMX configuration i didn't find Vendor Specific Class in the options ? (those are the options USB_Host Class for FS IP : HID/MSC/VPC(cdc)/Host support all classes )Is this gitproject usefull?https://github.com/torvalds/linux/blob/master/drivers/usb/serial/ftdi_sio.h
I am testing LTE modem with a STM32H747 MCULTE modem is connectied with STM32H747 thru USART2.I want to use PPP communications with LTE modem.but when I try to check LWIP in [Pinout & Configuration] of IOC file,I can't set [Enabled] of [LWIP Mode and Configuration]It is disabled. I dont know why.Can you explain how to set PPP with IOC file.
When generating a makefile project with the STM32U575 MCU it does not generate the CPU= -mcpu-cortex-m33 section of the makefilee.g. it looks like this:####################################### # CFLAGS ####################################### # cpu # fpu FPU = -mfpu=fpv4-sp-d16 # float-abi FLOAT-ABI = -mfloat-abi=hard # mcu MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)This gives errors while compiling with a fresh makefile project.
MX generated ADC drivers like this: /** Configure Regular Channel */ LL_ADC_REG_SetSequencerRanks(ADC1, LL_ADC_REG_RANK_1, LL_ADC_PATH_INTERNAL_VREFINT); LL_ADC_SetChannelSamplingTime(ADC1, LL_ADC_PATH_INTERNAL_VREFINT, LL_ADC_SAMPLINGTIME_247CYCLES_5); LL_ADC_SetChannelSingleDiff(ADC1, LL_ADC_PATH_INTERNAL_VREFINT, LL_ADC_SINGLE_ENDED);it uses macro LL_ADC_PATH_INTERNAL_VREFINT, not LL_ADC_CHANNEL_VREFINT. As the results, the internal channels are not ADC'ed right, TS is 200+ degree, VREF is always 3.300V and VBAT is 3.6xxV. It happened on L4 series, not WB55 (where the macro is LL_ADC_CHANNEL_VREFINT). -wq
I get an error when trying to open .ioc file of the project. It was working fine and i am pretty sure I haven't changed anything about it. Just can't open it anymore for some reason. Also the name that it says that is the right one, is the same as the name of my file.The error I get:Invalid Input: Must be project's active .ioc file.Project's 'camera_module' active one is 'camera_module.ioc' file
Hello ST,I am trying to install x-cube-smcard package via cube mx.I am unable to do so. I get an error everytime.Please let me know how to install the same.https://www.st.com/en/embedded-software/x-cube-smcard.html
In the STM32L431, datasheet does not show PA11 as configurable to an ADC.
Hello All, I am reasonably new to STM and could use some advice. I am looking to sample 4 ADC channels.1 analog signal represents the current passing through a motor and needs to be sampled 2k times per half cycle (60hz). Towards the end of the half cycle, my current is negotiable, and it can be ignored for my purpose, so I want to set it up to trigger off my firing angle and stop after collecting 2k samples (approximately 8mS with adjustment of sampling time). After that sampling is complete, and the time is the last portion of the half cycle (approximately 0.33mS of the 8.33ms), I want to collect 1 sample after another of the other 3 channels. (I.e., 1 sample of another channel (Line Voltage), then one sample on another channel (potentiometer), and finally one sample of another channel (PCB board temperature sensor)). I have a few ideas to set this up, but I thought I would see what the experts recommend.I have already set up PA4 to collect 2k ADC values using D
Hello,I just created a new project on CubeMX for a STM32F407G-Disc1. I'm working with last version of MX, firmware.The project is configured to build with Makefile.Have a double variable modification causes a MCU HardFault_Handler to trigger.Any idea why the default project do not allow to use double?Thank you
..
Hi everyone, we are using stm32f405rgt6 microcontroller in our robot, when we are using i2c for reading data from BNO055 module suddenly the device get out of the i2c line or maybe can not read the data,Here are some more details:we pulled up our i2c lines with 10k resistors.And this photo that I mentioned is our BNO055 module: Also, I configured the I2C2 with the following details: However we didn't have this problem with stm32f103c8t6 microcontroller before.
I've just upgraded to MX6.8.0 and IDE1.12.0. I get this notice when loading a new application or example program. It doesn't affect anything and choosing OK let's everything proceed, but I'd like to get rid of the notice and find out where it's getting the "../../../../.." path.Thanks,TJM
Hello,i have custom board with STM32F779 and custom Ethernet PHY KSZ8061RNB.I'm using CubeMX and only 2 PHYS are supported. I haven't found any documentation how to do configuration with custom PHY device. I have found CMSIS driver for KSZ8061RNB, but it doesn't look like it could be easily integrated. Also ETH initialization code is integrated under LwIP and I have no clue how to change lower level of initialization or to switch it off completely and do initialization in custom code...Any help would be appreciated,thanks in advance,regards,Rob.
I am reaching out to seek your expertise regarding a clock setup issue that I encountered while using the STM32H743 microcontroller.My goal is to use up to a maximum of 480MHz system clock using a 25MHz HSE. However, I have encountered some errors in red while setting up the clock in STM32CubeIDE. I am unsure why these issues have occurred, and I would greatly appreciate any insights you may have.My main question is whether it is possible to achieve a 480MHz system clock using a 25MHz HSE. I would be grateful for any advice you may have regarding this matter.
We are working on porting an existing STM32F373 USB application to STM32G431 using STM32CubeMX and the USB Device Middleware. The USB device is a composite device of two custom interfaces.The first interface is a multitouch interface with 1 endpoint, the second interface is a vendor interface with 2 endpoints.Is there any example on how to create composite USB devices with the middleware?
In the HAL Library for the STM32H7 familiy (version 1.11.0) downloaded with STMCubeMx there is the following entry in the stm32h7xx_hal_rcc.h file:#if defined(RCC_RSR_CPURSTF) // <<---- This is the line in question #define RCC_FLAG_CPURST ((uint8_t)0x91) #endif /* RCC_RSR_CPURSTF */ [...] #define RCC_FLAG_C1RST (RCC_FLAG_CPURST) #define RCC_FLAG_C2RST ((uint8_t)0x92)In the stm32h755xx.h file the "RCC_RSR_CPURSTF" is not defined. Why is that?According to the reference manual (RM0399, chapter 9.7.38) there is C1RSTF flag in the RCC_RSR register at bit position 17, which corresponds to the defined value above of 0x91 for RCC_FLAG_C1RST (if it was active) when using the Makro "__HAL_RCC_GET_FLAG(...)" to check wheter a C1RST occurred.The above mentioned "#if defined(RCC_RSR_CPURSTF) " was introduced after HAL Library version 1.5.0, where there was no such define. When we are looking for example in the "stm32h753xx.h" device file, there this define is present:
I want to add a TIM15_TRIG connection (is this the same as TRGO?) to a DMA transfer request.When trying to do this via STM32CubeIDE "Version: 1.11.2 Build: 14494_20230119_0724 (UTC)" I get the following options:i.e. no option to select TIM15_TRIG, which appears to be shown to be supported in RM0440:Could this please be added to the interface so I can set it please?And if it cannot be set in the STM32G431KB MCU, could you please update the documentation to reflect this fact please?Thank you.
Cube IDE 1.12.0 Build 14980_2023_03_01_1550OS: Windows 11 Pro 22H2 Build 22621.1413Project using STM32L476 Nucleo board; low level only (no HAL used at all)I've build my project IOC file using the previous version of Cube. When I open it, I have 3 options: continue / migrate /..If I select "migrate" and generate code, the following statement appears in my systemclock initwhile (LL_PWR_IsActiveFlag_VOS() == 0) { }According to the source, this waits for the 10th bit in PWR_CR2 to become '1':#define PWR_SR2_VOSF_Pos (10U)This bit seems to be reserved for STM32L471; so why is cube generating this in my project? Fact is: the code waits forever on the above while statement.The best option I found so far is not to migrate my IOC file (unfortunately I did not find a way to attach it).Differences in comparing the IOC files before and after the migration are only version info:Keeping the IOC in the old version prevents g
Hi!My question may seem stupid but I am stuck with it. I made a register based project which is working pretty good. I want to add to my project usb cdc. I generated a code using CubeMX but it generates plenty of drivers and files (including the clock that I already configured using registers). Can someone give me an idea on how to integrate these HAL files (I understood that USB is only HAL, if there's any other way please tell me) into my register based project. Or maybe there is a way to not use CubeMX at all and do it manually?Thank you!
I'm just starting to learn microcontrollers, so I have a question.I have STM32F103C8T6 and STLINK V2 programmer.Connected lines SWDIO, SWCLK, SWO(PB3) and RESET In CUBE MX I choose "No Debug" or "Serial Wire" or "Trace Asynchrone SW" and in CUBE IDE with any choice (after flashing), there is debugging by registers and SWOWhy is it so done that debugging goes on, even if it is turned off in CUBE MXIn STM32 Utility also works, with debugging disabledPic
I am having trouble with USB-FS communication with STM32F107RCT7.When the board is connected to the PC via microUSB, the PC does not even detect something is connected to the PC.I know that the PC detects a new device via a pull-up resistor on either DP or DM lines. In my case there needs to be 3.3V on DP pin via an Internal Resistor inside the MCU.Checked the voltage on DP, it is zero.Tried to debug the issue in STMCubeIDE:I found the function responsible for USB initialization: HAL_PCD_MspInitBut there were no pin initialization for DP or DM pins.Throughout the whole project I could'tn find any initialization on DP or DM pins.Added the following code in HAL_PCD_Mspinit__HAL_RCC_GPIOA_CLK_ENABLE(); GPIO_InitStruct.Pin = USB_FS_DP_Pin|USB_FS_DM_Pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(USB_FS_DP_GPIO_Port, &GPIO_InitStruct);Still no 3.3V on DP pin.I cheked the DP pin on nucleo F767ZI
Greetings! :)Usecase:Nucleo-F756ZGCubeMx 6.8.0Set PLL to 216 Mhz,Enable RCC->Tim prescaler selection.On "Clock Configuration" set 216 Mhz for APB1 Timer clocksWhen use HAL, It works fine. PeriphCommonClock_Config() has been genereated, but if i change on LL, autogenerated code will not set TIMPRE bit configuration in the RCC_DCKCFGR register.void PeriphCommonClock_Config(void) { RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; /** Initializes the peripherals clock */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_TIM; PeriphClkInitStruct.TIMPresSelection = RCC_TIMPRES_ACTIVATED; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { Error_Handler(); } }As the datasheet mentioned:"The timers connected to APB2 are clocked from TIMxCLK up to 216 MHz, while the timers connected to APB1 are clockedfrom TIMxCLK either up to 108 MHz or 216 MHz depending on TIMPRE bit configuration in the RCC_DCKCFGR register."Perhaps missing function is:__S
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.