Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实现arduino的软复位和硬件看门狗 #78

Open
5 tasks done
ls701110 opened this issue Oct 29, 2023 · 3 comments
Open
5 tasks done

实现arduino的软复位和硬件看门狗 #78

ls701110 opened this issue Oct 29, 2023 · 3 comments

Comments

@ls701110
Copy link

您的功能请求是否与解决某些问题有关?请描述一下。/ Is your feature request related to a problem? Please describe.

在硬件看门狗没有实现的情况下可以直接调用HAL实现看门狗吗?有没有HAL调用相关的示例,直接引用air001xx_hal_iwdg.h调用编译的时候提示找不到方法

描述您想要的解决方案 / Describe the solution you'd like

在硬件看门狗没有实现的情况下可以直接调用HAL实现看门狗吗?有没有HAL调用相关的示例,直接引用air001xx_hal_iwdg.h调用编译的时候提示找不到方法

描述您想要的详细使用步骤描述 / Describe the solution you'd like to use in what way

在硬件看门狗没有实现的情况下可以直接调用HAL实现看门狗吗?有没有HAL调用相关的示例,直接引用air001xx_hal_iwdg.h调用编译的时候提示找不到方法

其他备注信息或截图 / Add any other context or screenshots about the feature request here

No response

确认信息

  • 检查过该需求,之前没有人提过 / Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • 这个需求是真实存在的,并且对于本项目来说是必要的
  • 我已经提供了该需求的清晰、详细、完整的方案,请按该方案进行实施
  • 我认为我提供的信息已经足够,不需要其他人继续完善该需求的其他细节
  • 我同意跟进该需求的实施进程,并在适时提供合理的解释与纠正
@668477
Copy link

668477 commented Nov 15, 2023

#include <air001xx_hal_iwdg.h>

int i = 0;
IWDG_HandleTypeDef watchdog;

void setup() {
// put your setup code here, to run once:
HAL_StatusTypeDef ret;

watchdog.Init.Prescaler = IWDG_PRESCALER_64;
watchdog.Init.Reload = 512;
watchdog.Instance = IWDG;

Serial.begin(9600);
Serial.print("Board Start!\r\n");

ret = HAL_IWDG_Init(&watchdog);
Serial.println((int)ret);
}

void loop() {
// put your main code here, to run repeatedly:
delay(1000);
i++;
Serial.println(i);
}


ino文件的同目录建立build_opt.h写入一下内容
-DHAL_IWDG_MODULE_ENABLED

@xky183
Copy link

xky183 commented Jun 2, 2024

上面的代码 直接编译运行,一直不看门狗复位呢

@xky183
Copy link

xky183 commented Jun 12, 2024

用起来了,基于上面代码,再增加时钟

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants