From 1a66b5afd7f3def334978036c7a3d227ab73bbda Mon Sep 17 00:00:00 2001 From: Siddharth Purohit Date: Fri, 11 Jun 2021 20:52:35 +0530 Subject: [PATCH] AP_FlashIface: panic if we haven't found a matching flash device --- libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp b/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp index 568e154037..3f49effb4b 100644 --- a/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp +++ b/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp @@ -111,6 +111,10 @@ bool AP_FlashIface_JEDEC::init() } } + if (!_dev) { + AP_HAL::panic("Ext Flash Not Found!"); + } + DELAY_MILLIS(5); // required by w25q // Reset Device involves trying to soft reset the chip // as when system reboots the device might not have.