AP_FlashIface: build fix for examples

clearly document parameters of memory-mapped mode
This commit is contained in:
Andy Piper 2023-01-15 15:22:21 +00:00 committed by Andrew Tridgell
parent c9382cd221
commit 1c14c8f043
2 changed files with 5 additions and 4 deletions

View File

@ -929,13 +929,13 @@ bool AP_FlashIface_JEDEC::start_xip_mode(void** addr)
{ {
// Set QSPI module for XIP mode // Set QSPI module for XIP mode
AP_HAL::QSPIDevice::CommandHeader cmd; AP_HAL::QSPIDevice::CommandHeader cmd;
cmd.cmd = _desc.fast_read_ins; cmd.cmd = _desc.fast_read_ins; // generally 0xEB for 1-4-4 access
cmd.alt = 0xA5; 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 | cmd.cfg = AP_HAL::QSPI::CFG_ADDR_SIZE_24 |
AP_HAL::QSPI::CFG_CMD_MODE_ONE_LINE | AP_HAL::QSPI::CFG_CMD_MODE_ONE_LINE |
AP_HAL::QSPI::CFG_ADDR_MODE_FOUR_LINES | AP_HAL::QSPI::CFG_ADDR_MODE_FOUR_LINES |
AP_HAL::QSPI::CFG_DATA_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; AP_HAL::QSPI::CFG_ALT_SIZE_8;
cmd.addr = 0; cmd.addr = 0;
cmd.dummy = _desc.fast_read_dummy_cycles; cmd.dummy = _desc.fast_read_dummy_cycles;

View File

@ -2,6 +2,7 @@
#include <AP_FlashIface/AP_FlashIface.h> #include <AP_FlashIface/AP_FlashIface.h>
#include <stdio.h> #include <stdio.h>
#include <support.h> #include <support.h>
#include <hal.h>
AP_FlashIface_JEDEC jedec_dev; AP_FlashIface_JEDEC jedec_dev;
@ -16,7 +17,7 @@ static UNUSED_FUNCTION void test_page_program()
uprintf("Failed to allocate data for read"); 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++) { for (uint32_t i = 0; i < jedec_dev.get_page_size(); i++) {
data[i] = i; data[i] = i;
} }