Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I’m seeing that the X-CUBE-FREERTOS packege is being updated to 1.6.0 to support FreeRTOS 11.2From the changelog it says that it’s restricted to - Restricted to processor vendor: STMicroelectronics:13 - Restricted to processor name matching: STM32H5*|STM32U5*|STM32C0*|STM32WBA*|STM32U0*|STM32N6*|STM32U3*Are there any plans to bring to STM32H7* as well?
Hello,I'm looking for advice / help with Trust-Zone enabled project. I'm just getting started with Trust-Zone so there is a bit of a learning curve I guess, and a lot I dont know. I'm debugging in VSCode. Debug config shown at bottom of message. To start, I programmed TZEN for my STM32U575 to 1, but no read out protection is enabled. The secure part of the project, which runs first (its ISR table is at 0xc000000 ) only does a handful of things currently, including running this - it is stock standard STM code I think.static void NonSecure_Init(void) { funcptr_NS NonSecure_ResetHandler; SCB_NS->VTOR = VTOR_TABLE_NS_START_ADDR; /* Set non-secure main stack (MSP_NS) */ __TZ_set_MSP_NS((*(uint32_t *)VTOR_TABLE_NS_START_ADDR)); /* Get non-secure reset handler */ NonSecure_ResetHandler = (funcptr_NS)(*((uint32_t *)((VTOR_TABLE_NS_START_ADDR) + 4U))); /* Start non-secure state software application */ NonSecure_ResetHandler(); } When I start
Hello there!It would be really great if someone can look into this.I even tested it by reading the state of the pin and the MCU detected when the button was pressed, however when I set it up to use EXTI, its not detecting the interrupt. Could there be something wrong with the IC?Any help would be greatly appreciated. /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ---------
Hello, I am trying to setup TIM5 channel 1 to output a signal on its output pin. I generated the code using STM32CubeMX2. I am getting an assert failed during initialization.mx_system_init() calls mx_tim5_init() which calls HAL_TIM_OC_SetConfigChannel(): oc_config.polarity = HAL_TIM_OC_HIGH; oc_config.idle_state = HAL_TIM_OC_IDLE_STATE_RESET; if (HAL_TIM_OC_SetConfigChannel(&hTIM5, HAL_TIM_CHANNEL_1, &oc_config) != HAL_OK) { return NULL; } In HAL_TIM_OC_SetConfigChannel function assert fails at the following line: ASSERT_DBG_PARAM(IS_TIM_OC_OVERRIDE_STATE(p_config->override_state)); ASSERT_DBG_PARAM(IS_TIM_OC_BREAK_MODE(p_config->break_mode));The value of the override_state shown by the debugger is: (HAL_TIM_OC_OVERRIDE_SET | unknown: 0xfa). If I comment out the assert it will assert on the next line (break_mode). If I comment that line out as well the code outputs a signal on the pin. I attached my MX2 file. What am I missing?-Gil
Hi everyone, I have successfully set up a camera and the NPU working together on a Nucleo N6 to get proper outputs from the latter, which is great. I also have a way to see the image and can verify the outputs live.However, that only works when I launch the firmware by adding the Application to the startup, loading its symbols, flashing the trusted application and starting to debug the FSBL… After that starts, I can detach the debugger to let it run the application. (BOOT0 off, BOOT1 on)When I now flash both trusted binaries and launch without the debugger (BOOT0 and BOOT1 off) it starts normally and I see the live image. But there are no inference results (which takes the same amount of time as when it worked)… What could I be missing?Best regards, rphii
Hello,I am facing an issue with the STM32C5 HAL SPI driver related to CRC error detection.In my setup, CRC is enabled for SPI. When a CRC error occurs, I can observe that the CRCERR flag is set before the transfer is closed. However, the CRC error is never reported via the HAL error callback.Looking into the HAL implementation, I noticed the following behavior:SPI_CloseTransfer() calls LL_SPI_Disable()After disabling SPI, SPI_CloseTransfer() checks LL_SPI_IsActiveFlag_CRCERR()When this check is performed after LL_SPI_Disable(), the CRC error is no longer detectedIf I move the LL_SPI_IsActiveFlag_CRCERR() check before LL_SPI_Disable(), the CRC error is detected correctlyAdditionally, in my case SPI_CloseTransfer() is called from HAL_SPI_IRQHandler(), but:the return value of SPI_CloseTransfer() is not evaluatedonly the Tx/Rx complete callback is invokedmy error callback is never called, even though a CRC error has occurredFrom my understanding:LL_SPI_Disable() itself does not clear the C
Hello,I am using a STM32G474 and the RTC is counting >24.I have setup the RTC with the STM32CubeMX. regards Mark,
My design requires a microSD with the G474RE MCU. The Eval board schematic shows the design and some code in the \driver\BSP. However, I do not see the application example. My requirements are to read and write multiple data files. Where can I find an example with these features? Any other eval examples I can port over?
Hello everyone, I'm having issues with the Heap of the LWIP that is used/full, and I can't do any mem_malloc. I have dig a bit on why the log of LWIP tells me that it couldn't allocate memory ("etharp_raw: could not allocate pbuf for ARP request"). As far as i understand, the mem_malloc used the struct mem *lfree variable to handle the allocation for the LWIP and which is the next/previous chuck and also if the next chunk is being used or not. struct mem { /** index (-> ram[next]) of the next struct */ mem_size_t next; /** index (-> ram[prev]) of the previous struct */ mem_size_t prev; /** 1: this area is used; 0: this area is unused */ u8_t used; #if MEM_OVERFLOW_CHECK /** this keeps track of the user allocation size for guard checks */ mem_size_t user_size; #endif }; My issue is that the variable used in the mem struct is never null or zero. Which lead to the mem_malloc to always return NULL even after a fresh upload or power
Hi, I’m working with FATFS + SDIO + USB mass storage class.But I can’t seem to get writing and as a consequence reading working.in my main.c I do: //fatfs test makeFileData("test12.txt", "TEST123"); char* data = readFileData("test12.txt"); printf("read data = %s\r\n", data); And in my console I get as a response:D-SH 0 /System Volume Information---- 209 /x1_DEFAULT.JSON---- 211 /x2_DEFAULT.JSON---- 211 /x3_DEFAULT.JSON---- 211 /Ik_heb_iets_verzonne.JSONTotal blocks: 1922016 (961 Mb)Free blocks : 1921888 (960 Mb)SD Card Block size = 512SD Card Block number = 1953792SD Card size = 1000341SD Card Version = 1Init WVR complete!f_write failed: 1read data = So It can open the card and perform a ls command, but for some reason I can’t write. I spotted that some people look at DMA but I’m not using DMA.My entire SD card Handler:/* * SD_Card_Handler.c * * Created on: June 24, 2026 * Author: william.vanraemdonck */#include "WVR/SD/SD_Card_Handler.h"#incl
Hello,I’m struggling using STM32_USB_Device_Library V2.10.I’m developing a device with storage, and I want to transfer files via USB to a Windows PC using MTP.I currently have a simple setup using STM32H7B3 eval board. I have made a test project with STM32_USB_Device_Library using the USB HS.I have come so far that the device is showing up on the PC, and I can read contents (files) from the dummy file system on the device (currently I just fake the file system). Files are showing up correctly in File Explorer. I have 5 files, from 1K to 5K size, on the device.But when I try to transfer the files to PC, I only get 16 bytes of data. Size of file is showing correct in Windows Explorer for the device, but for the transferred file, it is only 16 bytes. It also does not contain correct data, only a chunk of the first data in the file.I have used usbd_mtp_if_template.c as start, and implemented the functions for reading file system data.The USBD_MTP_Itf_ReadData() looks like this:static uint3
Hi,I encountered problems during the development process of using FMAC. To illustrate the problem simply, I used FMAC to implement an RC filter, by which I mean to illustrate the calculation problems of FMAC.RC filter:10K+10nFIts discrete z-domain expression:(Ts=1e-6,Tustin)so I get fixed-point parameters :I referred to the example program of AN5305 and used a 1-us timer to trigger ADC sampling. After the ADC sampling is completed, DMA writes to the WriteData of FMAC, and then the ReadData is processed in the interrupt as follows:As shown above, my current ADC sample is 0, and my Vref is set to 800. I think the output of FMAC as an RC filter should be around 800 in the DC case, but actually it is not. It is a relatively small value. Why is that?May I ask if there is a problem with my configuration of FMAC?
I am seeing behavior on an STM32G474 that I cannot explain and would appreciate if anyone has seen this before.SetupMCU: STM32G474 (Nucleo-G474RE) COMP6 Positive input: PB11 (COMP6_INP / ADC1_IN14) Negative input: DAC2_CH1 HRTIM Fault 3 source: Internal Fault (FLT_Int) from COMP6 Fault filter: Disabled Fault counter threshold: 0 Fault polarity: Active HighDAC ConfigurationDAC2_CH1 configured as:Normal mode Connected to on-chip peripherals only Output buffer disabledRuntime code updates DAC2 every 1 ms:HAL_DAC_SetValue(&hdac2, DAC_CHANNEL_1, DAC_ALIGN_12B_R, dac_value);Verification PerformedVerified COMP6 configuration registers. Verified DAC2 DOR register contains expected value. Verified HRTIM Fault3 is the only enabled fault source. Disabled ADC sampling on PB11 (no change). Verified fault polarity behavior. Verified comparator output on a GPIO pin.ObservationWhen monitoring the COMP6 output pin directly, the comparator switche
It’s mentioned in RM0456 rev7 that manual trim must be done for device variants except STM32U535/545; U575/U585 Rev.X: However in CubeMX 1.8.0 manual trim is only applied for these devices, which only applies to half of the family: /* This is only needed for some devices/rev. */ if (((dev_id == 0x482UL) && (rev_id == 0x3000UL)) || ((dev_id == 0x481UL) && (rev_id == 0x2001UL)) || ((dev_id == 0x481UL) && (rev_id == 0x3000UL)) || ((dev_id == 0x476UL) && (rev_id == 0x1000UL)))For example my Nucleo-U5A5ZJ-Q board has dev_id=0x0481 and rev_id=0x3001 so the manual trim is not applied.Which one is correct ?
I am trying to do OTA programming modifications using the DUAL bank feature of my STM32U575 IC with 1Mbyte of memory.I have successfully done this when the program starts in BANK 1 and I reflash BANK 2. I change the User Option byte to OB_SWAP_BANK_ENABLE and the board reboots and successfully runs from BANK 2.Now, on the next firmware update, programming BANK 1 when I am operating from BANK 2 the HAL_FLASH_Program command fails on the first byte.The erase code is attached and it is very similar to others I have found on GIT for other products. Does the U5 have an inherent defect? any help would be greatly appreciated.
Title shortened from:"With the STM32U545RE, unable to erase the correct Flash Bank, using HAL_FLASHEx_Erase(), when attempting to switch from Bank2 to Bank1".Please keep the title short. Testing is done with the Nulceo-U545RE-Q board having 512KB Flash organized in two Banks. Each Bank has 32 pages of 8KB each. Flash Bank1: 0-31 pages. Flash Bank2: 32-63 pages. I could switch-over from Firmware-Version1 executing in Bank1 to Firmware-Version2 executing in Bank2. I verified that Firmware-Version2 was executing correctly even after hardware reset and power cycle.Attempting to switch-over from Firmware-Version2 executing in Bank2 to Firmware-Version3 executing in Bank1 fails as I end up erasing the Bank with the currently executing software(Firmware-Version2). I checked the setting of the SWAP_BANK bit and then erased the Bank, using the code below: /* Get the boot configuration status */ HAL_FLASHEx_OBGetConfig(&OBInit); /* Check Swap Flash banks statu
Hello team, Another day, new same issue. :pensive_face:I have setup the DCMIPP PIPE 1 for the stm32n6570 DK, so that it dumps frames in address 0x34200000 which maps to SRAM3 begin address I have enabled bothe the memories SRAM3 and SRAM4 but with out software erase, I used the MX tool for project generation , I goal is to mimic the Continous Mode example provided by ST, I have read about the appilication notes getting started with DCMIPP and the afew sections of intrest form the RM for the deve board on the topic. I however face the challenge as stated in the Post Title, there Is are no interrups being called yet I set up the global intterrups for both the Pixel pipe and the CSI interfacing, "Still as shown in in the generated files" and set the clocks for the DCMIPP is set to 300Mhz and the CSI interface I had to manualy try setting up the input clock freq for the IMX335 module to 20Mz as the MX tool does not provide for its setting, but I have this code commented out as there was
Hello,I am working with the STM32N6570-DK board and the MB1854B camera module.I am using the ST-provided example code:https://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/STM32N6570-DK/Applications/DCMIPP/DCMIPP_ContinuousMode This example works fine — I can display the live camera feed on the LCD.Now I want to enable the HDR (High Dynamic Range) feature of the MB1854B sensor.My questions are:Which part of the example code needs to be modified to enable HDR?Is there a register configuration to switch the sensor to HDR mode?Is there an ST-provided driver or initialization sequence for HDR mode example?I am looking for guidance or documentation on which registers to configure and where to modify the code so that the captured image is in HDR mode and displayed properly on the LCD.Thanks in advance!
I have a Nucleo-H753ZI board for testing purposes. I used CubeMX to configure SPI4 as a slave. You can see the configuration code below. SPI4_TX is assigned to DMA1 Stream 3, Medium priority, SPI4_RX is assigned to DMA1 Stream 0, medium priority.I have a SPI master attached to the SPI4 which works as intended, i checked that on the oscilloscope. The Master transmits 1 Byte, wait for 50µs, reads another 4 bytes and based on the content of that 4 bytes, continues to clock more bytes in or out. The clock frequency is 12,5 MHz and 680ns pause between each byte. In my testcode below, the globaldata[4] = 10; defines that 10 more bytes will be clocked by the master. So the entire frame will contain 15 bytes.I am now executing three different variations of code leading to surprising results. When calling HAL_SPI_Receive_DMA, the function HAL_SPI_RxCpltCallback is called as expected. When calling HAL_SPI_TransmitReceive_DMA, the function HAL_SPI_TxRxCpltCallback is called as expected. But when
7.3.4 FLASH read operations4. If the application reads … high-cycle data not previously written, a double ECC error is reported …When storing a variable amount of data to high-cycle flash, or dealing with setting up a new/blank MCU, the SW needs to check high-cycle flash which may be empty.I am looking for a good best-practice for how the flash is meant to be used. One option I am looking at disabled the ECC NMI (ironically) and checks if non-0xffs are present before clearing faults and re-enabling the NMI and reading the data.This only really works if it can be assumed the data is complete. It will still results in faults if data is not complete for some reason.Another option I can think of is handling the ECC NMIs and just allow normal reads, catch and clear ECC errors and report failure.Is there any solid recommendation on what to do? I can’t find any application note with examples.
The STM32G474RE support 3 FDCAN and that fit my design well. When I checked the nucleo board, the firmware does not have any CAN example. I searched the ST website, the user, programmer and reference manual do not have any information on the registers and their memory map information. Although I found “STM32 FDCAN running at 8 Mb/s on Nucleo boards” helpful, it does not give me enough information of the FDCAN 2 & 3’s interrupt vector location, calls, setup and etc. I need a example template to set up my FDCAN. Where can I find that?
When I was developing the stm32u575, I needed to set the threshold for the bor (power-on reset). I wanted the device to reset when the voltage was below a certain level. While configuring the bor threshold for the stm32u575, I followed the configuration process of the stm32f405, but it didn't work. The program got stuck at HAL_FLASH_OB_Unlock(). Why did this happen? What was the problem? FLASH_OBProgramInitTypeDef OBInit; HAL_FLASHEx_OBGetConfig(&OBInit); OBInit.USERType = OB_USER_BOR_LEV; OBInit.USERConfig = OB_BOR_LEVEL_1; HAL_FLASH_OB_Unlock(); HAL_FLASHEx_OBProgram(&OBInit); HAL_FLASH_OB_Launch(); HAL_FLASH_OB_Lock();
Hello ST team,I'm facing the issue with STM32N6 DCMI DMA configurations, I could see the data flowing down from the cmos & clocking at 50MHZ. I could spot the first 4 pixels data (2 words) on live watch window. the next word data is intermittent & getting into DMA error 0x41,The cube MX (6.17.0) unable to generate the DMA init functions appropriately for DCMI, however i’ve added the Config explicitly, Any suggestions on the below configurations? /*** @brief DCMI Initialization Function* @param None* @retval None*/static void MX_DCMI_Init(void){/* USER CODE BEGIN DCMI_Init 0 *//* USER CODE END DCMI_Init 0 *//* USER CODE BEGIN DCMI_Init 1 *//* USER CODE END DCMI_Init 1 */hdcmi.Instance = DCMI;hdcmi.Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;hdcmi.Init.PCKPolarity = DCMI_PCKPOLARITY_FALLING;hdcmi.Init.VSPolarity = DCMI_VSPOLARITY_LOW;hdcmi.Init.HSPolarity = DCMI_HSPOLARITY_LOW;hdcmi.Init.CaptureRate = DCMI_CR_ALL_FRAME;hdcmi.Init.ExtendedDataMode = DCMI_EXTEND_DATA_12B;hdcmi.Init.J
Dear Team,I am currently working on an application based on the STM32H563ZITx microcontroller using the NUCLEO-H563ZI development board.The application is designed as a gateway that communicates with another controller through a UART interface. The same UART interface is also used to program the target controller with firmware updates.For the software implementation, I am using STM32CubeH5 v1.6.0 and have adopted the Nx_Iperf reference project for the NUCLEO-H563ZI board to develop a web-based user interface.The following functionalities have been successfully implemented and tested:Reading data from the target controller via UART Writing data to the target controller via UART Firmware download and programming through the same UART interfaceHowever, I am encountering an issue when transferring firmware (.bin) files. The system appears to accept only about 54 KB of data, after which the transmission stops. As a result, I am unable to transfer larger firmware images.My application requi
I’m using stm32f103 timer cc event to trigger adc injected conv. But I failed. I can trigger it with timer trgo. This means my adc configuration is correct. LL_TIM_InitTypeDef TIM_InitStruct = {0}; LL_TIM_OC_InitTypeDef TIM_OC_InitStruct = {0}; LL_TIM_BDTR_InitTypeDef TIM_BDTRInitStruct = {0}; LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM1); TIM_InitStruct.Prescaler = 0; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_CENTER_UP_DOWN; TIM_InitStruct.Autoreload = 2249; TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; TIM_InitStruct.RepetitionCounter = 0; LL_TIM_Init(TIM1, &TIM_InitStruct); LL_TIM_EnableARRPreload(TIM1); LL_TIM_SetClockSource(TIM1, LL_TIM_CLOCKSOURCE_INTERNAL); TIM_OC_InitStruct.OCMode = LL_TIM_OCMODE_PWM2; TIM_OC_InitStruct.OCState = LL_TIM_OCSTATE_ENABLE; TIM_OC_InitStruct.OCNState = LL_TIM_OCSTATE_ENABLE; TIM_OC_InitStruct.CompareValue = 0; TIM_OC_InitStruct.OCPolarity = LL_TIM_OCPOLARITY_HIGH;
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.