File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
targets/TARGET_NUVOTON/TARGET_M2354 Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -116,4 +116,19 @@ void flash_set_target_config(flash_t *obj)
116116}
117117
118118#endif // #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
119+
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+
119134#endif // #if DEVICE_FLASH
You can’t perform that action at this time.
0 commit comments