mirror of https://github.com/wolfSSL/wolfBoot.git
Fix issue with network core update when not a multiple of 4 bytes. The QSPI driver requires READ.CNT to be a multiple of 4 bytes (so read a bit more if odd remainder).
parent
d803a20217
commit
3e87c70fa2
|
@ -595,15 +595,17 @@ static void hal_net_check_version(void)
|
||||||
wolfBoot_verify_authenticity(&img) == 0)
|
wolfBoot_verify_authenticity(&img) == 0)
|
||||||
{
|
{
|
||||||
wolfBoot_printf("Network image valid, loading into shared mem\n");
|
wolfBoot_printf("Network image valid, loading into shared mem\n");
|
||||||
/* initialize remainder of shared memory with 0xFF (erased) */
|
|
||||||
memset(shm->data + shm->core.app.size, FLASH_BYTE_ERASED,
|
|
||||||
sizeof(shm->data) - shm->core.app.size);
|
|
||||||
/* relocate image to shared ram */
|
/* relocate image to shared ram */
|
||||||
#ifdef EXT_FLASH
|
#ifdef EXT_FLASH
|
||||||
ret = ext_flash_read(PART_NET_ADDR, shm->data, shm->core.app.size);
|
/* must be multiple of 4 (READ.CNT length must be multiple of 4) */
|
||||||
|
ret = ext_flash_read(PART_NET_ADDR, shm->data,
|
||||||
|
(shm->core.app.size + 3) & ~3);
|
||||||
#else
|
#else
|
||||||
memcpy(shm->data, img.hdr, shm->core.app.size);
|
memcpy(shm->data, img.hdr, shm->core.app.size);
|
||||||
#endif
|
#endif
|
||||||
|
/* initialize remainder of shared memory with 0xFF (erased) */
|
||||||
|
memset(shm->data + shm->core.app.size, FLASH_BYTE_ERASED,
|
||||||
|
sizeof(shm->data) - shm->core.app.size);
|
||||||
if (ret >= 0) {
|
if (ret >= 0) {
|
||||||
doUpdateNet = 1;
|
doUpdateNet = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue