mbed uvisor移植问题

1 对uvisor进行移植,官方参考硬件平台有K64F、STM32F429,目标平台为STM32F411RE。
移植参考文档为:https://github.com/ARMmbed/uvisor/blob/master/docs/core/PORTING.md#uvisor-porting-guide-for-mbed-os

2 移植步骤
2.1 执行
1) 执行

$ mbed new code #建立code工程

 

2) 执行

$ cd ~/code
$ git clone git@github.com:ARMMbed/uvisor.git

3)~/code/uvisor/platform/stm32/inc/configurations.h
没有修改configurations.h设置,默认设置。

4)~/code/uvisor/platform/stm32/Makefile.configurations

# MPU architecture
ARCH_MPU:=ARMv7M

# Family configurations
CONFIGURATIONS:=\
CONFIGURATION_STM32_CORTEX_M4_0x10000000_0x0

5)对uvisor文件进行编译

$ cd ~/code/uvisor
$ make


结果:

make[2]: Leaving directory '~/code/uvisor'
make[1]: Leaving directory '~/code/uvisor'

2.2 对mbed-os操作
1) 配置STM32F411的uvisor信息
①pwd:
~/code/mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/ device/TOOLCHAIN_GCC_ARM
②startup_stm32f411xe.S 加入uvisor_init初始化;


#if defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED)
ldr r0, =uvisor_init /* [*] Insert this. */
blx r0 /* [*] Insert this. */
#endif /* defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED) */


③STM32F411XE.ld 配置内存分配信息,设置uvisor在STM32F411RE中的内存分配;
④~/features/FEATURE_UVISOR/importer/Makefile 设置目标板SMT32F4.stm32,因为和原始设置一样,所以并没有改动,同时有个疑问,本身STM32F429可行,但是设置完了之后STM32F429也不可行了。
⑤配置完了之后,建立测试空main()进行测试(没有uvisor功能),单独编译没有问题。

3) 对~/features/FEATURE_UVISOR/importer 进行编译

$ make

结果:
cp TARGET_IGNORE/uvisor/docs/api/QUICKSTART.md ..//README.md
cp:无法获取'TARGET_IGNORE/uvisor/docs/api/QUICKSTART.md' 的文件状态(stat):没有那个文件或目录

Makefile:59: recipe for target 'rsync' failed
banmake: *** [rsync] Error 1

3)回到~code/添加mbed_app.json 进行设置,决定工程中是否使用uvisor

{
"target_overrides": {
"*": {
"target.features_add": ["UVISOR"],
"target.extra_labels_add":["UVISOR_SUPPORTED"],
}
},
"macros": [
"FEATURE_UVISOR",
"TARGET_UVISOR_SUPPORTED"
]

2.3 编译

$ mbed compile -m NUCLEO_F411RE -t GCC_ARM –c

结果:
Compile [ 0.3%]: AnalogIn.cpp
[Error] cmsis_vectab_virtual.h@22,37: conflicting declaration of C function 'void vIRQ_SetVector(IRQn_Type, uint32_t)'
[Error] cmsis_vectab_virtual.h@23,37: conflicting declaration of C function 'uint32_t vIRQ_GetVector(IRQn_Type)'
[ERROR] In file included from ./mbed-os/cmsis/core_cm4.h:1536:0,

Parents Reply Children
No Data