当前位置:网站首页>这些年用Keil遇到的坑
这些年用Keil遇到的坑
2022-07-06 06:09:00 【老白436196571】
1、今天调程序,函数中数组inBuf_32始终无法赋值
这是3个数组的定义
abc.c
这样不行
uint32_t EEPROM_FLASH_USER_DATA[FLASH_TOTAL_SIZE]={
0xFF};
uint32_t EEPROM_FLASH_REGCODE_DATA[FLASH_TOTAL_SIZE]={
0xaa};
static unsigned short p_InBuf_32=0;
static uint32_t inBuf_32[100];
这样也不行:
static unsigned short p_InBuf_32=0;
uint32_t EEPROM_FLASH_USER_DATA[FLASH_TOTAL_SIZE]={
0xFF};
uint32_t EEPROM_FLASH_REGCODE_DATA[FLASH_TOTAL_SIZE]={
0xFF};
static uint32_t inBuf_32[100];
这样就可以:
uint32_t EEPROM_FLASH_USER_DATA[FLASH_TOTAL_SIZE]={
0};//初始化为0
//uint32_t EEPROM_FLASH_USER_DATA[FLASH_TOTAL_SIZE];//不初始化
uint32_t EEPROM_FLASH_REGCODE_DATA[FLASH_TOTAL_SIZE]={
0xaa};
static unsigned short p_InBuf_32=0;
static uint32_t inBuf_32[100];
.c文件中,定义的第一个数组,不能初始化?或者要初始化也必须是0?
经验:这类问题往前面的数组或指针上面找原因,前面可能指针越界等。
2、函数中static 变量值不能保存,改为全局变量后没问题,这个是偶尔出现,可能也与初始化有关,待回头再测试下。先mark下
边栏推荐
- 曼哈顿距离和-打印菱形
- [web security] nodejs prototype chain pollution analysis
- [leetcode] day96 - the first unique character & ransom letter & letter ectopic word
- Coordinatorlayout+nestedscrollview+recyclerview pull up the bottom display is incomplete
- 【Postman】Monitors 监测API可定时周期运行
- Embedded point test of app
- Digital triangle model acwing 1015 Picking flowers
- Application du Groupe Li dans gtsam
- Buuctf-[[gwctf 2019] I have a database (xiaoyute detailed explanation)
- 《卓有成效的管理者》读书笔记
猜你喜欢
Caused by:org. gradle. api. internal. plugins . PluginApplicationException: Failed to apply plugin
What are the test sites for tunnel engineering?
Usage of test macro of GTEST
D - How Many Answers Are Wrong
二维码的前世今生 与 六大测试点梳理
E - food chain
isam2运行流程
[ram IP] introduction and experiment of ram IP core
Detailed explanation of BF and KMP
Basic knowledge of error
随机推荐
[course notes] Compilation Principle
Réflexions sur la sécurité des données (réimpression)
Database - current read and snapshot read
Digital triangle model acwing 1015 Picking flowers
Embedded point test of app
E - 食物链
公司視頻加速播放
Sqlmap tutorial (III) practical skills II
Buuctf-[[gwctf 2019] I have a database (xiaoyute detailed explanation)
[Thesis code] SML part code reading
Overview of three core areas of Mathematics: algebra
ESP32 ESP-IDF看门狗TWDT
一文揭开,测试外包公司的真 相
Isam2 operation process
[leetcode] day96 - the first unique character & ransom letter & letter ectopic word
误差的基本知识
黑猫带你学UFS协议第8篇:UFS初始化详解(Boot Operation)
[eolink] PC client installation
Resttemplate and feign realize token transmission
在线问题与离线问题