Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello ST Community, I am working on STM32N6 with an IMX335 camera sensor, ThreadX + USBX, and trying to stream live camera video over USB Type-C (UVC) to an external screen / PC. Current status: - Camera + ISP + DCMIPP pipeline is working correctly - Live video is already displayed on the STM32N6 board screen - I want the same live video to be streamed via USB Video Camera / ISP configuration: - Sensor: IMX335 - Sensor output: RAW10 - ISP enabled and processing the RAW data - Frame size currently: 800 × 480 - Pixel size in memory: 2 bytes per pixel - DCMIPP is writing frames to memory using DMA My main confusion is: What is the exact output format from the ISP to memory?Is it RAW, RGB, or YUV (YUY2 / NV12), and how do we confirm this from the HAL / ISP configuration? USB UVC configuration I am using USBX Device Video (UVC) generated from CubeMX. CubeMX gives two main options for video streaming format: UNCOMPRESSED MJPEG UNCOMPRESSED: I understand this usually means YUY2 (YUV422) for U
I am using software Independent watchdog at STM32H735IGK and i want to freeze it when entering standby mode.I set option byte FW_IWDG_SDBY unchecked but unfortunately it is not working and my program keeps getting out from standby mode.My code:At init:MX_IWDG1_Init(); While the program is running:__HAL_IWDG_RELOAD_COUNTER(hiwdg); When entering standby: HAL_RTCEx_DeactivateWakeUpTimer(&hrtc); HAL_PWREx_ClearWakeupFlag (PWR_WAKEUP_FLAG_ALL); __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); __HAL_PWR_CLEAR_WAKEUPFLAG(PWR_FLAG_WKUP1); // E1 __HAL_PWR_CLEAR_WAKEUPFLAG(PWR_FLAG_WKUP4); // INT //Configuring wakeup pins PWREx_WakeupPinTypeDef sWakeupPin1; sWakeupPin1.WakeUpPin = PWR_WAKEUP_PIN1; sWakeupPin1.PinPolarity = PWR_PIN_POLARITY_LOW; // Flanco de bajada sWakeupPin1.PinPull = PWR_PIN_PULL_UP; HAL_PWREx_EnableWakeUpPin(&sWakeupPin1); PWREx_WakeupPinTypeDef sWakeupPin4; sWakeupPin4.WakeUpPin = PWR_WAKEUP_PIN4; sWakeupPin4.PinPolarity = PWR_PIN_POLARITY_LOW; // Flanco de bajada
Hey there at @Pavel A. I've implemented USBCDC as a device In stand alone mode successfully I intend on implementing CDC host stand alone that is to say without X-thread RTOS.The generated files from cube MX don't have Read_run and Write_run functions for stand-alone when implementing the host side which makes me wonder if it is achievable you to have USBx as a host in stand alone.
Hi everyone,I am working on a custom board based on the STM32F429I MCU (RMII mode) and I am trying to integrate LwIP with a DP83848 PHY.At the moment, I am unable to get Ethernet working. The issue appears during PHY initialization — the code blocks while trying to communicate with the PHY over MDIO.Project ContextMCU: STM32F429IPHY: DP83848 (RMII mode)Middleware: LwIPDevelopment tool: STM32CubeIDE (project originally generated with CubeMX, but I cannot re-generate it now due to version mismatch)ETH driver: HALI have tried:Using the LwIP stack with the HAL ETH driverAttempting raw Ethernet (without LwIP)In both cases, the system gets stuck during PHY initialization.Observed BehaviorThe code freezes when accessing PHY registers (MDIO communication).When debugging, execution appears to stop when checking or configuring the ETH clock.The PHY does not respond to register reads.Suspected CauseI suspect either:The RMII clock (50 MHz reference clock) is not correctly generated or routed.The P
Hi All, I have been using SPI1 over DMA2 on Zephyr RTOS recently to read my external flash. I had done similar thing on Bare metal / FreeRTOS based program. Both of them work fine. However, there is a problem in Zephyr based implementation of its driver compared with what i developed on Bare Metal. I configure the SPI1 to use its full possible clock 42MHz on both platforms. On my bare metal platform it runs at full 42Mbps but on Zephyr it starts giving read errors. However, if i reduce the clock to < 42MHz (to which zephyr driver forcelly rounds it down to 21MHz) it works fine.Here is my dts node of spi1 for my development board: &spi1 { pinctrl-0 = <&spi1_sck_pb3 &spi1_miso_pb4 &spi1_mosi_pb5>; pinctrl-names = "default"; clock-frequency = <42000000>; // 42MHz dmas = <&dma2 2 3 (STM32_DMA_PERIPH_TO_MEMORY | STM32_DMA_MEM_INC | STM32_DMA_PRIORITY_HIGH) STM32_DMA_FIFO_1_4>, <&dma2 3 3 (STM32_DMA_MEMORY_TO_PERIPH | STM32_DMA_M
I am using below component toolsMCU: STM32H750IBT6IDE: STM32CubeIDE Version: 1.20.0GUI: TouchGFX Version: 4.26.0SDRAM: IS42S32400J-6TLIFLASH: MT25QL512ABB8ESF-0SIT (QUADSPI) I have made my own external loader that proves works for the QUADSPI IC using this video: https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-moocs/external_QSPI_loader.html Thank you in advance!
Hi all,I am currently trying to merge the STM32N6 VENC_SDCARD Project with my Codebase that is based on the STM32 Modelzoo Object Detection (https://github.com/AlexGraefe/STM32N6CameraEvaluation). However, naively copy-pasting the code does not work. For most resolutions, the generated h264 streams are wrong and for the others, the code crashes at weird places e.g., when leaving a function. As the only difference between my code and the VENC_SDCARD example is the linker script, I was wondering if wrong memory allocations might be the reason for this. The heap in the object detection example is placed on AXISRAM1, which might too small. However, I am unable to place the heap onto other parts of the RAM (internal or external), without the program crashing directly upon startup.Copying the linker script provided by VENC_SDCARD also does not work as then, I run into compilation errors stating the code uses too much RAM (as buffers for images are placed in different regions).Moreover,
HiCan anyone please show me an example of a working USB CDC Host sending the SetControlLineState command? This hasn't been implemented in the STM32 HAL drivers/middleware but it should be a simple thing to add.SetControlLineState is used to signal the Host is ready to receive data from the CDC device. I tried adding and calling my own routine after the USB enumeration completes:USBH_StatusTypeDef USBH_CDC_SetControlLineState(USBH_HandleTypeDef *phost) { phost->Control.setup.b.bmRequestType = USB_H2D | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE; phost->Control.setup.b.bRequest = CDC_SET_CONTROL_LINE_STATE; phost->Control.setup.b.wValue.w = 3U; phost->Control.setup.b.wIndex.w = 2; phost->Control.setup.b.wLength.w = 0; return USBH_CtlReq(phost, 0, 0); }The transmitted data appears to be correctly formed but the phost->RequestState appears to get stuck on CMD_WAIT expecting a reply from the device which I understand is not part of the CDC proto
Hi,I am using Nucleo-L476RG. My I want to send data over SPI every 20000ms and during this 20000ms MCU will goes in sleep/standby mode. I want to keep track time of last 2 SPI data transmission.But the issue is HAL_GetTick() reset after waking up from standby mode. so not able to track the time between last two data transfer.
Hello I'm working with the STM32N6570-DK board to capture images using the IMX335. I want to save 480x800 images from PIPE1 of DCMIPP to External RAM. I've tried searching for examples on the STMicroelectronics Github, but most examples save to AXISRAM. Does anyone have simple example code or steps for doing this? Do i need to config xSPI first? or do i need to put something into ".ld" file?
Is there a build tool to insert two .hex files into my final image? I am retroactively updating an existing firmware by moving a bootloader I've created from an unused place in the updated image into its proper sector. But to do this, I need to insert the bootloader into the image I am updating with. (Update image contains existing code + boot image1 + boot image2) My main update image will be contained in sector 0 - 5. My first separately built bootloader.hex file must be squeezed into sector 6, and my second separately build bootloader2.hex must be squeezed into sector 7. I have found it is possible to use the linker file to insert raw hexadecimal bytes, but this requires converting the .hex file to an ascii hex array, copying it over and then building. Is there a command line build tool alternative to do this cleanly?
Hello, i am trying to store adc calibration data in flash on my H7A3 project.Writing the data (64byte, flash addr 16byte aligned) is successful (at least i hope, since i get no errors), but when reading the same data back from flash via that same Bank2 memory address, i only read zeroes.I was trying to use a same approach like the example program.Can somebody review my code and point me in the right direction?#include "stm32h7xx_hal.h" #include "stm32h7xx_hal_flash.h" #include "string.h" #include <stdint.h> #include "settings.h" #define FLASH_USER_START_ADDR FLASH_BANK2_BASE /* Start @ of user Flash area in Bank2 */ #define FLASH_USER_END_ADDR (FLASH_BANK2_BASE + FLASH_BANK_SIZE - 1) /* End @ of user Flash area in Bank2 */ // get flash sector number from address uint32_t GetSector(uint32_t Address) { uint32_t sector = 0; if (Address < (FLASH_BANK2_BASE + FLASH_BANK_SIZE)) { sector = (Address - FLASH_BANK2_BASE) / FLASH_SECTOR_SIZE; } else { sector = (Address - (FLASH_
Hi everyone, I'm having trouble jumping to the app from the bootloader.The application is located here, writing doesn't give me errors. So I assume the problem is Jump.#define FLASH_USER_START_ADDR ADDR_FLASH_SECTOR_2_BANK1 Il main del bootloader è costituito cosìint main(void) { /* USER CODE BEGIN 1 */ /* 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(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_QUADSPI_Init(); MX_SPI4_Init(); MX_I2C1_Init(); MX_RTC_Init(); MX_FMC_Init(); MX_USART6_UART_Init(); /* USER CODE BEGIN 2 */ HAL_GPIO_WritePin(ENABLE_3v3_WIFIPRINTER_uC_GPIO_Port, ENABLE_3v3_WIFIPRINTER_uC_Pin, GPIO_PIN_SET); printf("\
Hi ST Support Team,I'm developing a simple FSBL application (LED control) on a NUCLEO-N657X0-Q board to understand the boot management flow with FSBL and application separation.What I've done:Successfully tested the application running directly from RAM via debuggerCompiled the FSBL for external XSPI flash (linker configured for execution from AXISRAM2 at 0x34180400)Signed the binary using STM32_SigningTool_CLI with header v2.3, -nk flag (no keys), -of 0x00000000, and correct load address/entry pointProgrammed the signed binary to external flash at 0x70000000 using STM32CubeProgrammer with the appropriate external loaderConfigured BOOT0=LOW, BOOT1=LOW for boot from XSPI flashThe problem: The Boot ROM does not load the FSBL into RAM. When I read AXISRAM2 (0x34180000) after reset, it contains all zeros, indicating the Boot ROM is rejecting or not attempting to load the FSBL.What I discovered: In STM32CubeProgrammer → OTP MPU tab, I see:BSEC State: SecuredGlobal State: 0x00000001Additiona
Hello,I'm encountering a problem with the STM32G0B0 (also applicable to the STM32G0B1RE) when using flash memory in single bank mode.My application requires single bank mode, but when I use the erase function to erase pages (from both bank 1 and bank 2), it erases the wrong page.using the "FLASH_EraseProgram" example provided on the STM32CubeFw with the updates below:Define bank 2 user pages address in main.h #define ADDR_FLASH_PAGE_128 ((uint32_t)0x08040000) /* Base @ of Page 128, 2 Kbytes */ #define ADDR_FLASH_PAGE_129 ((uint32_t)0x08040800) /* Base @ of Page 129, 2 Kbytes */ #define ADDR_FLASH_PAGE_130 ((uint32_t)0x08041000) /* Base @ of Page 130, 2 Kbytes */ #define ADDR_FLASH_PAGE_131 ((uint32_t)0x08041800) /* Base @ of Page 131, 2 Kbytes */ Update "FLASH_USER_START_ADDR" and "FLASH_USER_END_ADDR" #define FLASH_USER_START_ADDR ADDR_FLASH_PAGE_126 /* Start @ of user Flash area */ #define FLASH_USER_END_ADDR (ADDR_FLASH_PAGE_131 + FLASH_PAGE_SIZE - 1) /* End @ of user
Hello everybody. I'm trying to make LWIP work on NUCLEO-H723ZG board, but I can't even get a ping response so far, even with static (DHCP disabled) network configuration. The project uses FreeRTOS (CMSIS API v2) and is created with MX tool. It seems to be an ARP problem, since there is no ICMP request from my PC when I execute the ping command (checked with Wireshark). Did anyone face similar issues using an environment like this? Attached is the output generated by LWIP, as well as the project configuration file and linker script. Any help will be greatly appreciated. Thank you!
Hi,I’m working with a custom PCB based on an STM32H743BI and an external MT25TL01G memory device.To manage the data I’m using FileX + LevelX. I’m able to create the media, create directories, create files, write to them, and read them without issues. However, I’m running into a problem when trying to read files after a reset.After formatting the media with:fx_media_format(&pFileManagerDesc->fxFileMedia, fx_stm32_levelx_nor_driver, (VOID *)LX_NOR_QSPI_DRIVER_ID, (UCHAR *) mediaBuffer, sizeof(mediaBuffer), QSPI_VOLUME_NAME, QSPI_NUMBER_OF_FATS, 32, QSPI_HIDDEN_SECTORS, ((LX_STM32_QSPI_FLASH_SIZE - LX_STM32_QSPI_SECTOR_SIZE) / QSPI_SECTOR_SIZE), QSPI_SECTOR_SIZE, 8, 1, 1); I open the media and try to read from it, but I always the error FX_NO_FOUND trying to open the file.This doesn’t happen if I create a file first. I’m not sure if I’m missing a step before reading the media after formatting.I’m not performing any erase operation because I have: LX_S
Hi!I’m asking for your recommendations :I would like to integrate the DCMIPP continuous example to add a photo capture and recording feature to the SD card through a button.I have already configured the SD card using CubeMX, and now I want to integrate the DCMIPP continuous example and then continue adding my own contributions.Is there another example that would be more appropriate to use as a base?Because I prefer to use CubeMX, but with the DCMIPP example I find myself having to manually add all the libraries to my project < as it comes without cubemx>, and at the moment I see that some libraries are not recognized despite that I added them with all the paths.Do you have any suggestions for what I want to do?Thanks in advance
Hi, I am on stm32u585 IOT dev board for low power modes am using RTC wakeup the sleep and stop 1,2 and 3 are working fine but standby and shutdown is not working ? my code void sleep(int mode, int seconds ) { if (seconds <= 0) return; HAL_RTCEx_DeactivateWakeUpTimer(&hrtc); __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&hrtc, RTC_FLAG_WUTF); uint32_t wakeup_counter (uint32_t)(seconds 2048); HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, wakeup_counter, RTC_WAKEUPCLOCK_RTCCLK_DIV16, 0); switch (mode) { case 0: // Sleep HAL_SuspendTick(); HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI); HAL_ResumeTick(); break; case 1: // Stop0 HAL_SuspendTick(); HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI); break; case 2: // Stop1 HAL_SuspendTick(); HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); break; case 3: // Stop2 HAL_SuspendTick(); HAL_PWREx_EnterSTOP3Mode(PWR_STOPENTRY_WFI); break; case 4: // Standby __HAL_PWR_CLEAR_FLAG(PWR_WAKEUP_ALL_
Post Edited by ST moderator to apply source code formatting Hi ST Community,I am using STm32U575VGTX. I configure RTC as default, enable RTC non-secure interrupt, activate alarm A trigger each 10 seconds as below: ******************************************* static void MX_RTC_Init(void) { /* USER CODE BEGIN RTC_Init 0 */ /* USER CODE END RTC_Init 0 */ RTC_PrivilegeStateTypeDef privilegeState = {0}; RTC_TimeTypeDef sTime = {0}; RTC_DateTypeDef sDate = {0}; RTC_AlarmTypeDef sAlarm = {0}; /* USER CODE BEGIN RTC_Init 1 */ /* USER CODE END RTC_Init 1 */ /** Initialize RTC Only */ hrtc.Instance = RTC; hrtc.Init.HourFormat = RTC_HOURFORMAT_24; hrtc.Init.AsynchPrediv = 127; hrtc.Init.SynchPrediv = 255; hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; hrtc.Init.OutPutPullUp = RTC_OUTPUT_PULLUP_NONE; hrtc.Init.BinMode =
Hi,on STM32F429I-DISC the timer TIM2 kicks ADC1 and the data goes to buffer via DMA. APB1 clock for TIM2 is 36MHz, reload value for TIM2 is 143, I exspect 36e6/144= 250k samples/second.I get 8.3e6 samples in 123 seconds which results in 67.4ks/s. This is factor 3.7 low, not even an integer ratio.There is a clock issue for the 48MHz, see enclosed .ioc What do I miss?THX CheersDetlef
Hello, I have a Nucleo-H723ZG that I am trying to setup a Continuous running ADC that fills a buffer VIA DMA. I have read tutorials, watched videos, looked at the data sheets and still can't get it working.Tools: CubeMX to generate code VScode to compile and debug code Hardware: NUCLEO-H723ZGGoal: I am trying to have the ADC Continuously trigger and fill the DMA buffer overwriting the old values. I'm not attempting to trigger from a timer or any external means. I just want to start the ADC and it be free running. Then I'll handle the data in the buffer else where. Currently: I can't get anything to happen. The ADC works fine if I set it up for polling and I get correct ADC values. If I set it up for DMA continuous the buffer never gets any values and the ISR HAL_ADC_ConvCpltCallback() never fires. (I used a debug break point inside the isr) Update: I found that if I check the ADC_HandleTypeDef hadc1 while de
Searching through the forum it seems like there are tens of posts regarding this topic. I read many of them, but I struggle to find a solution that applies to me.First of, I use an STM32H743VIT.My goal: Use ADC1 and ADC2, one channel each. The two ADCs should be tied together. The whole conversion should be triggered by TIM4 update event and the data should be moved via DMA.What works: If I just use TIM4 and two DMA streams that move the data for each ADC individually, it works. As soon as I try to use the dual mode, it does nothing.When I'm in dual mode I have confirmed that the timer is still running. TIM4->CNT is changing. I've spent almost two hours with the debugger in the SFR and checked the registers. I'm not sure if I'm close to the issue, but there is something that seems suspicious based on the research I did: DMA1->S0NDTR->NDT does not change, indicating that the DMA stream does nothing. However ADC1->CR->ADSTART is at 0x1, indicating that it tries to do somet
Hello,I implemented the How to use SNTP over LwIP and RTC with an STM32 - STMicroelectronics Community example (not using FreeTOS) in the suggested STM32H723ZG NUCLEO-144 board. The app runs, but when it tries to allocate memory for DHCP with the mem_memalloc() function in dhcp:start (dhc.c lib file) it always returns null pointer. I t can't allocate memory for DHCP structure, the dhcp pointer is always 0 and dhcp_start() always returns with ERR_MEM error.dhcp_start(struct netif *netif) { struct dhcp *dhcp; ... /* no DHCP client attached yet? */ if (dhcp == NULL) { dhcp = (struct dhcp *)mem_malloc(sizeof(struct dhcp)); if (dhcp == NULL) { return ERR_MEM; } ... }In STM32H723ZGTX_FLASH.ld I have:MEMORY { ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 320K RAM_D2 (xrw) : ORIG
I am new to ThreadX. I have had experience with FreeRTOS generated with CubeMX.However, I have been starting over repeatedly with CubeMX. Just trying to create a base project with Nucleo-F767Zi.I need to find some documentation for starting this process. I am missing something.Thanks,Greg
ST Community highlights – April to June 2026
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.