From 01ea7bc7a3184006d69c317309a1de54d59b9d73 Mon Sep 17 00:00:00 2001 From: Gurjant Kalsi Date: Wed, 11 Nov 2015 17:31:14 -0800 Subject: [qspi][stm32f7xx][spiflash] Fix the logic for reading pages on the boundary between 24bit addrs and 32bit addrs. --- platform/stm32f7xx/qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/stm32f7xx/qspi.c b/platform/stm32f7xx/qspi.c index f2a92685..f5f51cc5 100644 --- a/platform/stm32f7xx/qspi.c +++ b/platform/stm32f7xx/qspi.c @@ -268,7 +268,7 @@ static ssize_t spiflash_bdev_read_block(struct bdev* device, void* buf, QSPI_CommandTypeDef s_command; HAL_StatusTypeDef status; - uint64_t largest_offset = (block + count) * device->block_size; + uint64_t largest_offset = (block + count) * device->block_size - 1; // /* Initialize the read command */ s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE; -- cgit v1.2.3