Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hi, I am struggling with TIM2 to restart its CNT from zero without using hal. I am using nucleo-f446 TIM2 clock frequency is 21MHz (no prescaler, 1/4clock division) CNT set for upcounting. I want to use TIM2 to write a simple us_delay function, so I need to restart its CNT whenever us_delay is called. No matter what I do, I can't make it work, here is the code I am using: TMR2_Start = 1; //start counter TMR2_URS = 1; //Only counter overflow/underflow sets UIF bit TMR2_UDIS = 1; //disable update event generation TIM2->ARR = 2100; //set 100us delay (tim2 clock frequency = 21MHz) TMR2_UDIS = 0; //enable update event generation TMR2_UG = 0x1; //restart counter while (TMR2_UIF == 0){ //wait until TMR2_UIF is set } I put a breakpoint right before while loop is executed, I can see that CNT is enabled, URS set, delay value loaded to ARR. However CNT is not reset to zero, it has a random value, sometimes as high as 0x1A9C, plus the UIF and the Capture/Compare flags are all set for unkn
Heyho, just found that the N6 has gigabit ethernet - which might help me staying away from the monstrous MPUs... :D Is there kinda compatibility list between the STM32 families for the peripherals? ethernet interface, surely different HW concerning GbE vs 100M, but maybe the registers / descriptors work basically the same? CANFD and the SAIs? OCTOSPI / XSPI with memory-mapped HyperRam? the (partly) more simple peripherals like ADC, timers, UART? Merci!
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
We have a board with an STM32H7S3, using STiROT and OEMuROT to run our own application. The application runs in place from external flash, and uses external RAM for data.The process has proven extremely challenging, but we have been able to get the application to run...up to the point where it needs to initialise a peripheral which uses a PLL-dependent clock.OEMuROT does some clock initialisation, but we need to change some of those settings, including turning on additional PLLs.I've tried adding clock setup code to the app (originally generated by CubeMX), but it fails because you can’t change PLL settings while they’re running. So I added a call to the HAL function to reset the clocks first – but that also doesn’t work because we’re running from the external flash at this point, which relies on a PLL!I then tried moving the clock setup code into the bootloader – in the code which runs at the end of proceedings, or at the start – but they also failed.This code has to run from internal
Title edited to clarify the speed is Mbytes per secondThe following example demonstrates how data can be sent from STM32 to a PC via FT232H/FT2232H through an asynchronous FT245 FIFO interface at a speed of over 7.5MB/s.Motivation:I need to send data from STM32 to a PC with a data rate of over 3MB/s as simply as possible. Ethernet and USB2.0 High Speed directly from STM32 would require a lot of self-education. So I first tried to use synchronous parallel interface of FT232H/2232H (up to 40MB/s) or FT600 (up to 400MB/s) with the help of STM32 PSSI. Unfortunately, this proved unfeasible, so i revived at least the asynchronous parallel interface with a theoretical maximum speed of 8MB/s.At first, I tried to fit FSMC to this task, but I couldn't find a way to take "flow control" into account, so I ended up using "brute force" in the form of a combination of TIM+DMA+GPIO, and it seems to work. Since I came across programmers on the internet who would also like to use a similar approach, I d
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
i have been trying to find ways of converting my stm32f103 board to stlink for a personal project , i have found out i need to flash the st link firmware onto this chip but i am not really able to understand how to flash this on the board , if someone has any way to do this it would a huge help , i cant really do anything else as i have already printed a pcb for this purpose so if any one has any way to flash the stlink firmware onto the f103 chip it would be huge help ? the board is stm32f103CBT6 (64KB FLASH + 20KB RAM )
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.
Hello everyone,I'm working on STM32H7S7L8 custom board with same architecture as the DK board ( for XSPIM)The mcu and flash is working fine i can uplaud a boot/appli without issue (touch gfx + lwip work so the hardware is fine)But working on the FW 1.3.0 I'm unable to make MCE work.I followed step by step the MCE workshop : https://github.com/ST-TOMAS-Workshop/stm32h7s_workshop/blob/main/3_external_memory_encryption/external_memory_encryption.mdBut when I build the extmem loader and try to uplaud the code I got :Weird thing is that i already made MCE work on the DK board without issues but here it is not possibleLog output file: C:\Users\hdia\AppData\Local\Temp\STM32CubeProgrammer_a46772.log ST-LINK SN : 002600493234510936303532 ST-LINK FW : V3J16M7B5S1 Board : STLINK-V3SET Voltage : 3.31V SWD freq : 8000 KHz Connect mode: Under Reset Reset mode : Hardware reset Device ID : 0x485 Revision ID : Rev Y Device name : STM32H7RSxx Flash size : 64 KBytes (default) Device type : MCU Devic
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
Hello,ST announced the STM32V8 series some time ago (https://www.st.com/content/st_com/en/campaigns/stm32v8-high-performance-cortex-m85-mcu-z11.html), but there haven’t been any updates since then.I have a couple of questions:How can we download the datasheet for the STM32V8 series?When will the Nucleo or evaluation boards for this series be available for order?Thank you in advance for your help.
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
Hello , I am aiming to demonstrate secure storage operation SST using PSA APIs using STM32U585. To verify that TF-M services are operational and Secure/Non-Secure communication works. However I dont find any more stm32cube TFM ready solutions/examples. So i have started from SBSFU examples and cloned TFM Source code from trusted firmware m git and trying to integrate the lib I need . Is this the right way to do so ? is there better starting point? Also it make more sens to put this in secure world however not sure if there is any considerations to think of while doing this . This is what I am trying to do one Secure Storage lifecycle: Write data to Secure Storage using psa_ps_set() Read the data back using psa_ps_get() Verify data integrity using memcmp() Remove the stored object using psa_ps_remove()
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 am trying to establish CAN communication between three different MCUs: NUCLEO-H723ZG, NUCLEO-H755ZIQ, and NUCLEO-G474RE. However, I am unable to successfully communicate between the boards, even though the same baud rate has been configured on all MCUs. I have also connected an external CAN transceiver to each board for proper CAN bus operation. On the NUCLEO-G474RE, I have enabled UART4 to send command data, using the following pins: PC11 – UART4_RX PC10 – UART4_TX Clock Frequency [SYSCLK] & Baud Rate [CAN]: 1. NUCLEO-H723ZG: 550 MHz Baud Rate: 500000 Bit/s 2. NUCLEO-H755ZIQ: 480 MHz Baud Rate: 500000 Bit/s 3. NUCLEO-G474RE: 170 MHz Baud Rate: 500000 Bit/s
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.
On AN4879, STM32N6 is marked as Type E (Universal serial bus full-speed host/device interface) But actually it has 2 HS OTG with phy as high-end line up (2* Type D)
Hi! I’m starting design of a new board, on which I’d like to use an stm32h7 device. My board will also include an audio codec and usb hs phy.Historically I’ve used crystals to drive HSE of the mcu, but some reference designs I’ve been studying show the use of cmos oscillators to drive the clock. I am curious about the trade offs of this, or how/when I should prefer a crystal over an oscillator?thank you!
I am designing a 4 layer PCB which uses an STM32L433 and working on the layout for the LSE and HSE crystals. I referred to the application note AN2867 for guidance, but I am confused by the isolated ground plane underneath the crystals as shown in Figure 14... https://www.st.com/resource/en/application_note/an2867-guidelines-for-oscillator-design-on-stm8afals-and-stm32-mcusmpus-stmicroelectronics.pdf 1. How is the isolated ground plane supposed to be connected to the ground net ? 2. Do all inner layers need an isolated ground plane ? At the moment, the isolated ground plane is only on inner layer 1 and its ground connection is made by the vias on the guard rail to inner layer 2. Below are screenshots of the current implementation. The screenshot below shows the top layer (signals in red) and inner 1 layer (ground in green).... The screenshot below shows the top layer (signals in red) and inner 2 layer (ground in orange).... The
ST Community highlights – April to June 2026
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.