cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6 SD-Card write performance (storing videos..)

svogl
Associate II

Dear all, 
We are using the STM32N6570-DK to encode a video stream (800x600px) and store that at a reasonable data rate to an external sd-card.

I have extended the VENC_SDCARD_ThreadX example to a certain extent to cover the obvious timing differences between the video capture loop and a disk write loop. The sample code is a great way to go forward, but at the moment we reach a data write rate of about 25kb/s when using FileX.

We have initially used the HAL implementation but I have changed the fx_stm32_sd_driver_glue.c code slightly to use the BSP layer for card speed negotiation that is not present in the HAL layer; debug output shows that we're at least using 4-bit wide data transfers>:

CardInfo type 1, version 1, class 1461, spd 0
Inst PWR 00000013 CLKCR 00004004 

 

It seems that just before reaching down to the HAL layer, the single transaction (~200blocks at once, typically), is split  into single sector writes in the sd_write_data function (fx_stm32_sd_driver.c): 

svogl_0-1770112989628.png

Is there a reference implementation showing how this can be set up in the right way? 

Being in very early project stages, I can subsitute filex with fatfs or jump to zephyr if this can be done with reasonable effort.

Btw, the current state is here: https://github.com/svogl/venc-sdcard-threadx/tree/feature/filex-bsp-integration

Some implementation notes:
The BSP layer (stm32n6570_discovery_sd.c) seems to be lacking an implementation of the 1V8 voltage switch present on the board (i.e. HAL_SD_DriveTransceiver_1_8V_Callback); I have implemented this in fx_stm32_sd_driver_glue.c 

Thanks for your help with this great board,

Simon

 

0 REPLIES 0