mirror of https://github.com/ARMmbed/mbed-os.git
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.pull/13770/head
parent
3a86360cc5
commit
73614ea56e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue