Skip to content

Commit 73614ea

Browse files
committed
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.
1 parent 3a86360 commit 73614ea

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

targets/TARGET_NUVOTON/TARGET_M2354/flash_api.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,4 @@ void flash_set_target_config(flash_t *obj)
117117

118118
#endif // #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
119119

120-
int32_t flash_read(flash_t *obj, uint32_t address, uint8_t *data, uint32_t size)
121-
{
122-
memcpy(data, (const void *)address, size);
123-
/* In test chip, byte-read (LDRB) last byte of flash in non-secure world
124-
* always gets 0xFF. Get around it.
125-
*
126-
* Remove the flash_read(...) override in MP chip. */
127-
if (size && (address + size) == 0x10100000) {
128-
volatile uint32_t *last_word = (volatile uint32_t *) 0x100FFFFC;
129-
data[size - 1] = (uint8_t) ((*last_word & 0xFF000000) >> 24);
130-
}
131-
return 0;
132-
}
133-
134120
#endif // #if DEVICE_FLASH

0 commit comments

Comments
 (0)