From 0d70a02bddf98776292e99a83c7c58a146f9aa7c Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 17 Aug 2021 06:00:45 +0000 Subject: [PATCH] Fixed bug #1173. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14660 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- .../serial_nor/devices/micron_n25q/hal_flash_device.c | 8 ++++---- os/hal/lib/complex/serial_nor/hal_serial_nor.h | 2 ++ readme.txt | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/os/hal/lib/complex/serial_nor/devices/micron_n25q/hal_flash_device.c b/os/hal/lib/complex/serial_nor/devices/micron_n25q/hal_flash_device.c index 1b5d81f83..f314c54cc 100644 --- a/os/hal/lib/complex/serial_nor/devices/micron_n25q/hal_flash_device.c +++ b/os/hal/lib/complex/serial_nor/devices/micron_n25q/hal_flash_device.c @@ -270,8 +270,8 @@ static void n25q_reset_memory(SNORDriver *devp) { #else /* 2x N25Q_CMD_RESET_ENABLE command.*/ static const wspi_command_t cmd_reset_enable_2 = { - .cfg = WSPI_CFG_CMD(N25Q_CMD_RESET_ENABLE) | - WSPI_CFG_CMD_MODE_TWO_LINES, + .cmd = N25Q_CMD_RESET_ENABLE, + .cfg = WSPI_CFG_CMD_MODE_TWO_LINES, .addr = 0, .alt = 0, .dummy = 0 @@ -279,8 +279,8 @@ static void n25q_reset_memory(SNORDriver *devp) { /* 2x N25Q_CMD_RESET_MEMORY command.*/ static const wspi_command_t cmd_reset_memory_2 = { - .cfg = WSPI_CFG_CMD(N25Q_CMD_RESET_MEMORY) | - WSPI_CFG_CMD_MODE_TWO_LINES, + .cmd = N25Q_CMD_RESET_MEMORY, + .cfg = WSPI_CFG_CMD_MODE_TWO_LINES, .addr = 0, .alt = 0, .dummy = 0 diff --git a/os/hal/lib/complex/serial_nor/hal_serial_nor.h b/os/hal/lib/complex/serial_nor/hal_serial_nor.h index cca029775..7e5afaa57 100644 --- a/os/hal/lib/complex/serial_nor/hal_serial_nor.h +++ b/os/hal/lib/complex/serial_nor/hal_serial_nor.h @@ -156,8 +156,10 @@ typedef struct { #ifdef __cplusplus extern "C" { #endif +#if SNOR_SHARED_BUS == TRUE void bus_acquire(BUSDriver *busp, const BUSConfig *config); void bus_release(BUSDriver *busp); +#endif void bus_cmd(BUSDriver *busp, uint32_t cmd); void bus_cmd_send(BUSDriver *busp, uint32_t cmd, size_t n, const uint8_t *p); void bus_cmd_receive(BUSDriver *busp, diff --git a/readme.txt b/readme.txt index 41e9acabc..cdbfe35aa 100644 --- a/readme.txt +++ b/readme.txt @@ -74,6 +74,8 @@ ***************************************************************************** *** Next *** +- FIX: Fixed problem with N25Q driver (bug #1173) + (backported to 21.6.1)(backported to 20.3.4). - FIX: Fixed semaphores broken when CH_CFG_USE_SEMAPHORES_PRIORITY is enabled (bug #1172). - FIX: Fixed idle thread stack area not cleared when CH_DBG_FILL_THREADS