Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello together,Aim:Learn how to use the LPTIM on STM32CubeU5 low level device drivers, such that it consumes least possible energy.Write a program that blinks the on board red LED every 1 s (forground loop) using the interrupt mechanism of the LPTIM, while blinking the blue LED in the background every 250 ms in the main() loop.Given:Platform: NUCLEO-U575ZI-QMCU: STM32U575ZIT6QPeripheral: LPTIM4Peripheral clock: 32kHz LSI or 32.768 kHz LSEPeripheral bus: APB3APB3 clock: 160 MHz PCLK3 - HCLK - MSIS - HSI RC 16 MHzSTM32Cube tool: STM32CubeMX and the LL STM32CubeU5Procedure:Successfully configure the peripherals in STM32CubeMX.Successfully configure the clock in the STM32CubeMX.Select the low level device driver in the advanced project settings for everything.Generate code without TrustZone, without ICACHE, etc.Please find attached the .ioc file tha
In STM32CubeMX, version 6.3.0, using STM32CubeF4 v1.25.2, when a SPI port is set to mode "Receive Only Master", it sets `hspi#.Init.Direction = SPI_DIRECTION_2LINES_RXONLY;` in generated code, as (I think) it should. However, the generated code doesn't work for DMA mode (`HAL_SPI_Receive_DMA()`). The SCK doesn't shut off at the end of the requested transfer, and the `HAL_SPI_RxCpltCallback()` interrupt handler doesn't hit.If I set the SPI mode in CubeMX as "Full-Duplex Master", then manually change `hspi#.Init.Direction = SPI_DIRECTION_2LINES;` to `SPI_DIRECTION_2LINES_RXONLY` in the generated `MX_SPI#_Init()`, the bad behavior is the same. I can optionally remove the call to `HAL_GPIO_Init()` for the MOSI line, and it still works, though.Is this an issue with the CubeMX-generated code, the HAL, and/or the Silicon itself?(I realize I'm not using the latest CubeF4 HAL, and we're working on updating that. Meanwhile, I checked the diff against the latest, and didn't spot any seemingly rel
Steps to reproduce:1. Configure peripheral, i.g. UART or SPI to work with DMA2. Go to NVIC Settings Tab at peripheral. By default all interrupts are enabled. Interrupts generated by peripheral itself can be disabled by unchecking respective checkboxIn order to disable DMA channel interrupt one has to go to NVIC peripheral and uncheck acheckbox called "Force DMA channel interrupts". IMHO, a need to go to seemingly unrelated place to enable a desired action, is a bad user interfacedecision. But it's not a bug.After the checkbox at NVIC is unchecked one can come back to NVIC Settings Tab at peripheraland disable DMA channel interrupt(s).3. Now the project can be saved and/or code can be generated and everything would bewritten to files as expected. Close project. So far so good.4. Open project again.DMA channel interrupt(s) are re-enabled. You can save project immediately after opening even without touching any other user interface element except File menu - the damage isdone already and
I'm using STM32CubeMX to develop an app for the STM32F030. I've done this many times and thought I understood the various issues - but I'm having a hell of a time getting a basic timer (TIM6) to run (interrupt-driven).The generated init code is: htim6.Instance = TIM6; htim6.Init.Prescaler = 0; htim6.Init.CounterMode = TIM_COUNTERMODE_UP; htim6.Init.Period = 816; htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; if (HAL_TIM_Base_Init(&htim6) != HAL_OK) { Error_Handler(); }Then I start it with this: (The GPIO is for debugging - see below).HAL_GPIO_WritePin(TP5_GPIO_Port, TP5_Pin, GPIO_PIN_SET); //!!! HAL_GPIO_WritePin(TP5_GPIO_Port, TP5_Pin, GPIO_PIN_RESET); //!!! // Start the system timer HAL_TIM_Base_Start_IT(&htim6); HAL_GPIO_WritePin(TP5_GPIO_Port, TP5_Pin, GPIO_PIN_SET); //!!! HAL_GPIO_WritePin(TP5_GPIO_Port, TP5_Pin, GPIO_PIN_RESET); //!!!Finally, my interrupt handler simply asserts a GPIO test point and increments a global variable:/**
Im having problems with DMA SPI transmit. Im using stm32f429zi mcu and would like to implement SPI DMA with MOSI only, I dont need MISO. SPI and DMA configuration was generated using CubeMX. Using HAL_SPI_Transmit function SPI works great. But HAL_SPI_Transmit_DMA does not send anything and gets stuck in while loop where it checks HAL_SPI_STATE_READY flag. HAL_SPI_Transmit_DMA returns HAL_OK. I am thinking that I have missed something in configuration but I havent been able to figure it out yet. If I create data to receive buffer and use HAL_SPI_TransmitReceive_DMA it also does not send anything but it doesnt get stuck in loop as spi status is ready.Im monitoring MOSI and SCK pin with logic analyzer.Here is my codePeripheralInit.c:void MX_SPI5_Init(void) { /* SPI5 parameter configuration*/ hspi5.Instance = SPI5; hspi5.Init.Mode = SPI_MODE_MASTER; hspi5.Init.Direction = SPI_DIRECTION_2LINES; hspi5.Init.DataSize = SPI_DATASIZE_8BIT; hspi5.Init.CLKPolarity = SPI_POLARITY_LOW;
I'm using a stm32f469-disco in a project that require CAN bus connectivity, but after the CAN configuration from the file .ioc the hal_can source file is not imported, so i can't even build the project (error with HAL_CAN_Init).
Hi,I'm trying to read data from the SPDIF-input of the STM32F466 using the CubeMX-generated code. The idea is to get one interrupt/callback for every pair of audio samples which arrive. This looks good so far, there is a function HAL_SPDIFRX_RxCpltCallback() which has o be overwritten in own code section.Now the question is: when this callback is called, how can I get the related data? Is there an other function to get these data or do I have to read some registers directly?Or more generic: is there a manual available that describes these CubeMX-generated functions?Thanks!
Goal: Create a filesystem on SD-card with the SDMMC-interface.The guide here (which should not differ for this MCU) features DMA-settings, which the L5 does not have. It seems as if a bunch of functionality is missing. Why can't I enable DMA for the SDMMC-interface?No DMA-tab visible Brute-forcing it returns `FS_NOT_READY` and measuring the clock-pin (which should carry a signal for **any** data-transfer) stays idle. I'm assuming that a function is calling a non-implemented weak function which doesn't actually do anything. Is there any way to run the SDMMC-peripheral manually on the L5?
Posted on June 13, 2018 at 18:09https://community.st.com/tags♯/?tags=stm32cubemx.‌https://community.st.com/tags♯/?tags=eeprom%20emulationI'm adding emulated EEPROM support to a project that is being built with the STM32F429ZITx processor. I am able to include the sample code, and I am able to get it to work, but the only way I am able to preserve the data after loading a newly built version (i.e. flashing a new image through the debugger) is to manually modify the flash.ld file to carve out a sector for EEPROM:MEMORY{RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192KCCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64KVECTOR (rx) : ORIGIN = 0x8000000, LENGTH = 16KEEPROM (rx) : ORIGIN = 0x8004000, LENGTH = 48KFLASH (rx) : ORIGIN = 0x8010000, LENGTH = 1984K}The issue I have is that every time I run the STM32CubeMX software to re-generate the code, it overwrites my changes. Is there any configuration option in the cube software (Version 4.25.0) that will allow me to speci
Hello, I have a very basic setup of OSPI1 on STM32H730VBT and I am trying to read the 1st Status Register of the Winbond W25Q128JV.EnvironmentSTM32CubeMX: 6.5.0STM32Cube_FW_H7_V1.10.0STM32CubeIDE Version: 1.9.0 Build: 12015_20220302_0855 (UTC)HardwareA custom board with STM32H730VBT and Winbond W25Q128JV connected via OSPI1.CodeGenerated OSPI init codevoid MX_OCTOSPI1_Init(void) { /* USER CODE BEGIN OCTOSPI1_Init 0 */ /* USER CODE END OCTOSPI1_Init 0 */ OSPIM_CfgTypeDef sOspiManagerCfg = {0}; /* USER CODE BEGIN OCTOSPI1_Init 1 */ /* USER CODE END OCTOSPI1_Init 1 */ hospi1.Instance = OCTOSPI1; hospi1.Init.FifoThreshold = 1; hospi1.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE; hospi1.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON; hospi1.Init.DeviceSize = 24; hospi1.Init.ChipSelectHighTime = 1; hospi1.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE; hospi1.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0; hospi1.Init.WrapSize = HAL_OSPI_WRAP_NOT_SUPPORT
..
When I develop with a nucleo/disco board, I have to keep a pinout of the board handy and map back and forth between CubeMX package pin names and board pin names. Since I've already selected the board in the CubeMX path, shouldn't there be a "Pinout" option to show board pin names? Or did I miss an option somewhere?Thanks!
I'm trying to get the STM32 USB training "09.8 USB MSC device labs tutorial" (https://www.youtube.com/watch?v=GjQqZd1keBo) working on a STM32H7A3 Nucleo board. The tutorial is for a STMF4xx but it seems like it should work on my H7A3 Nucleo if I start with a H7A3 project in CubeIDE. My project compiles and runs in CubeIDE but no USB drive enumerates on my PC.The example expects a full speed USB device and my Nucelo only has a high speed USB in CubeMX so I've tried setting the USB_OTG_HS to full speed (12 MBits/s) and high speed (480 MBits/sec) but neither one enumerates a drive. Other than that, I don't see any device specific code but I'm sure I'm missing something.Single stepping through my program, it times out at this loop in stm32h7xx_ll_usb.c. do { if (++count > 200000U) { return HAL_TIMEOUT; } } while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST);Any ideas will be greatly appreciated. Thanks
1. B-L475E-IOT01A1 kit connectivity with AWS.2. Modification its AWS connectivity parameters.3. Creation of AWS connectivity parameters.4. STM32Cube MX support with AWS cloud APIs5. Example programs and documents I just purchased B-L475E-IOT01A1 kit. Till now I did not update its firmware and using factory program.I tried to connect AWS cloud service but by mistake I changed its TLS security keys as well as Root Certificate files by serial terminal. Now I am not able to create new TLS and RC from Amazon site.Please suggest what should I do to restore TLS and RC files.Also suggest how can I create and use example projects for this kit by STM32Cube MX.Documentation of this kit for AWS cloud is also not available.
What's the difference between "aci_gatt_update_char_value" and "aci_gatt_write_char_value"?In addition, what is "aci_gatt_write_without_resp"? Is it faster than others to send data?How can I active "aci_gatt_write_without_resp"?, because it is inactive in STM32cubeMX during the BLE setup.
HI,I am working on STM32F413zh and i am trying to enable FSMC_NL gpio pin. I dont't know what is the purpose and how to enable this pin in STM32cubeMX. Please give me the support.Thankyou.
Hello,I'm using StmCubeMX 6.5.0 with StmCubeIDE 1,9.0.I'm trying to set up ADC1 channel 7 (PA2 pin) in polling mode on STM32U585QII device.HAL_ADC_GetValue is always returning 0 while it should return something else.Below is a simple main function:int main(void) { /* USER CODE BEGIN 1 */ uint32_t adc_value; /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* Configure the System Power */ SystemPower_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_ADC1_Init(); /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1
Hi,Iam student on Sheffield hallam university and I called by sulaiman Alsaffar discover bug when working on stm32f407 discovery board. This bug set the 5v for the vbus low which make it unactive in patch 6.4.0 .I had to read all folder that generate by the mx usb drive to fix this problem since it wont let you use usb because it wont get enough voltage and it not mentioned anywhere and wasn't there before. Fixing the issue with USB MSC The USB Mass Storage Class was not working because of insufficient voltage supply toVBUS. It was figured out that the usbh_platform.c file generated by the CubeMX software washaving issues.By making necessary modifications, the expected outcome was obtained.Before fix/***@brief Drive VBUS.* @param state : VBUS state* This parameter can be one of the these values:* -1: VBUS Active* -0 : VBUS Inactive*/void MX_DriverVbusFS(uint8_t state){uint8_t data - state;/* USER CODE BEGIN PREPARE_GPIO_DATA_VBUS_FS */if(state == 0){/* Drive high Charge pump */data -
Steps to create on my system (no user code required):Create a project for STM32H723VGT6 using the New Project wizard. Accept all default settings.Build - Download to Target - Run. Everything works as expected.Open IOC file. Go to System Settings->Sys and change Timebase Source to a Timer module (I use TIM6 but all appear to fail).Re-build - Download to Target - Run. The code gets stuck in an infinite loop immediately after the Timer interrupt is enabled.This works correctly on CubeIDE 1.6.0, so what has regressed on 1.9.0?
I set TIM2 as the timebase and then enabled full hal assertion via STM32cube. It asserted in ../Drivers/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_cortex.c:197Stack trace:Thread #1 (Suspended : Signal : SIGINT:Interrupt) assert_failed() at main.c:455 0x8002ff4 HAL_NVIC_SetPriority() at stm32l1xx_hal_cortex.c:197 0x8000782 HAL_InitTick() at stm32l1xx_hal_timebase_tim.c:50 0x80030ca HAL_RCC_ClockConfig() at stm32l1xx_hal_rcc.c:956 0x8001546 SystemClock_Config() at main.c:279 0x8002f40 main() at main.c:185 0x8002f54I think it's because HAL_InitTick() in .../Src/stm32l1xx_hal_timebase_tim.c does not set uwTickPrio unlike the original in .../Drivers/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal.c
Sorry for my silly questions ,but i am having a hard time understanding the exclamation marks in cubeMX .if somebody could please guide me here .it will be much appreciated.Example:the RCC is shown as partically disabled.i have use LSE (crystal/ ceramic Resonator ) as a mode However i should be able to use it.and i get this warning (statut: partly disabled conflict USART2 asynchrone).Exemple2:i want to use USART2 and configure PA as GPIO-EXTI (INTN DIR for my sensor TDC_GP30 pin name (pin 22)) is that possible or not ??
As showed in captures, the cloce source of cortex system timer is AHB/8 but not core clock and the frequency of systick is 22.5Mhz. However the generated clock source is Processor clock (AHB) not AHB/8.Is this CUBEMX BUG ?? 0x07=0111bBit 2 CLKSOURCE: Clock source selectionSelects the clock source.0: AHB/81: Processor clock (AHB)
I'm working with the STM32L4 Nucleo-64 Development Board and compiling with STM32CubeIDE 1.6.1. I have created a project using STM32CubeMX that I then imported into STM32CubeIDE. Hence, my linker script file was generated by STM32CubeIDE. Whenever I compile, my resulting (hex or binary) firmware file contains 96 bytes starting at address 0x20000000. Where do those bytes come from and what's the purpose of them?
Hi community,I have a serious problem with this microcontroller STM32L051K6U6TR. I have created a code using STM32CubeIDE and based on STM32CubMX wizard creator, however, the clock is set up to match the microcontroller & its peripherals (USART, I2C, ..) clock requirements as shown this photo : The generated code is compiled and flashed to the microcontroller without any error. I just tried this code : thr problem is that the microcontroller gets crached. After debugging the code, I released that this issue is coming from HAL_Delay, because if I try the code without it, the proble is gone. Finally, I released that any call of a function or setting that uses the Clock of the CPU, the craching of the code occurs. I played a lot with the clock configuration in CubeMX to solve it but the same problem is still there, because I'm still thinking that maybe the clock setting generated by the CuBeMX is not supported physically by the microcontroller.Did anyone face a simular issu
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.