Immediate runtime exception in BL31

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Immediate runtime exception in BL31

跳至解决方案
1,985 次查看
minersrevolt
Contributor III

I have a custom board built around the S32G3. I am attempting to get into U-Boot. I can successfully load into BL2 and complete execution of that entire codebase. As soon as it goes into BL31 I get a runtime exception @ 0xff6000424. 

Adding a breakpoint at the start of bl31_main.c the application will immediately crash and go here.

Any idea why this might be the case?

0 项奖励
回复
1 解答
1,928 次查看
alejandro_e
NXP TechSupport
NXP TechSupport

For what I can see, the address to load the BL31 is defined in bl31/bl31.ld.S, as BL31_BASE

alejandro_e_0-1726086946883.png

this comes from the following nested definitions:

plat/nxp/s32/s32cc/include/s32cc_platform_def.h:134:#define BL31_BASE (S32_PMEM_START)
plat/nxp/s32/s32cc/include/s32cc_platform_def.h:129:#define S32_PMEM_START (S32_PMEM_END - S32_PMEM_LEN + 1)
plat/nxp/s32/s32cc/include/s32cc_platform_def.h:127:#define S32_PMEM_END (BL33_BASE - 1)
plat/nxp/s32/s32cc/include/s32cc_platform_def.h:112:#define BL33_BASE (S32_DDR0_END - S32_BL33_IMAGE_SIZE - \
plat/nxp/s32/s32cc/include/s32cc_platform_def.h:94:#define S32_DDR0_END 0xffffffff

 

note that this last definition depends on S32_PLATFORM_DDR0_END

alejandro_e_1-1726087186168.png

 

It could be that the top of your ram does not match address 0xffffffff and this is generating the problem. You could define your own S32_PLATFORM_DDR0_END to match your RAM addresses, this in turn, would change S32_DDR0_END as you can see in the image above.

 

Let me know if this information was useful

在原帖中查看解决方案

3 回复数
1,951 次查看
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @minersrevolt ,

We are unable to provide full support for custom designs through this channel. With that said, to be able to help you I need to know if you are using an specific BSP version as base to setup your system or are you using the latest components available in the nxp-auto-linux GitHub? 

I can also recommend to post your problem in the arm community since it is related to the arm trusted firmware.

0 项奖励
回复
1,946 次查看
minersrevolt
Contributor III

I am using the bsp40.0-2.5 release of the arm-trusted firmware. Additionally the BL2 loads BL31 at 0xff600000 but cannot find in the AT-F code base where this is called out. Simply a single define for a board that I am not using anywhere. 

0 项奖励
回复
1,929 次查看
alejandro_e
NXP TechSupport
NXP TechSupport

For what I can see, the address to load the BL31 is defined in bl31/bl31.ld.S, as BL31_BASE

alejandro_e_0-1726086946883.png

this comes from the following nested definitions:

plat/nxp/s32/s32cc/include/s32cc_platform_def.h:134:#define BL31_BASE (S32_PMEM_START)
plat/nxp/s32/s32cc/include/s32cc_platform_def.h:129:#define S32_PMEM_START (S32_PMEM_END - S32_PMEM_LEN + 1)
plat/nxp/s32/s32cc/include/s32cc_platform_def.h:127:#define S32_PMEM_END (BL33_BASE - 1)
plat/nxp/s32/s32cc/include/s32cc_platform_def.h:112:#define BL33_BASE (S32_DDR0_END - S32_BL33_IMAGE_SIZE - \
plat/nxp/s32/s32cc/include/s32cc_platform_def.h:94:#define S32_DDR0_END 0xffffffff

 

note that this last definition depends on S32_PLATFORM_DDR0_END

alejandro_e_1-1726087186168.png

 

It could be that the top of your ram does not match address 0xffffffff and this is generating the problem. You could define your own S32_PLATFORM_DDR0_END to match your RAM addresses, this in turn, would change S32_DDR0_END as you can see in the image above.

 

Let me know if this information was useful

