Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 7 months ago.
uVisor, Unlocking the upper SRAM subregion only
I'm trying to build my project with the latest modification on uVisor, it seems that the position of page heap section has changed, so i tried to do something similar to : (vmpu_armv7m.c)
* 2^n <-- region end * ... * .---------. <-- uvisor_config.sram_end * | box 0 | * | public | * | memory | * +---------+ <-- uvisor_config.page_end: n/8th of _region_ size (not SRAM size) * | page | * | heap | * +---------+ <-- aligned to page size * | wastage | <-- wasted SRAM is less than 1 page size * +---------+ <-- uvisor_config.page_start * | uVisor | * | bss | * '---------' <-- uvisor_config.sram_start, region start
I Succeed to pass the first sanity check ( line 463 in the same file : if (protected_size % subregions_size != 0) ), but then it failed during the unlock of the upper SRAM subregion exatcly during the vmpu_map_acl() function. i tried to understand why, but first i didn't get why in (line 472 same file) :
/* Unlock the upper SRAM subregion only. */ vmpu_mpu_set_static_acl( 1, (uint32_t) __uvisor_config.sram_start, total_size, UVISOR_TACLDEF_DATA | UVISOR_TACL_UEXECUTE | UVISOR_TACL_SUBREGIONS(subregions_disable_mask) );
we use total_size to Unlock only the upper SRAM subregion, why it's not subregions_size?
One last thing, I think that ALIGN( (1 << LOG2CEIL(LENGTH(SRAM)) / 8 )) <=> ALIGN(0), Am I wrong?
1 Answer
7 years, 7 months ago.
This change within uVisor depends on a linkerscript change to move the page heap above uVisor bss.
See the PR in mbed-os.
Edit: I forgot, that PR is for K64F only, so that's not very helpful for you. At the moment that's the only officially ported target. You can try my port to EFM32, but it's experimental and may not work. YMMV.
One last thing, I think that ALIGN( (1 << LOG2CEIL(LENGTH(SRAM)) / 8 )) <=> ALIGN(0), Am I wrong?
(1 << LOG2CEIL(LENGTH(SRAM)) / 8
is always > 0
, if LENGTH(SRAM) > 0
.
@"HALT_ERROR(./core/system/src/mpu/vmpu_armv7m_mpu.c#178): inferred ACL's (0x003F) don't mat\ ch exptected ACL's (0x0037)\n" 486,122 @"\n" I'm getting this error after fixing the page_heap problem in the linker. Do you have any idea about it?
posted by 01 Sep 2016We can reproduce this issue and are tracking it here: https://github.com/ARMmbed/uvisor/issues/319
posted by 05 Sep 2016