I have a custom board where I adapted the example ble_app_all_in_one for my application. I use ARCH_EXT_SLEEP_OTP_COPY_ON. Everything works so far, but when I disable CFG_DEVELOPMENT_DEBUG, the device consistently reboots after a few seconds.
任何暗示可能正在发生的内容?
Device:
嗨螺旋,
This macro enables the development/debug mode. For production mode builds it must be disabled. Please define this macro and run your code in debug mode. Does your firmware get crashed?
谢谢,PM_DIALOG.
是的,当我定义此宏时,所有操作都有效(无崩溃)。
我想为生产模式禁用它,但后来它在大约两秒钟后崩溃并重新启动 - 但只有当我将其刻录到闪存时,就不会在调试器中运行它时。
我在OTP中刻录了引导加载程序。
嗨螺旋,
那么,你打算燃烧OTP并从那里启动吗?启用CFG_Development_debug时,它允许将OTP镜像仿真到系统RAM。你能澄清你在OTP中刻录哪个引导加载程序吗?如果将睡眠配置更改为Arch_ext_sleep_on,您还在面临同一问题吗?
谢谢,PM_DIALOG.
我们的HW制造商在OTP中刻录了一个引导加载程序,我们从那里启动,闪存中没有引导加载程序。不幸的是,我不知道它是哪个引导加载程序,但我怀疑它是漂亮的标准(但也许是一个较旧的SDK?)......
当我使用ble_app_all_in_one时,问题也会发生。我只添加了一个LED输出,看看FW何时运行,它何时重新启动...使用CFG_Development_debug启用所有工作效果很好。但是,当我禁用CFG_DEVELIMENT_DEBUG时,它每隔5秒重新启动一次。如果我通过BLE Quicky连接,在5秒之前,只要我保持连接,它就不会重启。一旦我断开连接,几秒钟后会重新启动。
这与ARCH_EXT_SLEEP_OTP_COPY_ON以及ARCH_EXT_SLEEP_ON ...
嗨螺旋,
你能分享你所做的修改吗?请尝试使用SDK的BLE_APP_BAREBONE示例而无需休眠模式,并将CFG_DEVELVELMMENT_DEBUG未定义。从Flash启动时,您是否有同样的问题?请尝试从System-RAM启动。
谢谢,PM_DIALOG.
我对BLE_APP_ALL_IN_ONE项目的唯一修改以及BLE_APP_BAREBONE正在将这些行添加到user_periph_setup.c gpio_reservations()和set_pad_functions()以关闭电路板LED。Bootloader打开所有三个LED,因此我可以看到重新启动时LED的状态发生。
问题:
嗨螺旋,
你做have a custom board, or you are using any of our development kits? Since the both of projects are working in active mode and having the CFG_DEVELOPMENT_DEBUG undefined, I guess that the problem might be related with the sleep mode. Which clock are you using as a Low Power clock?
谢谢,PM_DIALOG.
是的,显然问题是related to the sleep mode.
The problem happens on a custom board, as stated above. The custom board has the OTP burned.
我还有一个基本的开发套件,有问题不会发生,但OTP也没有在那里烧毁。
我的OTP标题表示睡眠时钟源=外部水晶。HW文档还确认32K辅助器用作扩展睡眠模式的时钟。也许我在应用程序中没有正确配置?检查什么?
Of course I can burn the SPI flash, but if I burn the bootloader to flash and OTP is burned too, will it use the bootloader in flash? It seems not, I have also tested that today. The problem also happens when I burn the bootloader to Flash.
当我通过调试器下载通过keil的固件。使用调试器时不会发生问题。是否有任何方法可以通过keil下载固件,然后分离调试器?
好的,我已经将其追溯到Arch_Main.c中的以下两行:
如果存在这些,就像定义了Developing_debug时,没有崩溃/重启。
嗨螺旋,
According to DA14585 datasheet, the DEV_PHASE bitfield of the SYS_CTRL_REG, sets the development phase mode. If this bit is set, in combination with the OTP_COPY bit, the OTP DMA will emulate the OTP mirroring to System RAM. No actual writing to RAM is done, but the exact same amount of time is spent as if the mirroring would take place. This is to mimic the behavior as if the System Code is already in OTP, and the mirroring takes place after waking up, but the (development) code still resides in an external source. If this bit is set to '0' and OTP_COPY='1', then the OTP DMA will actually do the OTP mirroring at wakeup.
因此,在具有开发阶段模式时,代码在所有情况下都正确运行?
谢谢,PM_DIALOG.
Yes, this is what I said above. And yes, I have read the datasheet.
嗨螺旋,
Thank you for your indication.
Regards, PM_Dialog
有关此问题的任何消息?你认为我应该只在生产建设中启用这个标志吗?对我来说,这个问题尚未解决。这可能是一个最佳替代方法。
嗨螺旋,
您是否在BLE_APP_ALL_IN_ONE项目中完成了任何其他修改?默认SDK在广告期间使用OTP副本使用扩展睡眠模式。请检查user_app_adv_start()。如果您有cfg_development_debug,我假设您应该刻录OTP。但是,请注意,OTP代表一个时间可编程,因此您无法多次擦除并重新编写OTP,但您只能将仍设置为0的位并将其转换为1。
谢谢,PM_DIALOG.