Bluetooth: hci_rpmsg: flush the logs before locking CPU
The logs were not visible when an assert fired on the controller and `CONFIG_BT_HCI_VS_FATAL_ERROR` was not set. Putting the logs in panic mode before entering the infinite loop fixes that. Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This commit is contained in:
parent
0617b2a5e5
commit
434ea2b2ff
1 changed files with 6 additions and 5 deletions
|
@ -24,10 +24,7 @@
|
|||
#include <zephyr/bluetooth/hci_raw.h>
|
||||
#include <zephyr/bluetooth/hci_vs.h>
|
||||
|
||||
#if defined(CONFIG_BT_HCI_VS_FATAL_ERROR)
|
||||
#include <zephyr/logging/log_ctrl.h>
|
||||
#endif /* CONFIG_BT_HCI_VS_FATAL_ERROR */
|
||||
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
LOG_MODULE_REGISTER(hci_rpmsg, CONFIG_BT_LOG_LEVEL);
|
||||
|
@ -314,6 +311,9 @@ void bt_ctlr_assert_handle(char *file, uint32_t line)
|
|||
|
||||
#endif /* !CONFIG_BT_HCI_VS_FATAL_ERROR */
|
||||
|
||||
/* Flush the logs before locking the CPU */
|
||||
LOG_PANIC();
|
||||
|
||||
while (true) {
|
||||
};
|
||||
}
|
||||
|
@ -322,8 +322,6 @@ void bt_ctlr_assert_handle(char *file, uint32_t line)
|
|||
#if defined(CONFIG_BT_HCI_VS_FATAL_ERROR)
|
||||
void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *esf)
|
||||
{
|
||||
LOG_PANIC();
|
||||
|
||||
/* Disable interrupts, this is unrecoverable */
|
||||
(void)irq_lock();
|
||||
|
||||
|
@ -344,6 +342,9 @@ void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *esf)
|
|||
|
||||
LOG_ERR("Halting system");
|
||||
|
||||
/* Flush the logs before locking the CPU */
|
||||
LOG_PANIC();
|
||||
|
||||
while (true) {
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue