2023年8月23日

摘要: 问题: 编译main.c 文件,报入如下错误 本质:库依赖错误,链接时,链接器会多个.o文件链接为一个可执行文件。重定位的时候没有找到add函数的定义,所以报错。 原因:没有把add.o文件链接进去 解决办法:gcc -c add.c gcc -c main.c gcc -o main main.o 阅读全文

posted @ 2023-08-23 14:44 牛man 阅读(16) 评论(0) 推荐(0) 编辑

摘要: #ifndef __xxx_H__ #define __xxx_H__ #ifdef __cplusplus extern “C" { #endif /* __cplusplus */ #ifdef __cplusplus } #endif /*__cplusplus */ #endif exter 阅读全文

posted @ 2023-08-23 14:34 牛man 阅读(5) 评论(0) 推荐(0) 编辑

2023年8月17日

摘要: what 程序里申请了,300k空间,但是malloc 返回值一直是NULL why malloc 申请的是堆空间,系统启动.S文件中设置的堆空间大小最多8k,申请的空间大小超过了实际空间大小,故申请失败 KEIL使用malloc函数申请堆空间失败的解决方法_keil malloc 失败_小刘同学啊 阅读全文

posted @ 2023-08-17 15:12 牛man 阅读(172) 评论(0) 推荐(0) 编辑

2023年8月16日

摘要: 配置github访问环境 解决国内 github.com 打不开的最最最准确方法_杨大脸I的博客-CSDN博客 本地下载github code 如何使用git下载GitHub代码 - 知乎 (zhihu.com) 阅读全文

posted @ 2023-08-16 20:48 牛man 阅读(24) 评论(0) 推荐(0) 编辑

摘要: 1.what rand库函数是用来获取一个伪随机数。使用时需要添加头文件#include<stdlib.h>,然后调用该函数即可获取一个随机数。 2.why(原理) rand产生随机数的原理: 3.how problem 如果我们使用的时候,只调用了rand(),不改变种子,系统默认会设置种子的值为 阅读全文

posted @ 2023-08-16 14:56 牛man 阅读(39) 评论(0) 推荐(0) 编辑

2023年8月2日

摘要: #include<stdio.h> #include<stdlib.h> int main(void) { char str[10] = "12345"; char str1[10] = "hello"; int val; val = atoi(str); printf("val = %d, str 阅读全文

posted @ 2023-08-02 20:03 牛man 阅读(32) 评论(0) 推荐(0) 编辑

2023年7月12日

摘要: 使用步骤 1.输入connect建立连接; 2.输入芯片型号,直接回车可以选择默认选项; 3.根据实际情况选择JTAG或者SWD; 4.设置下载速度,直接回车可以选择默认选项; 正确的连接目标芯片后: debug流程 1.h(cpu 停止运行) 2.g(单步运行程序) 根据pc的值可以知道程序运行到 阅读全文

posted @ 2023-07-12 19:06 牛man 阅读(24) 评论(0) 推荐(0) 编辑

2023年7月10日

摘要: 硬复位:通过SOC上的GPIO向IC的复位引脚输入高低电平信号触发复位;(IC初始化时对复位引脚直接操作) 软复位:通过向IC的寄存器中写值触发复位;(某些IC在ESD测试中crash通过复位寄存器进行复位 阅读全文

posted @ 2023-07-10 17:25 牛man 阅读(263) 评论(0) 推荐(0) 编辑

摘要: msdn.itellyou.cn 阅读全文

posted @ 2023-07-10 16:39 牛man 阅读(9) 评论(0) 推荐(0) 编辑

2023年6月28日

摘要: 1.插件clang-format安装 clang-format默认安装路径为c:\Users\wqr57\.vscode\extensions\ms-vscode.cpptools-0.18.1/bin/../LLVM/bin/clang-format.exe 2.C 格式客制化配置 Languag 阅读全文

posted @ 2023-06-28 21:29 牛man 阅读(336) 评论(0) 推荐(0) 编辑