Important: unclear posts may not receive useful answers.
Before posting
Get familiar with Markdown to format and structure your post
Be sure to update lvgl from the latest version from the master branch.
Be sure you have checked the FAQ and read the relevant part of the documentation.
If applicable use the Simulator to eliminate hardware related issues.
Delete this section if you read and applied the
What MCU/Processor/Board and compiler are you using?
SWM341
What LVGL version are you using?
8.3.7
What do you want to achieve?
I use the 18th Chinese full font library, which contains over 6000 Chinese characters and generates over 3M bin files. I use lv_ Font_ It takes 6 seconds to load and import fonts, which takes too long. Can you use them directly like generating. c, and which fonts are needed to read directly.
I copied all the bin files to SDRAM, changed the function of lv_fs_read() to mencpy(), and copied the sdram data to buf, but it still took 6 seconds.
What have you tried so far?
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
/*You code here*/
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.
The reason for the slow speed now is that the lv_font_load() parsing is too slow. I am not using the file system now, and I am reading the bin directly into my SDRAM.
Change
lv_fs_res_t lv_fs_read(lv_fs_file_t * file_p, void * buf, uint32_t btr, uint32_t * br)
to the following format:
static uint8_t fs_read(uint32_t file_p, void * buf, uint32_t btr, uint32_t * br)
{
memcpy((uint8_t *)buf,(uint8_t *)(file_p+file_addr),btr);
file_addr += btr;
if(br != NULL)
{
*br = btr;
}
return 0;
}
Both pointer addresses are on SDRAM。
Reading bin files from SDRAM is fast, and the slower part is the parsing part.。