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
Resuming studies, regarding:I'm resuming my STM32 studies, having not used them for a few months.After this time, and updates to CubeID and CubeMX, I'm trying to get back to it using the Nx_webserver example. Although the code appears to be correct, it doesn't work; it doesn't even get a valid IP address in DHCP.I've tried changing the MAC address, but even then, nothing in DHCP works.Is there anything I should do to make it work?I have the following console output: ------------------------------------------------------------------- STM32CubeProgrammer v2.20.0 ------------------------------------------------------------------- Log output file: /tmp/STM32CubeProgrammer_q4oXBH.log ST-LINK SN : 066EFF353445503043075718 ST-LINK FW : V2J46M31 Board : NUCLEO-F429ZI Voltage : 3,23V SWD freq : 4000 KHz Connect mode: Under Reset Reset mode : Hardware reset Device ID : 0x419 Revision ID : Rev 5/B Device name : STM32F42xxx/F43xxx Flash size : 2 MBytes Device type : MCU Device CPU : Cortex-M
I'm developing a bootloader for a project using the STM32H563VGT6 with 1MB of internal flash memory. I've developed a bootloader in the past for STM32H743 which works correcty.In this H5 bootloader I seem to have problems writing to the internal flash memory. Below is the code I have to write a block of data to flash memory.uint32_t Flash_Write_Data (uint32_t StartSectorAddress, uint32_t *data, uint16_t numberofwords) { static FLASH_EraseInitTypeDef EraseInitStruct; uint32_t SECTORError; int sofar=0; /* Unlock the Flash to enable the flash control register access *************/ HAL_FLASH_Unlock(); /* Erase the user Flash area */ /* Get the number of sector to erase from 1st sector */ uint32_t StartSector = GetSector(StartSectorAddress); uint32_t EndSectorAddress = StartSectorAddress + numberofwords*4; uint32_t EndSector = GetSector(EndSectorAddress); /* Fill EraseInit structure*/ EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS; EraseInitStruct.Sector = Sta
ADC1 clocked @ 65 MHz, prescalar 0 for divide by 1, continuous conversion, DMA circular mode, 640.5 cycle sampling time, 256x oversampling, 12-bit resolution, 3 channels per sequence. The channels in the sequence are: IN3, temp sensor channel, Vrefint channel. I would expect a sequence to be converted in (3 * 256 * (640.5 + 12.5)) / 65000000 => ~7.7 ms.HAL_ADC_ConvCpltCallback() increments a counter for TC and HT. In 120 seconds (used debugger to stop) I get 60102. TC count = 60102/ 2 = 30051 for 120 seconds or 3.9 ms average/sequence. HAL_ADC_ErrorCallback() never called.Why the discrepancy: 7.7 ms expected vs 3.9 ms observed?MX_ADC1_Init() looks like…static 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 */ /* USER CODE END ADC1_Init 1 */ /** Common config */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; hadc1.Init.Resolution =
I need to calibrate STM32l431 RTC in software for using LSI clock. When I compare STM32 RTC with GPS reference I get the following GPS 1759492828 1759493307 => RTC 1759500022 1759500494Diff GPS: 479 secondsDiff STM32: 472 seconds=> 7 seconds = 1.48% difference andPrefered frequency to RTC 32473 I thought smooth calibration could be used for this kind of calibration but it seems it can only calibrate small changes for crystal.Any ideas how this can be done? I cannot modify PCB for external pulses, I need to correct in software. Clock will be syncronised 8, 16 and 24 hours interval, so accuracy does not need to be like a crystal.
Hi In the past 6 months, I created a project for an STM32H755. For middleware, I selected CMSIS RTOS v2 (using FreeRTOS underneath).I noted that the header file is cmsis_os.h, which at first seemed wrong. I (maybe naively) asked the "AI", and with it's usual confident tone, suggested I change them (however, this is hard to maintain if you change your .ioc file).Looking at past posts on these forums, and inside cmsis_os.h, I confirmed that cmsis_os2.h is indeed included within it (despite the AI not finding this).So, I challenged the "AI", stating what I had found. Of course, in it's somewhat complimentary way, it agreed with me, but still insisted that if I am using entirely v2 APIs, I should change the headers.Of course, such responses derive from human content written elsewhere, and I fear it may not backed by actual facts. I have left the headers as they are for now. I have a bad feeling about changing them as ST might have reasons to do things the way they have. So, is it
Hi all, STM32 start executes the following during startup in main.c:HAL_Init();SystemClock_Config();Initialize all configured peripherals (e.g., MX_GPIO_Init())Enter the main while loopHowever, I've observed a cold-start issue:If the power supply is disconnected for 3–5 seconds or more, the system hangs and never reaches the main while loop after reboot.If the supply is disconnected for a short interval or a manual reset is applied, the system boots normally.While debugging, I suspected that the LSE/LSI/HSI oscillators might need more time to stabilize.Looking into HAL_RCC_OscConfig(), it waits for the HSI to be ready by checking RCC_FLAG_HSIRDY with a timeout mechanism: /* Get Start Tick */ tickstart = HAL_GetTick(); /* Wait till HSI is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == 0U) { if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE) { return HAL_TIMEOUT; } } When I set a breakpoint here, I noticed:tickstart is always 0HAL_GetTick() always returns
We have developed a custom board based on an eval board that has a LoRa transceiver and an RFID tag reader connected to two UARTs of the MCU. A serial console is also connected to a third UART. DMA streams are configured for the LoRa and RFID UARTs, and for Ethernet. The software application uses FreeRTOS and has an Ethernet stack implemented using LwIP. The app responds to UDP commands received by the device, which trigger interactions with the LoRa or RFID devices.The application works as expected when a USB J-Link JTAG interface is connected to the board, whether using the debugger, or just running. However, if the board is powered on without the USB J-Link attached, Ethernet does not work. The board does not receive any UDP packets or even respond to pings. The LEDs still flash, indicating that the main thread is still running.Any suggestions?
After solving my issue with reading the USER1 button (thanks to everyone who helped me on this forum :folded_hands:), I am now trying to handle USER1 button detection using interrupts.My project is running in FSBL mode, so I’m using NVIC FSBL. I’m trying to configure the USER1 button (EXTI13) with a pull-down in CubeMX. …but unfortunately without success.what is wrong ? in my configuration in CubeMX ? Cheers Emmanuel my code stm32n6xx_it.c : with void EXTI13_IRQHandler(void)/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file GPIO/GPIO_IOToggle/Src/stm32n6xx_it.c * @author MCD Application Team * @brief Main Interrupt Service Routines. * This file provides all exceptions handler and * peripherals interrupt service routine. ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All
Hello everyone! I'm working on an application using AzureRTOS and FileX, however, I'm getting a hard fault that I can't pin down.Here is a screenshot of the variable states when entering _fx_directory_search (in middleware fx_directory_search.c) which causes the hard fault. It seams to occur as the function is called. (Not sure why the resolution is bad but don't think there is anything I can do about it I'm sorry!)I'm seeing a lot of 0x0 in the function arguments.media_ptr FX_MEDIA * 0x0 name_ptr CHAR * 0x0 entry_ptr FX_DIR_ENTRY * 0x0 last_dir_ptr FX_DIR_ENTRY * 0x0 last_name_ptr CHAR ** 0x200012a8 <fx_byte_pool_buffer+408> i ULONG 4025479151 n ULONG 1627389952 found UINT 134272988 status UINT 4025479151 v UINT 134276061 j UINT 10 cluster ULONG 536875464 next_cluster ULONG 4025479151 directory_size ULONG64 2305863900471563680 And a screenshot of the states before entering the above function: I take note of:name_ptr CHAR * 0xffffffff <error: C
I would like to ensure that I can use HAL_FDCAN_GetRxFifoFillLevel() function in HAL_FDCAN_RxFifo0Callback() like this: void HAL_FDCAN_RxFifo0Callback(FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo0ITs) { if (RxFifo0ITs & FDCAN_IT_RX_FIFO0_NEW_MESSAGE) { // used loop to read all messages from FIFO while (HAL_FDCAN_GetRxFifoFillLevel(hfdcan, FDCAN_RX_FIFO0) > 0) { can_msg_t rx_msg = {0}; if (HAL_FDCAN_GetRxMessage(hfdcan, FDCAN_RX_FIFO0, &rx_msg.hdr, rx_msg.data) != HAL_OK) { break; } rx_msg.data.data_len = (uint8_t)dlc_to_bytes(rx_msg.hdrDataLength); // put rx msg to queue osMessageQueuePut(rx_queue_handle, &rx_msg, 0, 0); } } } When I googling more whether I can use HAL_FDCAN_GetRxFifoFillLevel() in ISR CalIback I got:HAL_FDCAN_GetRxFifoFillLevel is not guaranteed to be ISR-safe because it's a read operation on a peripheral register that doesn't automatically handle atomic operations, which are required in interrupt contexts to preven
Hi all,I'm working on an audio project with an STM32U575, where SAI 1A is receiving TDM data from an ADC and SAI 2A needs to take the data after processing and output it over I2S to a DAC.The audio sample rate is 48 KHz in both cases, and both SAI blocks get their clocks from PLL2P at 12.288 MHz.How should I buffer and process the data? I'm concerned about whether the SAI peripherals will drift apart from each other if I try to start a naive double-buffering system.Thanks for any tips!
Dear ST Community/Support Team, We are developing a Firmware Over-The-Air (FOTA) solution for an IoT asset tracking device using the STM32H747IIT6 microcontroller (LQFP176 package, dual-core Cortex-M7/M4, 2MB dual-bank Flash). The system integrates a SIMCOM cellular/GNSS module for connectivity and location services, with firmware downloads staged via AT commands (e.g., HTTP for files like fwv1.bin) and processed using STM32 HAL UART/Flash APIs. Project Overview: Hardware: STM32H747IIT6 as main MCU; SIMCOM module on UART1 for AT commands (e.g., AT+FSOPEN/FSREAD for file staging); GNSS NMEA parsing on UART2 (offloaded to M4 core). Software Stack: STM32CubeH7 HAL (v1.13+), FreeRTOS on M7 for multitasking, dual-bank Flash for safe updates (Bank1: Bootloader + Active App; Bank2: New Firmware). FOTA Flow: Poll server for update manifest (version, URL, checksum). Download chunks to SIMCOM FS or SD card. Verify (CRC/SHA256), copy to inactive bank, set flag, reset.
Hello,I am currently trying to collect acceleration data at 16 kHz from a USB accelerometer using an STM32F401RET6 in USB Host mode.I created two tasks: vUSBInitTask and vUSBReadTask as shown below. void vUSBInitTask(void *pvParameters) { MX_USB_HOST_Init(); for (;;) { MX_USB_HOST_Process(); vTaskDelay(pdMS_TO_TICKS(10)); } } void vUSBReadTask(void *pvParameters) { AUDIO_HandleTypeDef *audio_handle; uint8_t *buf; char msg[64]; static int32_t sample_buffer[SAMPLES_TO_SAVE]; int collected_samples = 0; while (Appli_state != APPLICATION_READY) // wait until USB is ready { vPrintString("Waiting for USB ready...\r\n"); vTaskDelay(pdMS_TO_TICKS(500)); } for (;;) { audio_handle = (AUDIO_HandleTypeDef *)hUsbHostFS.pActiveClass->pData; if (audio_handle && audio_handle->microphone.supported) { buf = audio_handle->microphone.buf; if (buf) { USBH_StatusTypeDef status = USBH_IsocReceiveData(&hUsbHostFS, buf, audio_handle->microphone.frame_l
i can not create a simple project on stm32F407 that blink leds with the use of freertos
I built a custom application based on the LwIP_HTTP_Server_Netconn_RTOS example in the CubeMX SDK 1.17.4. RX and TX work after power-up and in 50% of cases also after a debugger reset. However, in 50% of cases, RX doesn't work at all. The symptoms in the error case: the yellow LED flashes once when booting, then it's constantly on The link is detected as "up" The MMCTGFCR register shows that some packets have been successfully sent (my application sends some packets after boot) No packet is received at all replugging the network cable usually makes everything work, but not always I restart the debugger multiple times until it works, but the whole situation is annoying. I wonder what the problem could be? Since I use the initialization code in the example, only the timing is different. Is there any timing dependency between phy and eth driver? Or can I rule out the phy as a potential problem here? I found this thread with a maybe similar problem, but the workaround proposed there seem
Hello all,I am on the STM23 H750 discovery dev. kit working either in Keil or CubeZone IDE-just started, anyway, so far so good, and according to the logic analyser the LIN works, at least the checksum is right :) So far I am sending the frame once the button is pressed, made with switch and different states... this only sends out the LIN frame once the button is pressed, is this normal, OK, or should the LIN frame be send once the button is pressed continuously every 3 or more seconds... For example, I am reading the bus from the other device, random, and it is sending out frame every few seconds, looks rather random... attaching a pic of analyser...Thank you in advance and I am looking forward!Best.
Hi all,I ran into an issue regarding FreeRTOS tickless idle mode. I wanted to share my findings and solution in case others encounter the same problem and also to ask if that's intended structure (so I am missing something) or if its not generated properly.Background:I was using SysTick as the OS kernel timebase.Tickless idle was enabled (configUSE_TICKLESS_IDLE = 1).I noticed that the portNVIC_SYSTICK_COUNT_FLAG_BIT was cleared unexpectedly during sleep, which caused the tickless idle implementation (vPortSuppressTicksAndSleep) to miscalculate elapsed ticks.Debugging revealed that the auto-generated SysTick_Handler in cmsis_os2.c was clearing the COUNTFLAG, even in tickless mode.The autogenerated handler looked like this: void SysTick_Handler(void) { /* Clear overflow flag */ SysTick->CTRL; if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) { xPortSysTickHandler(); } }Reading the Cortex-M documentation shows that reading SYST_CSR clears the COUNTFLAG.This m
Hi Sir,I tried to refer to the PWM example:~\stm32cubeh7-v1-12-0\STM32Cube_FW_H7_V1.12.0\Projects\STM32H743I-EVAL\Examples\TIM\TIM_PWMOutput I see the four GPIO pins are initialized: And I see the four PWM channels are setup: But I can't find the code where each GPIO pin is bound to each PWM channel or the ISR where each GPIO is toggled whenever a PWM channel interrupt occurs. Please advise. Thanks. Jimmy
Exploring ADC discontinuous mode with interrupts. Any issues calling HAL_ADC_Start_IT() from ADC ISR? Looks like a lot of code to run from an ISR.
Hello,I would like to transfer 3 linked list blocks over UART DMA. When I started HAL_MDMA_START_IT, it transmits only 16 bytes. How can I send big files back to back? Configurations are as follows:MCU : STM32H7 seriesFirmware : Last release
Hello,[Question]How should I modify the sample project so that I can achieve the expected current consumption in standby mode (as described in the user manual)?[Board]NUCLEO-U385RG-Q[Development Environment]STM32CubeIDE 1.19.0STM32CubeMX 6.15.0[PWR_STANDBY]I am using the sample project “PWR_STANDBY” generated from STM32CubeMX 6.15.0. I would like to modify this project for my purpose.[Goal]I want to put the board into standby mode, measure the current through JP4, and reproduce the expected value described in the user manual (https://www.st.com/resource/en/datasheet/stm32u385rg.pdf, page 115).[Current Situation]When I run the sample project without any modification, I measure about 255 µA. This is much higher than the expected value in the user manual.Thank you for your advice and support.
Been trying to get an test application working on a STM32F469NIH Discovery board.Should be fairly simple - Write a file to the SD Card, with FatFS, the read back:Try as I might, I couldn't get things working.After a bit of debugging, I think the issue lies with the DMA callback functions. I'm using FW_F4 V1.27.1, on CubeIDE, and it seems that the supplied SD_DMATransmitCplt() function isn't quite complete, when compared to the SD_DMAReceiveCplt() function. There seems to be a couple of things missing - Firstly the call to the callback function - This is a must for the SD interface, because there's a queue that is waited on. Without the callback function being called, nothing is ever put on the queue, so a timeout error is received. The other important bit seems to be the line of code that unlocks the HAL. A sensible thing to do, as we've just finished transferring data. Again, without it, some other bits of code later on fail as the HAL is still locked. So I copied the code from the RX
Hello ST Community - I am seeking to migrate a functioning HTTP Client application from a SAMD51 MCU to STM32 silicon, I have an STM32H573I-DK on hand, objectives: HTTP Client Ethernet (wired) connectivity using a static IP address Storing retrieved JSON objects on an SD card DIsplaying selected attributes on the 240x240 LCD Other than the demo program, I have not deeply explored the STM32H573I-DK. Any configuration, and coding tips / examples would be greatly appreciated. Thanks much, Kelly
Hello everyone,I am working on the STM32U5G9ZJT6Q MCU and am trying to use the JPEG Encoder by feeding him data through a GPDMA linkedlist mode from RAM. The data to encode is an image of 640*480 8-bit grayscale image (the image is stored in a .c file ; for jpeg, i use tables 0, no chrominance in sight).I am not using the HAL methods for jpeg/dma, eventhough the JPEG_DMA_StartProcess inside HAL_JPEG_Encode_DMA in stm32u5xx_hal_jpeg.h function seems to support dma linkedlist transfers.I ran the JPEG_EncodingFromFLASH_DMA example for stm32u5g9 discovery kit, without issue, but having to work with normal dma transfers and having to handle the input/output in interrupts seems a bit off to me. I would like to use the linkedlist for simpler automation.I configured the jpeg_rx (input) and jpeg_tx (output) dma transfers as linkedlists. The jpeg output works fine, the nodes are correctly updated and stream data as wanted.However, the jpeg input dma stalls after the first node, eventhough the ne
譬如說我使用一個按鍵,按下去之後執行函式"jump_to_sys_memory_bootloader",再搭配STM32CubeProgrammer,使用uart來更新我的MCU,但是一直無法連接成功,以下是我的函式請問哪邊有遺漏嗎?static void jump_to_sys_memory_bootloader(void){uint32_t i;void (*SysMemBootJump)(void);__IO uint32_t sys_memory_address = SYSMEM_BOOT_BASE;// 1. 關閉全域中斷__disable_irq();// 2. 停止 SysTickSysTick->CTRL = 0;SysTick->LOAD = 0;SysTick->VAL = 0;// 3. 釋放所有已初始化的外設HAL_ADC_DeInit(&hadc1);HAL_I2C_DeInit(&hi2c1);HAL_SPI_DeInit(&hspi1);HAL_SPI_DeInit(&hspi2);HAL_UART_DeInit(&huart1);HAL_UART_DeInit(&huart2);HAL_TIM_Base_DeInit(&htim14);// 4. Reset RCC (回到預設 HSI 狀態)HAL_RCC_DeInit();// 5. 關閉 NVIC 所有中斷for (i = 0; i < (sizeof(NVIC->ICER) / sizeof(NVIC->ICER[0])); i++){NVIC->ICER[i] = 0xFFFFFFFF;NVIC->ICPR[i] = 0xFFFFFFFF;}// 6. 記憶體重映射到 System Flash__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();// 7. 設定主堆疊指標 (MSP)__set_MSP(*(uint32_t *)sys_memory_address);// 8. 取得 Bootloader Reset Handler 入口點SysMemBootJump = (void (*)(void)) (*((uint32_t *)(sys_me
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.