From 1c14c8f043579d3cf1e9928a6f8ca154ff8a7f16 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Sun, 15 Jan 2023 15:22:21 +0000 Subject: [PATCH] AP_FlashIface: build fix for examples clearly document parameters of memory-mapped mode --- libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp | 6 +++--- .../AP_FlashIface/examples/jedec_test_bl/jedec_test.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp b/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp index 2c3929f08d..47ed9198be 100644 --- a/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp +++ b/libraries/AP_FlashIface/AP_FlashIface_JEDEC.cpp @@ -929,13 +929,13 @@ bool AP_FlashIface_JEDEC::start_xip_mode(void** addr) { // Set QSPI module for XIP mode AP_HAL::QSPIDevice::CommandHeader cmd; - cmd.cmd = _desc.fast_read_ins; - cmd.alt = 0xA5; + cmd.cmd = _desc.fast_read_ins; // generally 0xEB for 1-4-4 access + cmd.alt = 0xF0; // add M0-7 bits in alt to make up 32-bit address phase cmd.cfg = AP_HAL::QSPI::CFG_ADDR_SIZE_24 | AP_HAL::QSPI::CFG_CMD_MODE_ONE_LINE | AP_HAL::QSPI::CFG_ADDR_MODE_FOUR_LINES | AP_HAL::QSPI::CFG_DATA_MODE_FOUR_LINES | - AP_HAL::QSPI::CFG_ALT_MODE_FOUR_LINES | /* Always 4 lines, note.*/ + AP_HAL::QSPI::CFG_ALT_MODE_FOUR_LINES | AP_HAL::QSPI::CFG_ALT_SIZE_8; cmd.addr = 0; cmd.dummy = _desc.fast_read_dummy_cycles; diff --git a/libraries/AP_FlashIface/examples/jedec_test_bl/jedec_test.cpp b/libraries/AP_FlashIface/examples/jedec_test_bl/jedec_test.cpp index a6d4ed9241..cd9aeb6a0e 100644 --- a/libraries/AP_FlashIface/examples/jedec_test_bl/jedec_test.cpp +++ b/libraries/AP_FlashIface/examples/jedec_test_bl/jedec_test.cpp @@ -2,6 +2,7 @@ #include #include #include +#include AP_FlashIface_JEDEC jedec_dev; @@ -16,7 +17,7 @@ static UNUSED_FUNCTION void test_page_program() uprintf("Failed to allocate data for read"); } - // fill program data with its own adress + // fill program data with its own address for (uint32_t i = 0; i < jedec_dev.get_page_size(); i++) { data[i] = i; }