登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
轻量养虾,开箱即用!低 Token + 稳定算力,Gitee & 模力方舟联合出品的 PocketClaw 正式开售!点击了解详情~
代码拉取完成,页面将自动刷新
开源项目
>
工业软件
>
智能硬件
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
62
Star
229
Fork
122
珠海杰理科技
/
fw-AC63_BT_SDK
代码
Issues
104
Pull Requests
1
Wiki
统计
流水线
服务
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
NOTE:各系列芯片复位源跟唤醒源获取方式
已完成
#I6BAU9
JL-小辛
成员
创建于
2023-01-28 10:58
FAQ: 1、判断芯片是上电,需要同时判断VDDIO_LVD和VDDIO_POR。 2、判断唤醒源,要过滤是否有复位源,复位状态下唤醒源可能存在误判。 3、如果存在USBDP、USBDM做唤醒口,会出现其他IO唤醒的,同时会判断到USB口唤醒,只能做个软件过滤。 (USB唤醒的,就只有一个IO,存在2个IO唤醒的,就是另一个唤醒IO触发的) 4、避免选用《**ROM中**》的IO,也会误判。https://gitee.com/Jieli-Tech/fw-AC63_BT_SDK/issues/I69LP0 ### bd19-AC632 ```c //此段代码需要放置在 void board_power_init(void) 的函数体内部的末尾。 log_info("get_reset_source_value:0x%x", get_reset_source_value()); u32 reset_source = get_reset_source_value(); if(reset_source & BIT(11)){log_info("WDT_RESET");} if(reset_source & BIT(16)){log_info("VDDIO_POR");} if(reset_source & BIT(17)){log_info("VDDIO_LVD");} if(reset_source & BIT(18)){log_info("VCM");} if(reset_source & BIT(19)){log_info("PPINR");} if(reset_source & BIT(20)){log_info("P11_SYS_RESET");} if(reset_source & BIT(21)){log_info("CPU_RESET");} extern u16 get_wakeup_pnd(void); log_info("get_wakeup_source:0x%x", get_wakeup_source()); log_info("get_wakeup_pnd:0x%x", get_wakeup_pnd()); u16 wakeup_source = get_wakeup_pnd(); if(get_wakeup_source() & BIT(1)){ for(u8 i = 0; i < MAX_WAKEUP_PORT; i++){ if(wakeup_source & BIT(i)){ u32 gpio = wk_param.port[i]->iomap; printf("WAKEUP:[index:%d, GPIO:0x%02x -> IO_PORT%c_%02d]", i, gpio, (gpio/IO_GROUP_NUM) + 'A', gpio%IO_GROUP_NUM); } } } ``` 此段代码需要放置在 `void board_power_init(void)` 的函数体内部的末尾。 ### br23-AC635/AC695 ```c extern u8 power_reset_src; log_info("power_reset_src:0x%x", power_reset_src); u8 reset_source = power_reset_src; if(reset_source & BIT(0)){log_info("VDDIO_POR");} if(reset_source & BIT(1)){log_info("VDDIO_LVD");} if(reset_source & BIT(2)){log_info("WDT");} if(reset_source & BIT(3)){log_info("VCM");} if(reset_source & BIT(4)){log_info("PPINR");} if(reset_source & BIT(6)){log_info("CPU_RESET");}//SOFT_RESET extern u16 get_wakeup_pnd(void); log_info("get_wakeup_pnd:0x%x", get_wakeup_pnd()); log_info("get_wakeup_source:0x%x", get_wakeup_source()); u8 wakeup_io = get_wakeup_pnd(); if(get_wakeup_source() & BIT(1)){ for(u8 i = 0; i < MAX_WAKEUP_PORT; i++){ if(wakeup_io & BIT(i)){ u32 gpio = wk_param.port[i]->iomap; printf("WAKEUP:[index:%d, GPIO:0x%02x -> IO_PORT%c_%02d]", i, gpio, (gpio/IO_GROUP_NUM) + 'A', gpio%IO_GROUP_NUM); } } } ``` 此段代码需要放置在 `void board_power_init(void)` 的函数体内部的末尾。 ### br25-AC636/AC696 ```c u8 get_wakeup_pnd(void) { static u8 wkup_pnd = 0; if(!wkup_pnd){ wkup_pnd = P33_CON_GET(P3_WKUP_PND); } log_info("%s[P3_WKUP_PND:0x%x]", __func__, wkup_pnd); return wkup_pnd; } ```  先按照截图位置调用,不可放其他地方,再添加下面代码。 ```c extern u8 power_reset_src; log_info("power_reset_src:0x%x", power_reset_src); u8 reset_source = power_reset_src; if(reset_source & BIT(0)){log_info("VDDIO_POR");} if(reset_source & BIT(1)){log_info("VDDIO_LVD");} if(reset_source & BIT(2)){log_info("WDT");} if(reset_source & BIT(3)){log_info("VCM");} if(reset_source & BIT(4)){log_info("PPINR");}//bug:唤醒会误报,可同时判断wakeup_source == 0 if(reset_source & BIT(6)){log_info("CPU_RESET");}//SOFT_RESET log_info("get_wakeup_source:0x%x", get_wakeup_source()); u8 wakeup_io = get_wakeup_pnd(); if(get_wakeup_source() & BIT(1)){ for(u8 i = 0; i < MAX_WAKEUP_PORT; i++){ if(wakeup_io & BIT(i)){ u32 gpio = wk_param.port[i]->iomap; printf("WAKEUP:[index:%d, GPIO:0x%02x -> IO_PORT%c_%02d]", i, gpio, (gpio/IO_GROUP_NUM) + 'A', gpio%IO_GROUP_NUM); } } } ``` 此段代码需要放置在 `void board_power_init(void)` 的函数体内部的末尾。 ### br30-AC637、br34-AC638 ```c log_info("get_reset_source_value:0x%x", get_reset_source_value()); u32 reset_source = get_reset_source_value(); if(reset_source & BIT(11)){log_info("WDT_RESET");} if(reset_source & BIT(16)){log_info("VDDIO_POR");} if(reset_source & BIT(17)){log_info("VDDIO_LVD");} if(reset_source & BIT(18)){log_info("VCM");} if(reset_source & BIT(19)){log_info("PPINR");} if(reset_source & BIT(20)){log_info("P11_SYS_RESET");} if(reset_source & BIT(21)){log_info("CPU_RESET");} extern u8 get_wakeup_pnd(void); log_info("get_wakeup_pnd:0x%x", get_wakeup_pnd()); log_info("get_wakeup_source:0x%x", get_wakeup_source()); u8 wakeup_source = get_wakeup_pnd(); if(get_wakeup_source() & BIT(1)){ for(u8 i = 0; i < MAX_WAKEUP_PORT; i++){ if(wakeup_source & BIT(i)){ u32 gpio = wk_param.port[i]->iomap; log_info("WAKEUP:[index:%d, GPIO:0x%02x -> IO_PORT%c_%02d]", i, gpio, (gpio/IO_GROUP_NUM) + 'A', gpio%IO_GROUP_NUM); } } } ``` 此段代码需要放置在 `void board_power_init(void)` 的函数体内部的末尾。 
FAQ: 1、判断芯片是上电,需要同时判断VDDIO_LVD和VDDIO_POR。 2、判断唤醒源,要过滤是否有复位源,复位状态下唤醒源可能存在误判。 3、如果存在USBDP、USBDM做唤醒口,会出现其他IO唤醒的,同时会判断到USB口唤醒,只能做个软件过滤。 (USB唤醒的,就只有一个IO,存在2个IO唤醒的,就是另一个唤醒IO触发的) 4、避免选用《**ROM中**》的IO,也会误判。https://gitee.com/Jieli-Tech/fw-AC63_BT_SDK/issues/I69LP0 ### bd19-AC632 ```c //此段代码需要放置在 void board_power_init(void) 的函数体内部的末尾。 log_info("get_reset_source_value:0x%x", get_reset_source_value()); u32 reset_source = get_reset_source_value(); if(reset_source & BIT(11)){log_info("WDT_RESET");} if(reset_source & BIT(16)){log_info("VDDIO_POR");} if(reset_source & BIT(17)){log_info("VDDIO_LVD");} if(reset_source & BIT(18)){log_info("VCM");} if(reset_source & BIT(19)){log_info("PPINR");} if(reset_source & BIT(20)){log_info("P11_SYS_RESET");} if(reset_source & BIT(21)){log_info("CPU_RESET");} extern u16 get_wakeup_pnd(void); log_info("get_wakeup_source:0x%x", get_wakeup_source()); log_info("get_wakeup_pnd:0x%x", get_wakeup_pnd()); u16 wakeup_source = get_wakeup_pnd(); if(get_wakeup_source() & BIT(1)){ for(u8 i = 0; i < MAX_WAKEUP_PORT; i++){ if(wakeup_source & BIT(i)){ u32 gpio = wk_param.port[i]->iomap; printf("WAKEUP:[index:%d, GPIO:0x%02x -> IO_PORT%c_%02d]", i, gpio, (gpio/IO_GROUP_NUM) + 'A', gpio%IO_GROUP_NUM); } } } ``` 此段代码需要放置在 `void board_power_init(void)` 的函数体内部的末尾。 ### br23-AC635/AC695 ```c extern u8 power_reset_src; log_info("power_reset_src:0x%x", power_reset_src); u8 reset_source = power_reset_src; if(reset_source & BIT(0)){log_info("VDDIO_POR");} if(reset_source & BIT(1)){log_info("VDDIO_LVD");} if(reset_source & BIT(2)){log_info("WDT");} if(reset_source & BIT(3)){log_info("VCM");} if(reset_source & BIT(4)){log_info("PPINR");} if(reset_source & BIT(6)){log_info("CPU_RESET");}//SOFT_RESET extern u16 get_wakeup_pnd(void); log_info("get_wakeup_pnd:0x%x", get_wakeup_pnd()); log_info("get_wakeup_source:0x%x", get_wakeup_source()); u8 wakeup_io = get_wakeup_pnd(); if(get_wakeup_source() & BIT(1)){ for(u8 i = 0; i < MAX_WAKEUP_PORT; i++){ if(wakeup_io & BIT(i)){ u32 gpio = wk_param.port[i]->iomap; printf("WAKEUP:[index:%d, GPIO:0x%02x -> IO_PORT%c_%02d]", i, gpio, (gpio/IO_GROUP_NUM) + 'A', gpio%IO_GROUP_NUM); } } } ``` 此段代码需要放置在 `void board_power_init(void)` 的函数体内部的末尾。 ### br25-AC636/AC696 ```c u8 get_wakeup_pnd(void) { static u8 wkup_pnd = 0; if(!wkup_pnd){ wkup_pnd = P33_CON_GET(P3_WKUP_PND); } log_info("%s[P3_WKUP_PND:0x%x]", __func__, wkup_pnd); return wkup_pnd; } ```  先按照截图位置调用,不可放其他地方,再添加下面代码。 ```c extern u8 power_reset_src; log_info("power_reset_src:0x%x", power_reset_src); u8 reset_source = power_reset_src; if(reset_source & BIT(0)){log_info("VDDIO_POR");} if(reset_source & BIT(1)){log_info("VDDIO_LVD");} if(reset_source & BIT(2)){log_info("WDT");} if(reset_source & BIT(3)){log_info("VCM");} if(reset_source & BIT(4)){log_info("PPINR");}//bug:唤醒会误报,可同时判断wakeup_source == 0 if(reset_source & BIT(6)){log_info("CPU_RESET");}//SOFT_RESET log_info("get_wakeup_source:0x%x", get_wakeup_source()); u8 wakeup_io = get_wakeup_pnd(); if(get_wakeup_source() & BIT(1)){ for(u8 i = 0; i < MAX_WAKEUP_PORT; i++){ if(wakeup_io & BIT(i)){ u32 gpio = wk_param.port[i]->iomap; printf("WAKEUP:[index:%d, GPIO:0x%02x -> IO_PORT%c_%02d]", i, gpio, (gpio/IO_GROUP_NUM) + 'A', gpio%IO_GROUP_NUM); } } } ``` 此段代码需要放置在 `void board_power_init(void)` 的函数体内部的末尾。 ### br30-AC637、br34-AC638 ```c log_info("get_reset_source_value:0x%x", get_reset_source_value()); u32 reset_source = get_reset_source_value(); if(reset_source & BIT(11)){log_info("WDT_RESET");} if(reset_source & BIT(16)){log_info("VDDIO_POR");} if(reset_source & BIT(17)){log_info("VDDIO_LVD");} if(reset_source & BIT(18)){log_info("VCM");} if(reset_source & BIT(19)){log_info("PPINR");} if(reset_source & BIT(20)){log_info("P11_SYS_RESET");} if(reset_source & BIT(21)){log_info("CPU_RESET");} extern u8 get_wakeup_pnd(void); log_info("get_wakeup_pnd:0x%x", get_wakeup_pnd()); log_info("get_wakeup_source:0x%x", get_wakeup_source()); u8 wakeup_source = get_wakeup_pnd(); if(get_wakeup_source() & BIT(1)){ for(u8 i = 0; i < MAX_WAKEUP_PORT; i++){ if(wakeup_source & BIT(i)){ u32 gpio = wk_param.port[i]->iomap; log_info("WAKEUP:[index:%d, GPIO:0x%02x -> IO_PORT%c_%02d]", i, gpio, (gpio/IO_GROUP_NUM) + 'A', gpio%IO_GROUP_NUM); } } } ``` 此段代码需要放置在 `void board_power_init(void)` 的函数体内部的末尾。 
评论 (
2
)
登录
后才可以发表评论
状态
已完成
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (
-
)
标签 (
-
)
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(2)
C
1
https://gitee.com/Jieli-Tech/fw-AC63_BT_SDK.git
git@gitee.com:Jieli-Tech/fw-AC63_BT_SDK.git
Jieli-Tech
fw-AC63_BT_SDK
fw-AC63_BT_SDK
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册