Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi, I'm using STM32F407 TIM1 channel 1 to measure the frequency of a square wave. The result is not accurate. For example, when input frequency is 1000.0Hz, the result is around 1006Hz. Input frequency has been verified by an oscilloscope, with probe attaching directly to STM32 pin. My ioc configuration:1. APB2 peripheral clock frequency is 42MHz, APB2 timer clock frequency is 84MHz. (in the datasheet, TIM1 connects to APB2)2. Pin PE9 is configured as TIM1_CH13. TIM1_CH1 uses Input Capture Direct mode4. Prescaler=1 (so TIM1 frequency=84/(1+1)=42MHz)5. Counter mode is Up, Counter Period is 65535. auto-reload preload is Enable6. A DMA connects to TIM1. DMA Request is TIM1_CH1 to capture TIM1->CCR1's value My code:#include "main.h" #include <assert.h> #include <stdint.h> #include <stdlib.h> TIM_HandleTypeDef htim1; DMA_HandleTypeDef hdma_tim1_ch1; #define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0])) #define TIM_FREQ 42000000 // TIM1 frequency is 42MHz // g_timD
Hello, i just wanna take a snapshot by STM32N6570-DK with IMX335. I am using SnapshotDecimation as my reference. after reviewing the code. i wonder why AXI RAM3/4 and RIF are necessary for this project i saw it in 'HAL_DCMIPP_MspInit' function, but i didnt found anything about AXI RAM in other parts of the code.anyone can explain why does axiram necessary for this project?void HAL_DCMIPP_MspInit(DCMIPP_HandleTypeDef* hdcmipp) { RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; RAMCFG_HandleTypeDef hramcfg = {0}; RIMC_MasterConfig_t RIMC_master = {0}; if(hdcmipp->Instance==DCMIPP) { /* USER CODE BEGIN DCMIPP_MspInit 0 */ /*** Enable peripheral clock ***/ /* Enable DCMIPP clock */ __HAL_RCC_DCMIPP_CLK_ENABLE(); __HAL_RCC_DCMIPP_FORCE_RESET(); __HAL_RCC_DCMIPP_RELEASE_RESET(); /*** Configure the NVIC for DCMIPP ***/ /* NVIC configuration for DCMIPP transfer complete interrupt */ HAL_NVIC_SetPriority(DCMIPP_IRQn, 0x07, 0); HAL_NVIC_EnableIRQ(DCMIPP_IRQn
My question revolves around TouchGFX and firmware for accessing the SD card.I'm studying the STM32N657-DK and am already getting good results with TouchGFX. Now I need to write a module to read the SD card, count the files, and update a progress bar. I already know how to update it, but I'm still having difficulties reading the SD card. I don't know which library to use.Could you suggest examples and/or which library would be most suitable?Thank you.
Cannot build a very basic task i.e. blinking in built LED in STM32N657X0-Q Nucleo Board.Please provide me the complete and step step procedure atleast how it happened and why.Lots of issue and confusion occurs in this Board I don't know why but it occurs
Hai Everyone, I am currently working with the STM32H723ZGT6 Nucleo board to implement basic SD card read and write functionality.I have enabled RCC, configured HSE and PLL, and set the system clock to 240 MHz. The SDMMC kernel clock is sourced from PLL1Q at 48 MHz.I tested the SD interface in both 1-bit mode and 4-bit wide bus mode. While the write operation is working correctly, I am unable to read data from the SD card. I would appreciate it if someone could help me resolve this issue. Your support would be very helpful. Thankyou. Best Regards, Aashritha
The current state of the CherryUSB is no stm32h5 is listed. Does anyone know if the IP is close enough to dwc2 to be portable? My needs are cdc-ecm host, and I'm looking at options. Device is stm32h563, using FreeRTOS and not going to do threadx 1. Port CherryUSB 2. Use legacy USB Host stack, copy and tweak cdc-acm3. Use tinyusb, tweak cdc-acm4. Use USBX and fight threadx port layer. (The ECM Layer uses threads as far as I can tell, so not trivial)
Hi, I use the stm32f103 to read the IMU(BNO055) via I2C to get the Quaternion data, I use this library from ivyknob, https://github.com/ivyknob/bno055_stm32 The AR Anchors result is well (Head Mount Display application), I use the USB VCP to Transmit the BNO055 Quaternion data to PC or SBC, using the function CDC_Transmit_FS. But I face a problem immediately, the transmit speed is 100Hz, it will caused the USB_BUSY(race condition), I try some methods, such as add delay in the while loop, using timer interrupt and flag to limit the transmit speed, avoid using sprintf function, it could not solve this problem. As the picture shown below, Tx could write the data from STM32 to PC, but Rx could not write the data from PC to STM32 Files include the main.c and usbd_cdc_if.cCould you give me some advices to resolve this problem. Thank you Best Regard Steve
Hello,I am working on a USB Audio streaming project using an STM32F407 Discovery board. I am using the USB Device (Audio Class) and I2S3 to output audio to the onboard CS43L22 DAC (I plan to move to MAX98357 later).Problem:The PC recognizes the board as an "STM32 Audio Class" device. However, when I play audio, there is a very high level of noise/distortion. While I can faintly hear the music behind the noise, the output is dominated by a harsh "buzzing" or "crackling" sound. Any guidance or suggestions would be greatly appreciated!I2S Parameter SettingsClock configuration
Split from the Implementing a LwIP and FreeRTOS™ v1 UDP echo server on the STM32F7 series Tutorial;Moved to the forum for better visibility & discussion.@mƎALLEm Hi Sir,I am using the same code that works correctly on the development board. However, when I run the same firmware on the custom board, I am encountering an error.Is there any issue in the schematic related to Ethernet?Can I use the same libraries that are used in the Nucleo-H755ZI-Q board for this LAN?If I use the same library and it gets stuck at netif_add() what could be the issue?
Hi all! What event is generated if the MCU receives a data packet equal to the buffer value passed to the HAL_UARTEx_ReceiveToIdle_IT (or HAL_UARTEx_ReceiveToIdle_DMA) function? There will essentially be two events: HAL_UART_RXEVENT_TC and HAL_UART_RXEVENT_IDLE . But which of them will be available in the HAL_UARTEx_RxEventCallback ?
From what i've seen the Rust programming language is becoming more and more popular and since it does not rely on a virtual machine, like java or python, it could be a good option for embedded development and other low-level programs. I know that there are ways to get Rust on STM32 MCUs running, but without official support its really hard to start a series project using those tools. At this point i see it as something fun to try out and benchmark and compare with a traditional C program + FreeRTOS.Does anyone know if there are any official plans from ST to have a Rust wrapper on the existing C HAL or a complete ground-up Rust HAL? Maybe support in CubeIDE for both C and Rust?
Hello,I'm on a custom H75x board and I want to implement a stack (+ RTOS heap) overflow detection using the MPU.I placed stack, heap and RTOS heap into DTCM like this:; ____________________ __ 0x20000000 ; | | ; | ^ | -> 0x4000 = 16KB ; | C-Stack / \ | ; | | | ; |_______________|____| __ 0x20004000 ; | | | ; | | | ; | \ / C-Heap | -> 0x10000 = 64KB ; | v | ; |____________________| __ 0x20014000 ; | | | ; | | | ; | RTOS-Heap \ / | -> 0xC000 = 48kB ; | v | ; |____________________| __ 0x20020000I intend to supervise memory access above and below the DTCM memory via MPU.For stack overflow test, I call a function which allocates an array in the stack with size > stacksize, e.g.static void fTest(uint32_t len) { int8_t abFill[len]; abFill[0] = (uint8_t)0xCD; abFill[len-1] = (uint8_t)0xAB; : }If I step-debug thru these lines I can see that the SP is outside of stack memory and the array write ends up in a bus fault. If I configure the MPU then the mem fault handler is fired. Se
Im trying to use the HAL_Delay function but it seems like to code does not get passed this function. I have no clue what to even check to figure out what the problem is. I have attached the main fail to this post.
Hello STM community, I am currently working on a project that involves connecting a PS5 controller to an STM32 microcontroller. I would like to inquire about the feasibility and potential approaches for achieving this integration. Specifically, I am interested in: Whether the STM32 microcontroller supports USB host mode and is capable of communicating with USB HID (Human Interface Device) peripherals such as the PS5 controller.Any available libraries, examples, or resources that could help with implementing USB host communication and interfacing with the PS5 controller on the STM32 platform.Any considerations or challenges to be aware of when connecting and communicating with the PS5 controller, such as protocol compatibility, power requirements, and data handling.If anyone has experience or insights regarding this topic, I would greatly appreciate your input and guidance. Thank you in advance for your assistance. Best regards,Hirani Bhavik.
Hi,hope you doing good.We are currently using NUCLEO-L412RB-P along with X-NUCLEO-60K1A1 for testing. We are attempting to perform USB tunneling with the following sequence:1.NUCLEO-L412RB-P is connected to X-NUCLEO-60K1A12. X-NUCLEO-60L1A1 part and peripheral lines are connected to NUCLEO-L412RB-P.3.X-NUCLEO-60R1A1 part of board is powered up.4.A pen drive like device is connected to the X-NUCLEO-60R1A1 part of board.We tried debugging the sequence for USB TUNNELING using the example code, however we are unable to achieve the expected result.could you please give us resolving for this issue?Thank you.
I'm developing the STM32H735ZG using IAR EW.I wanted to design sectors 4-7 of the STM32H735ZG's flash memory as a readable/writable data storage area, so I created it by referring to the reference manual, but I can't read or write data properly. I modified the .icf file as attached, defining sectors 4-7 (0x08080000-0x080fffff) as the data storage area(named MEMORY block)./*###ICF### Section handled by ICF editor, don't touch! ****/ /*-Editor annotation file-*/ /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ /*-Specials-*/ define symbol __ICFEDIT_intvec_start__ = 0x08000000; /*-Memory Regions-*/ define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF; define symbol __ICFEDIT_region_RAM_start__ = 0x24000000; define symbol __ICFEDIT_region_RAM_end__ = 0x2404FFFF; define symbol __ICFEDIT_region_ITCMRAM_start__ = 0x00000000; define symbol __ICFEDIT_region_ITCMRAM_end__ = 0x0000FFFF; define symbol __ICFEDIT
Good day everyone!We are working with a custom PCB based on the STM32H750 Discovery board. We are trying to replace the existing MT25QL512ABB8ESF dual-bank setup with a dual S25FL512S setup (both driven with the same chip select).I've got a board with the replacement S25FL512S ICs soldered on and am following the ST MOOC on QSPI flash loaders, but I'm running into issues in passing the recommended testing script; it fails at the memcmp function. As per the ST course, I created an empty project, set up the ioc file, and copy-pasted the user code section to the appropriate commented regions in the generated qspi c and h files from the repo, and I used the provided code from stm32-external-loader/QSPI_Drivers/MT25QL512/quadspi.h at contrib · STMicroelectronics/stm32-external-loader · GitHub .I've reduced the SECTORS_COUNT to 3 for quicker debugging, commented out the MPU_Config function for now, and am watching the contents of a smaller buffer after calling the CS
Hello guys,I have a stm32G474RET board. I am using tim1 in PWM input mode and i want to update on the fly the hrtimA period and compare values using DMA. This is the code i have written: // Addresses for HRTIM registers (Timer A) destPER = (uint16_t*)&HRTIM1->sTimerxRegs[HRTIM_TIMERINDEX_TIMER_A].PERxR; destCMP = (uint16_t*)&HRTIM1->sTimerxRegs[HRTIM_TIMERINDEX_TIMER_A].CMP1xR; // Start DMA transfers in circular mode HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_1, destPER, 1); HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_2, destCMP, 1); HAL_HRTIM_WaveformOutputStart(&hhrtim1, HRTIM_OUTPUT_TA1); HAL_HRTIM_WaveformCounterStart(&hhrtim1, HRTIM_TIMERID_TIMER_A); HAL_TIM_IC_Start(&htim1, TIM_CHANNEL_1); HAL_TIM_IC_Start(&htim1, TIM_CHANNEL_2); My problem is that the period of the hrtim is changing dynamically based on the input PWM signal, but the CMP1 doesn't. The only thing I could find is that when i tried to configure the channel 2 of tim
Hi ST Community,I'm facing an issue with FatFs on SDMMC where f_open() or even f_mount() returns FR_DISK_ERR, even though the SD card is initializing correctly at the HAL level.Here's a summary of the problem and what I’ve verified so far.HAL_SD_Init() completes successfullyCard information is read correctly:CIDCSDRCACapacity (LogBlockNbr, LogBlockSize)SDMMC interface appears operationalRaw HAL read/write tests (CID/CSD) work fineI would be grateful if ST experts or anyone familiar with SDMMC + FatFs integration please help me to resolve this issue :
Typo fixed in title - was "Helliun" I'm developing a project that will heavily utilize DSP for audio processing, including neural networks. However, I'm having difficulties with the DSP; I haven't finished reading all the documentation yet. I even consulted Claude Opus on the process and other AI resources, but they all point to a non-existent path, which would be to install CMSIS-DSP via CubeMX in the ARM software tree. Is anything else needed for DSP use? Taking advantage of this post, how should I access the board's internal microphone? Are there any code examples besides STM32N6-GettingStarted-Audio, or is that the best example to learn how to handle the microphone that comes with the board? Thank you for your help.
I have an XCore407I board with an Ethernet port installed. I'm trying to create a simple UDP server in Stm32CubeIDE. Compilation and uploading to the board is OK. But the board doesn't respond to ping and isn't visible in the router's device list.Here are my settings in IDE.Spoiler (Highlight to read)Here is the main code.int main(void) { HAL_Init(); SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_LWIP_Init(); // Udp init function udpServer_init(); while (1) { MX_LWIP_Process(); } }Unfortunately, I can't attach the entire project here. But I can add code from other modules upon request.Can you tell me how to set this up correctly so it works? Thank you.
Hi everyone, I’m asking for your help with accessing my SD card. I’m running into an issue with the STM32N6DK750 Discovery Kit and would really appreciate some advice. I’m trying to write data to an SD card using FileX and ThreadX. Everything compiles and debugs fine, but nothing actually gets written to the card. I also tried the FX_MultipleAccess example provided by ST, but it doesn’t compile. I’ve tried fixing several compilation errors, but some declarations are missing, like byte_pool in app_filex.c. I’m not sure what’s causing the issue, and I’m wondering if I might have missed an important step or misconfigured something.
Hi,I'm developing a camera interfacing application. I've used GPDMA in linear-circular mode. But, now I have to handle larger resolution(640x480). Is there any application example from where I can start configuring DMA in CubeMx?
Hello,I'm using uSD.I observe that in the sd_diskio.c driver SD_TIMEOUT is 30sec, is'nt very long ?If uSD works normally is not sufficient just 1sec ? Best regards.
Following this thread Solved: USBPD EPR Source - STMicroelectronics Community Do you have a similar guide on how to do EPR as a Sink?
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.