lhdjply / f1c200s_library Goto Github PK
View Code? Open in Web Editor NEW该项目是为全志 F1C100S/F1C200S 所编写的库函数,编写风格模仿 STM32 标准库,使得从 STM32 过来的人更容易上手。项目已经移植了 cherryusb、fatfs、lvgl、rt-thread。
License: MIT License
该项目是为全志 F1C100S/F1C200S 所编写的库函数,编写风格模仿 STM32 标准库,使得从 STM32 过来的人更容易上手。项目已经移植了 cherryusb、fatfs、lvgl、rt-thread。
License: MIT License
用的F1C100S芯片,windows平台,vscode
在‘UART_IDLE_task(void * p)’函数内打印串口接收到的内容
static void UART_IDLE_task(void * p)
{
while(1)
{
uart_idle(&uart_Data);
if(uart_Data.receive_complete_flag == 1)
{
uart_Data.receive_complete_flag = 0;
My_Printf("rxlen=%d,%s",uart_Data.len,uart_Data.RXD_BUF);
}
rt_thread_mdelay(1);
}
}
在原有的void My_Printf(char * fmt, ...)函数里使用了'uart_Data.TXD_BUF'作为vsprintf的格式化字符串缓存区,但在实际使用过程中,会造成死机现象。尝试定位问题,最后在函数内部创建一个局部数组作为缓存,就不会死机。我修改后的函数如下:
void My_Printf(char * fmt, ...)
{
uint32_t i,len;
va_list p;
char buf[500];
rt_enter_critical();
va_start(p, fmt);
len = vsnprintf(buf,499,fmt, p);
va_end(p);
for(i = 0; i < len; i++)
{
UART_SendData(UART1, buf[i]);
while(UART_Get_Status(UART1, UART_USR_TFNF) != SET);
}
rt_exit_critical();
}
麻烦有时间看下具体原因。
访问SD卡文件系统
main函数中注释掉大部分任务,只留下UART_task,而SDIO_task设置与启动迁移至UART_task末尾执行,以便在SDIO_task能使用printf打印一些执行情况
SD_Init中,执行SD_InitializeCards时返回超时错误
具体为其中的Send CMD9 SEND_CSD部分,发送完命令后,CmdResp2Error等待命令响应超时
(master分支表现如上,LVGL8.3分支也尝试了一下,结果类似,SD_Init返回超时,但暂时没去细测是否表现与master完全一致)
想正常读写SD卡
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.