%3CLINGO-SUB%20id%3D%22lingo-sub-1951427%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBL31%20%E4%B8%AD%E7%AB%8B%E5%8D%B3%E5%8F%91%E7%94%9F%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1951427%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E6%9C%89%E4%B8%80%E5%9D%97%E5%9B%B4%E7%BB%95%20S32G3%20%E6%9E%84%E5%BB%BA%E7%9A%84%E5%AE%9A%E5%88%B6%E6%9D%BF%E3%80%82%E6%88%91%E6%AD%A3%E5%9C%A8%E5%B0%9D%E8%AF%95%E8%BF%9B%E5%85%A5%20U-Boot%E3%80%82%E6%88%91%E5%8F%AF%E4%BB%A5%E6%88%90%E5%8A%9F%E5%8A%A0%E8%BD%BD%E5%88%B0%20BL2%20%E5%B9%B6%E5%AE%8C%E6%88%90%E6%95%B4%E4%B8%AA%E4%BB%A3%E7%A0%81%E5%BA%93%E7%9A%84%E6%89%A7%E8%A1%8C%E3%80%82%E4%B8%80%E6%97%A6%E8%BF%9B%E5%85%A5%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-auto-linux%2Farm-trusted-firmware%2Fblob%2Frelease%2Fbsp40.0-2.5%2Fbl31%2Fbl31_main.c%23L105%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EBL31%3C%2FA%3E%20%EF%BC%8C%E6%88%91%E5%B0%B1%E4%BC%9A%E6%94%B6%E5%88%B0%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%400xff6000424%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%E5%9C%A8%20bl31_main.c%20%E7%9A%84%E5%BC%80%E5%A4%B4%E6%B7%BB%E5%8A%A0%E6%96%AD%E7%82%B9%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E5%B0%86%E7%AB%8B%E5%8D%B3%E5%B4%A9%E6%BA%83%E5%B9%B6%E8%BD%AC%E5%88%B0%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-auto-linux%2Farm-trusted-firmware%2Fblob%2Frelease%2Fbsp40.0-2.5%2Fbl31%2Faarch64%2Fruntime_exceptions.S%23L308%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%E6%AD%A4%E5%A4%84%3C%2FA%3E%E3%80%82%3C%2FP%3E%3CP%3E%E7%9F%A5%E9%81%93%E4%B8%BA%E4%BB%80%E4%B9%88%E4%BC%9A%E5%87%BA%E7%8E%B0%E8%BF%99%E7%A7%8D%E6%83%85%E5%86%B5%E5%90%97%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1952520%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ABL31%20%E4%B8%AD%E7%AB%8B%E5%8D%B3%E5%8F%91%E7%94%9F%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1952520%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20arm-trusted%20%E5%9B%BA%E4%BB%B6%E7%9A%84%20bsp40.0-2.5%20%E7%89%88%E6%9C%AC%E3%80%82%E6%AD%A4%E5%A4%96%EF%BC%8CBL2%20%E5%9C%A8%200xff600000%20%E5%A4%84%E5%8A%A0%E8%BD%BD%20BL31%EF%BC%8C%E4%BD%86%E5%9C%A8%20AT-F%20%E4%BB%A3%E7%A0%81%E5%BA%93%E4%B8%AD%E6%89%BE%E4%B8%8D%E5%88%B0%E8%B0%83%E7%94%A8%E8%AF%A5%E4%BB%A3%E7%A0%81%E7%9A%84%E4%BD%8D%E7%BD%AE%E3%80%82%E8%BF%99%E5%8F%AA%E6%98%AF%E4%B8%80%E5%9D%97%E6%88%91%E6%B2%A1%E6%9C%89%E5%9C%A8%E4%BB%BB%E4%BD%95%E5%9C%B0%E6%96%B9%E4%BD%BF%E7%94%A8%E7%9A%84%E6%9D%BF%E7%9A%84%E5%8D%95%E4%B8%80%E5%AE%9A%E4%B9%89%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E