Ensure flash write bounce buffer is used if source is also flash.
When using the flash write API, the flash is unmapped/uncached, and as such it's not possible to source data directly from flash (e.g. string literals).
This commit is contained in:
parent
1259f8d776
commit
9f9b323fb5
|
@ -471,7 +471,8 @@ uint32_t platform_s_flash_write( const void *from, uint32_t toaddr, uint32_t siz
|
|||
SpiFlashOpResult r;
|
||||
const uint32_t blkmask = INTERNAL_FLASH_WRITE_UNIT_SIZE - 1;
|
||||
uint32_t *apbuf = NULL;
|
||||
if( ((uint32_t)from) & blkmask ){
|
||||
uint32_t fromaddr = (uint32_t)from;
|
||||
if( (fromaddr & blkmask ) || (fromaddr >= INTERNAL_FLASH_START_ADDRESS)) {
|
||||
apbuf = (uint32_t *)c_malloc(size);
|
||||
if(!apbuf)
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue