From f4dc92519bfd723022741b3b322da3a5d5f2e197 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Oct 2018 17:10:36 +0700 Subject: [PATCH] fix a cache read issue --- cores/nRF5/flash/flash_cache.c | 2 +- cores/nRF5/freertos/config/FreeRTOSConfig.h | 36 ++++++++++++--------- cores/nRF5/usb/usb_msc_flash.c | 1 - 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/cores/nRF5/flash/flash_cache.c b/cores/nRF5/flash/flash_cache.c index 42d2ea1a..9fce03f0 100644 --- a/cores/nRF5/flash/flash_cache.c +++ b/cores/nRF5/flash/flash_cache.c @@ -138,6 +138,6 @@ void flash_cache_read (flash_cache_t* fc, void* dst, uint32_t addr, uint32_t cou } else { - memcpy(dst, (void*) addr, count); + fc->read(dst, (void*) addr, count); } } diff --git a/cores/nRF5/freertos/config/FreeRTOSConfig.h b/cores/nRF5/freertos/config/FreeRTOSConfig.h index e24f7ba9..b7cc5cc2 100644 --- a/cores/nRF5/freertos/config/FreeRTOSConfig.h +++ b/cores/nRF5/freertos/config/FreeRTOSConfig.h @@ -125,9 +125,23 @@ #define INCLUDE_xEventGroupSetBitFromISR 1 #define INCLUDE_xTimerPendFunctionCall 1 +/* Code below should be only used by the compiler, and not the assembler. */ +#if !(defined(__ASSEMBLY__) || defined(__ASSEMBLER__)) + #include "nrf.h" + + /* This part of definitions may be problematic in assembly - it uses definitions from files that are not assembly compatible. */ + /* Cortex-M specific definitions. */ + #ifdef __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS + #else + #error "This port requires __NVIC_PRIO_BITS to be defined" + #endif +#endif /* !assembler */ + /* The lowest interrupt priority that can be used in a call to a "set priority" function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ((1<