Immediate runtime exception in BL31

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Immediate runtime exception in BL31

Jump to solution
1,982 Views
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 Kudos
Reply
1 Solution
1,925 Views
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

View solution in original post

3 Replies
1,948 Views
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 Kudos
Reply
1,943 Views
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 Kudos
Reply
1,926 Views
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%3EImmediate%20runtime%20exception%20in%20BL31%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1951427%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20have%20a%20custom%20board%20built%20around%20the%20S32G3.%20I%20am%20attempting%20to%20get%20into%20U-Boot.%20I%20can%20successfully%20load%20into%20BL2%20and%20complete%20execution%20of%20that%20entire%20codebase.%20As%20soon%20as%20it%20goes%20into%20%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%20I%20get%20a%20runtime%20exception%26nbsp%3B%40%200xff6000424.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EAdding%20a%20breakpoint%20at%20the%20start%20of%20bl31_main.c%20the%20application%20will%20immediately%20crash%20and%20go%20%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%3Ehere%3C%2FA%3E.%3C%2FP%3E%3CP%3EAny%20idea%20why%20this%20might%20be%20the%20case%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1952570%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Immediate%20runtime%20exception%20in%20BL31%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1952570%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EFor%20what%20I%20can%20see%2C%20the%20address%20to%20load%20the%20BL31%20is%20defined%20in%26nbsp%3B%3CEM%3Ebl31%2Fbl31.ld.S%3C%2FEM%3E%2C%20as%26nbsp%3B%3CSTRONG%3EBL31_BASE%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22alejandro_e_0-1726086946883.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22alejandro_e_0-1726086946883.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F298626i2551D81A33670EDA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22alejandro_e_0-1726086946883.png%22%20alt%3D%22alejandro_e_0-1726086946883.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Ethis%20comes%20from%20the%20following%20nested%20definitions%3A%3C%2FP%3E%0A%3CP%3E%3CEM%3Eplat%2Fnxp%2Fs32%2Fs32cc%2Finclude%2Fs32cc_platform_def.h%3A134%3C%2FEM%3E%3A%3CSTRONG%3E%23define%20BL31_BASE%20(S32_PMEM_START)%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CEM%3Eplat%2Fnxp%2Fs32%2Fs32cc%2Finclude%2Fs32cc_platform_def.h%3A129%3A%3C%2FEM%3E%3CSTRONG%3E%23define%20S32_PMEM_START%20(S32_PMEM_END%20-%20S32_PMEM_LEN%20%2B%201)%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CEM%3Eplat%2Fnxp%2Fs32%2Fs32cc%2Finclude%2Fs32cc_platform_def.h%3A127%3A%3C%2FEM%3E%3CSTRONG%3E%23define%20S32_PMEM_END%20(BL33_BASE%20-%201)%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CEM%3Eplat%2Fnxp%2Fs32%2Fs32cc%2Finclude%2Fs32cc_platform_def.h%3A112%3A%3C%2FEM%3E%3CSTRONG%3E%23define%20BL33_BASE%20(S32_DDR0_END%20-%20S32_BL33_IMAGE_SIZE%20-%20%5C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CEM%3Eplat%2Fnxp%2Fs32%2Fs32cc%2Finclude%2Fs32cc_platform_def.h%3A94%3A%3C%2FEM%3E%3CSTRONG%3E%23define%20S32_DDR0_END%200xffffffff%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3Enote%20that%20this%20last%20definition%20depends%20on%20%3CSTRONG%3ES32_PLATFORM_DDR0_END%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22alejandro_e_1-1726087186168.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22alejandro_e_1-1726087186168.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F298627iA651B6FDA33E72BB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22alejandro_e_1-1726087186168.png%22%20alt%3D%22alejandro_e_1-1726087186168.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIt%20could%20be%20that%20the%20top%20of%20your%20ram%20does%20not%20match%20address%26nbsp%3B%3CSTRONG%3E0xffffffff%26nbsp%3B%3C%2FSTRONG%3Eand%20this%20is%20generating%20the%20problem.%20You%20could%20define%20your%20own%26nbsp%3B%3CSTRONG%3ES32_PLATFORM_DDR0_END%26nbsp%3B%3C%2FSTRONG%3Eto%20match%20your%20RAM%20addresses%2C%20this%20in%20turn%2C%20would%20change%26nbsp%3B%3CSTRONG%3ES32_DDR0_END%26nbsp%3B%3C%2FSTRONG%3Eas%20you%20can%20see%20in%20the%20image%20above.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ELet%20me%20know%20if%20this%20information%20was%20useful%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1952520%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Immediate%20runtime%20exception%20in%20BL31%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1952520%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20using%20the%20bsp40.0-2.5%20release%20of%20the%20arm-trusted%20firmware.%20Additionally%20the%20BL2%20loads%20BL31%20at%200xff600000%20but%20cannot%20find%20in%20the%20AT-F%20code%20base%20where%20this%20is%20called%20out.%20Simply%20a%20single%20define%20for%20a%20board%20that%20I%20am%20not%20using%20anywhere.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1952418%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Immediate%20runtime%20exception%20in%20BL31%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1952418%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F234092%22%20target%3D%22_blank%22%3E%40minersrevolt%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EWe%20are%20unable%20to%20provide%20full%20support%20for%20custom%20designs%26nbsp%3Bthrough%20this%20channel.%20With%20that%20said%2C%20to%20be%20able%20to%20help%20you%20I%20need%20to%20know%20if%20you%20are%20using%20an%20specific%20BSP%20version%20as%20base%20to%20setup%20your%20system%20or%20are%20you%20using%20the%20latest%20components%20available%20in%20the%26nbsp%3Bnxp-auto-linux%20GitHub%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20can%20also%20recommend%20to%20post%20your%20problem%20in%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.arm.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Earm%20community%3C%2FA%3E%26nbsp%3Bsince%20it%20is%20related%20to%20the%20arm%20trusted%20firmware.%3C%2FP%3E%3C%2FLINGO-BODY%3E