Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I have a 2-board communication project set up with 2 NUCLEO-H753ZI boards, where they communicate over UART. The sender side sends a 22-byte stream of data that is received by the receiver side and gets parsed into data. This data can then be streamed to a PC over Ethernet. Inside of the UART_RxCpltCallback, I toggle the Red on-board LED, which gives me the rate at which packets are coming in. Inside the UART_TxCpltCallback I am calling a function that takes the data from the UART buffer, and moves it into a member variable of an object. All this should happen at 2KHz, but for some reason the data is only updating every few seconds, and it is not a specific rate at which it updates, it seems random. The graph might better illustrate what I am talking about. The graph *should* look like a sawtooth waveform. The confusing part is that the LEDs work as expected, i.e. those blocks of code that are responsible for getting the data where it needs to be are surely executing, they ju
Hey everyone!In our app we use HAL_UARTEx_ReceiveToIdle_DMA() to capture serial data to a circular buffer (same as ST Sample 'UART_ReceptionToIdle_CircularDMA UART). It works really well until someone plugs or unplugs cables generating noise on the UART. In this case, we just poll HAL_UART_GetError(), reset the uart using HAL_UART_Init(), and finally call HAL_UARTEx_ReceiveToIdle_DMA() again to recover. The errors returned could be noise, parity, or framing errors (we've seen all 3). The recovery works 95% of the time. But, 5% of the time, after resetting the uart with HAL_UART_Init(), we will enter HAL_UARTEx_ReceiveToIdle_DMA() and it will permanently block/never return. We mitigated this condition by inserting a 50ms delay in between HAL_UART_Init() and HAL_UARTEx_ReceiveToIdle_DMA(). I don't feel super good about this and would rather be checking a flag but I have no idea what co
大家好,我正在使用一塊 STM32L476 Nucleo-64 開發板。我想直接將 USB 隨身碟連接到開發板的 USB 連接埠來讀取它。我正在使用開發板的UART檢查USB讀取操作是否成功。我成功讀取了一個16GB的USB驅動器,但當我嘗試讀取一個256GB的驅動器時卻失敗了。這對我來說很奇怪。有人遇到類似的問題嗎?或是有什麼建議可以解釋一下是什麼原因造成的?任何幫助都將不勝感激!Google Translate:Hello everyone,I'm using an STM32L476 Nucleo-64 development board. I want to connect a USB flash drive directly to the board's USB port to read it.I am using the UART of the development board to check if a USB read operation is successful. I successfully read a 16GB USB drive but failed when I tried to read a 256GB drive.This seems strange to me. Has anyone encountered a similar problem? Or has any suggestions on what could be causing this?Any help would be greatly appreciated!Please see the ST Community Terms and Conditions - The language of the Community is English.
Post edited by ST moderator to be inline with the community rules especially for sharing a code. Please read this post. I’m working on playing audio on the TAS2110 codec using the STM32U5G9J-DK1 board via SAI. I tested with generated sine and square waves, and I can hear output on the speaker. However, when I try to play audio data stored in memory, I don’t get any sound. To store the audio file, I created a .s file as shown below: .section .wav_data, "a".global _wav_data_wav_data:.incbin "C:/Work/Project/Project/audio_codec/Core/Src/wav/audio.wav".global _wav_data_end_wav_data_end: I can parse the WAV data using my parser API. Parsing works fine, and I copy the samples into a buffer, then send it to SAI via DMA. Could you please help me identify what I might be missing? Why do I not get audio output from the speaker when streaming from the WAV file? My GPDMA and SAI configurations are set up accordingly. In the linker script .wav_data : { . = ALIGN(4); _swav_data_start = .
I'm already achieved a USBX-MSC class, and also a FileX in MCU local.I know that using two file systems at the same time is not recommended, but still have some questions. 1. I implement the ux_deveice_msc.c as followed. Use PC-Windows to create a file such as my_test.txt to U-DISK, successfully and the local FileX will see the new file immediately.UINT USBD_STORAGE_Read(VOID *storage_instance, ULONG lun, UCHAR *data_pointer, ULONG number_blocks, ULONG lba, ULONG *media_status) { UINT status = UX_SUCCESS; /* USER CODE BEGIN USBD_STORAGE_Read */ UINT fxStatus = FX_SUCCESS; while (number_blocks--) { fxStatus = fx_media_read(sdioDisk, lba, data_pointer); if (fxStatus != FX_SUCCESS) { status = UX_ERROR; break; } data_pointer += sdioDisk->fx_media_bytes_per_sector; lba++; } /* USER CODE END USBD_STORAGE_Read */ return status; } UINT USBD_STORAGE_Write(VOID *storage_instance, ULONG lun, UCHAR *data_pointer, ULONG number_blocks, ULONG lba, ULONG *media_status)
Post edited by the ST moderator to be inline with ST community rules especially for the code. Please use </> button to paste your code. Hello :) I almost have this working. In fact I had the ISR running and incrementing an integer. Then I went to the next stage and put in the xTaskResumeFromISR() but that crashes in configASSERT( xTaskToResume ). Can anyone see any problems with this code? Init: __disable_irq(); GPIO_InitTypeDef GPIO_InitStruct = {0}; // Configure PE12 GPIO_InitStruct.Pin = GPIO_PIN_12; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; // Interrupt on rising edge GPIO_InitStruct.Pull = GPIO_PULLDOWN; // pulldown GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; // This does nothing on an input pin HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); // Configure NVIC HAL_NVIC_SetPriority(EXTI15_10_IRQn, 10, 0); // Maybe the priority is not suitable for xTaskResumeFromISR ? HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); __enable_irq(); Vector table piece: .w
Hello everyone, I've recently purchased the B-L462E-CELL1 cellular IoT Discovery kit, and I am looking for sophisticated libraries to control/run different sensors/modules on this board including the cellular connectivity modem, accelerometer, magnetometer, OLED display, humidity/temperature sensors etc., to use them for my own product development. I know that there are some "softwares" for this board such as Patch_XCUBECELL, X-CUBE-CELLULAR, and XCC_FreeRTOS. But they seem to be for demonstrating high-level board capabilities and not in way to accelerate my product development (the reason why I bought this board!) So, are there any general libraries to control/run different sensors/modules on this board, so that I could demonstrate my own product? Without digging into the abovementioned softwares with million lines of codes and God-knows-what codes/libraries? Thanks
Hello everyone.I'm working on the stm32G474RBT6 MCU and I'm trying to set up both FDCAN1 and FDCAN2 to work simultaneously.I wanted to map the FDCAN1 to RxFIFO0 and the FDCAN2 to RFIFO1. The FDCAN1 work perfectly while the FDCAN2 doesn't seem to get any callback from the RxFIFO1 at all (I tried using both of them on the RxFIFO0 and in that configuration I was able to communicate with both FDCAN peripherals, but this won't due as I need them to have separate callback functionalities).This is how I setup my peripherals: /* FDCAN1 init function */ void MX_FDCAN1_Init(void) { /* USER CODE BEGIN FDCAN1_Init 0 */ /* USER CODE END FDCAN1_Init 0 */ /* USER CODE BEGIN FDCAN1_Init 1 */ /* USER CODE END FDCAN1_Init 1 */ hfdcan1.Instance = FDCAN1; hfdcan1.Init.ClockDivider = FDCAN_CLOCK_DIV1; hfdcan1.Init.FrameFormat = FDCAN_FRAME_FD_BRS; hfdcan1.Init.Mode = FDCAN_MODE_NORMAL; hfdcan1.Init.AutoRetransmission = DISABLE; hfdcan1.Init.TransmitPause = DISABLE; hfdcan1.Init.Pr
I am developing a bootloader for the STM32H563 that is stored at the beginning of internal Flash (0x08000000) and the application is stored at 0x08020000. The application runs fine when I program/start from STM32CubeIDE once I changed the linker script to set the appropriate Flash address and the VEC_TAB_ADDRESS to be 0x20000 in system_stm32h5xx.c, so the application runs fine on its own from the new 0x08020000 address.In the bootloader I am executing the following code the should work fine as I've used similar before in a project with the STM32H743. __disable_irq(); SCB->VTOR = (uint32_t)EuiFlashFile_loadAddress; __set_MSP(*(__IO uint32_t*) EuiFlashFile_loadAddress); void (*app_reset_handler)(void); app_reset_handler = (void (*)(void))(*(__IO uint32_t*)(EuiFlashFile_loadAddress + 4U)); app_reset_handler();The app_reset_handler is set to the correct Reset_Handler address stored at 0x08020004 (0x0802FC3D).......but after the app_reset_handler() is called I used the debugge
Thread split from this one. In all examples found on the ST rapository concerning the MPU_config in addition to the background configuration to prevent that speculative access issue, there is also the following initialisation. Could you tell me what this concerns and whether it is essential since it is present in almost all MPU_configs of the various platforms? /* Configure the MPU attributes FMC control registers */ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.Number = MPU_REGION_NUMBER7; MPU_InitStruct.BaseAddress = 0xA0000000; MPU_InitStruct.Size = MPU_REGION_SIZE_8KB; MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS; MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE; MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE; MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE; MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0; MPU_InitStruct.SubRegionDisable = 0x0; MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE; HAL_MPU_ConfigRegion(&MPU_In
I am using an SD card in SDIO mode with the STM32F205. I am planning to replace the SD card with an eMMC. If the eMMC has SD card mode, can I replace it without changing the program?
Hi, I am asking about the STM32 usb power delivery middleware. Is there a way to delay/stop the PS_RDY (power supply ready) message from being sent out, or is that completely automatic? Thank you.
EDIT: After doing some more research and testing, I've discovered that doing a software reset of the STM32 actually pulls the nRST pin itself low briefly. I did not realize this. I assumed a software reset was purely internal.In my previous testing, I noticed that the LAN8742A PHY was recovering after resetting only the STM32, so I thought it was something in the startup initialization sequence that was pulling the PHY out. However, I now realize that the PHY is also being hard reset. (more details about this in latest reply below).ORIGINAL MESSAGE:Hello. We have a controller using an STM32F429 with a LAN8742A ethernet phy. That part of the design is roughly based on the STM32F429 discovery board. Long story short - what is the correct process/procedure for reinitializing everything related to ethernet and LWIP? We are experience ethernet lockups associated with electrical noise. Resetting the STM32 without resett
STM32CUBEMX is using very old version of FreeRTOS 10.3.1 for stm32 series microcontroller? Please can you update FreeRTOS version to latest version of FreeRTOS? Do you shifting your focus from using FreeRTOS to some other OS for stm32?
Hi Sir,We managed to use HS USB port as FS USB on our PCB(there is no external PHY), but our partner comments that there is no driver available for that purpose. Indeed I only see USB examples for HS USB or FS USB at STM32H7 source tar ball. I believe that there must be such usage. Where can I get the example ? Thanks. Sincerely,Jimmy
Hello everyone,I'm developing a dual-core FreeRTOS application on an STM32H755ZIT6 using STM32CubeIDE, and I'm facing an issue where the HSEM handshake is not working as expected.My goal is to have a FreeRTOS task on the Cortex-M7 block and wait for a signal from the Cortex-M4.Expected Behavior: The M7 task calls HAL_HSEM_Take() and should be blocked by the FreeRTOS scheduler until the M4 calls HAL_HSEM_Release() on the same semaphore.Actual Behavior: The M7 task calls HAL_HSEM_Take() and it returns immediately, without blocking. This happens even when the corresponding HAL_HSEM_Release() call on the M4 is commented out for testing, causing the M7 task to loop continuously. Debugging Steps I Have Already TakenVerified Core IDs: I have confirmed in the project properties that the M4 project has the CORE_CM4 define and the M7 project has the CORE_CM7 define.Implemented Handshake Logic: I have implemented the standard handshake where the M7 "primes" the lock by taking the semaphore o
I acquired a Utility to display simple text on a display with the STM32H743 using the attached LCD driver Utility files from ST MCD Application Team. I would like to also use this on my bootloader for the STM32H563, does anyone have the files to be able to use this with the STM32H5xx and ST7789V LCD? The STM32H743 has stm32h7xx_lcd.h/.c files that I had found for that micro that supports LTDC, the H5 does not have LTDC and I'm using an SPI interface to the ST7789V LCD display. The stm32_lcd.c/.h files use the following BSB functions that I need to support for the STM32H5xx, I have the driver files for the ST7789V as I'm already using this display with TouchGFX for the application, but for the bootloader just need to display lines of text using UTIL_LCD_DisplayStringAtNextLine() with this utility. BSP_LCD_DrawBitmapBSP_LCD_DrawHLineBSP_LCD_DrawVLineBSP_LCD_FillRectBSP_LCD_ReadPixelBSP_LCD_WritePixelBSP_LCD_GetXSizeBSP_LCD_GetYSizeBSP_LCD_SetActiveLayer
Using H743 ETH example from how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack .I want to use jumbo frames to avoid IP fragmentation while streaming audio via UDP. So, no jumbo frames have to be received. I only care about transmitting.Below is my StartDefaultTask function, which is called in main(). Normal transmissions under 1500bytes MTU work fine when MAX_UDP_PAYLOAD_SIZE is adjusted.I understand work needs to be done. I've tried changing buffer sizes and adjusting values in low_level_init(), but I'm unable to get it to work.Currently, with ^^ at 2000bytes the debugger ends up here: void StartDefaultTask(void *argument) { /* init code for LWIP */ MX_LWIP_Init(); /* USER CODE BEGIN 5 */ #define MAX_UDP_PAYLOAD_SIZE 2000 uint8_t large_data[MAX_UDP_PAYLOAD_SIZE]; const char* message1 = "Hello UDP message!\n\r"; osDelay(1000); ip_addr_t PC_IPADDR; IP_ADDR4(&PC_IPADDR, 192, 168, 1, 1); struct udp_pcb* my_udp = udp_new(); udp_connect(
Hi,I am trying to get the USBX CDC working on a NUCLEO-U083RC, but with no luck.I have tested that the USB port (PA11 and PA12) works, because I can do firmware upgrade using the STM32CubeProgrammer.But I cannot find any example on how to get the USB CDC (Virtual Comport) working.I have spend most of a day trying different examples, but nothing seems to work for me.Do anyone have any help to offer regarding a working example ? Best RegardsJakob
HiReading this post https://community.st.com/t5/stm32-mcus-security/x-cube-azure-h7-hw-cryptographic-acceleration/m-p/634818/highlight/true#M6417 it seems like ST employee is saying STM chips will not support Azure RTOS going forward? Has any decision on this been made?
Hi everyone, I have a STM32F042F6P6 chip. I want to read 9 analog channels on it.I guess there are at least 2 options: configure a scan mode with DMA, and staying in polling mode.I decided to stay in polling mode to avoid a potential problem due to DMA config.I defined 1 adc handle and did channel configurations (8 first channels are gpios, the 9th is internal temp)It seems that when calling those 2 methods repeatedly, the ADC auto-increments and read each channel starting from the lowest ID.HAL_ADC_PollForConversionHAL_ADC_GetValue Let's say now that I want to have a method that reads only the internal temperature, how do I manage to tell to HAL_ADC_PollConversion to point on the internal temperature channel only ?I have had an idea but it is quite radical:- create other channel config structure, with only the Temp channel defined, and each time I call a conversion method, before that I call HAL_ADC_ConfigChannel with the good channel config structure.Also, I have 2 qu
Hi, I'm using an STM32F746bgt6 on a custom board, and I'm using Keil.I enabled LibJpeg in CubeMX, but I can't get an RGB JPEG.I have a .jpeg file saved in flash, "frame99.jpg," which I read via littlefs. When I read it, I allocate the buffer to external SDRAM.int ReadFileSDRAM(lfs_t *lfs, const char *filename) { lfs_file_t file; int res = lfs_file_open(lfs, &file, filename, LFS_O_RDONLY); if (res < 0) { printf("Errore apertura file in lettura\n"); return -1; } lfs_soff_t size = lfs_file_size(lfs, &file); if (size <= 0 || size > SDRAM_SIZE_BYTES) { printf("File vuoto, troppo grande o errore lettura dimensione\n"); lfs_file_close(lfs, &file); return -2; } res = lfs_file_read(lfs, &file, image_buffer, size); if (res < 0) { printf("Errore lettura file errore = %d\n", res); lfs_file_close(lfs, &file); return -3; } uint16_t sample_u = 0; int16_t sample_s = 0; image_size1 = size; while (image_size1 > 0 && image_buf
Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code. in STM32U073MCT6 microcontrollers, I have a problem which is like this;in main.c I have while (1) { /* USER CODE END WHILE */ HAL_GPIO_WritePin(ioOUT_DISP_A_GPIO_Port, ioOUT_DISP_A_Pin, 1); /* USER CODE BEGIN 3 */ } and my led is blinked which is high 3.3 vhowever, whenever I enable freertos, led is 0 vwhat should I do?
I followed the setup shown in this video: https://youtu.be/PG50MuFv4KQ?si=daLbNu_JcL2b3U4Q to configure the hardware, but there is no display at all. Could you please tell me why?
Hello,we are experiencing RAM corruption when running an application in external RAM when setting a breakpoint while debugging.The issue can be reproduced using following configuration:1. Open example STM32Cube_FW_H7RS_V1.1.0\Project\STM32H7S78-DK\Templates\Template_LRUN\STM32CubeIDE\Boot\.cproject in STM32CubeIDE 1.15.0(import both Boot and Appli when asked)2. Build the Template_LRUN_Boot-Project and start it to download the bootloader to internal flash3. Exchange the main.c of the Template_LRUN_Appli with the attached main.c and build the application4. Use STM32CubeProgrammer to download Appli/Debug/Template_LRUN_Appli.bin to location 0x70000000(Connect to STM32H7S78-DK board, click '+' , Open File and select Template_LRUN_Appli.bin, Click Download-Arrow-Down and enter 0x70000000 as Address and Enter to download the Applikation)5. Reset the board - the Led LD1 should be blinking in 1 second interval 6. Attach the debugger to the running application by right-clicking on Temp
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.