From 73614ea56e936102d53573c38afd1bb2731a363c Mon Sep 17 00:00:00 2001 From: Chun-Chieh Li Date: Thu, 24 Sep 2020 16:50:45 +0800 Subject: [PATCH] M2354: Remove flash_read override originally for test chip In test chip, byte-read (LDRB) last byte of flash in non-secure world always gets 0xFF. This is got around by overriding flash_read(...). Now, the override can remove in MP chip. --- targets/TARGET_NUVOTON/TARGET_M2354/flash_api.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/targets/TARGET_NUVOTON/TARGET_M2354/flash_api.c b/targets/TARGET_NUVOTON/TARGET_M2354/flash_api.c index 073d5e53e3..8c89965cd8 100644 --- a/targets/TARGET_NUVOTON/TARGET_M2354/flash_api.c +++ b/targets/TARGET_NUVOTON/TARGET_M2354/flash_api.c @@ -117,18 +117,4 @@ void flash_set_target_config(flash_t *obj) #endif // #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -int32_t flash_read(flash_t *obj, uint32_t address, uint8_t *data, uint32_t size) -{ - memcpy(data, (const void *)address, size); - /* In test chip, byte-read (LDRB) last byte of flash in non-secure world - * always gets 0xFF. Get around it. - * - * Remove the flash_read(...) override in MP chip. */ - if (size && (address + size) == 0x10100000) { - volatile uint32_t *last_word = (volatile uint32_t *) 0x100FFFFC; - data[size - 1] = (uint8_t) ((*last_word & 0xFF000000) >> 24); - } - return 0; -} - #endif // #if DEVICE_FLASH