LS1043A: How to run Aarch32 apps

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

LS1043A: How to run Aarch32 apps

3,175 Views
alexsels
Contributor I


Hi,

Is it possible to find code examples for switching Aarch64 mode to Aarch32? (Running Aarch32 baremetal binaries on Cortex-A53).

Labels (1)
0 Kudos
Reply
5 Replies

2,436 Views
michelle
NXP Pro Support
NXP Pro Support

Hi Art,

Sorry I don't know of a code example for this in our SDK or otherwise.  The procedure in Linux is typically making a syscall to go into the kernel state (EL1) and executing the aarch32 application on return from there.  This is done by the libraries by pointing at it with ELR_ELn before executing the ERET instruction.  For bare metal it should be similar but you would need to choose the exception to take and code it.  I will check with our SDK team to see if they have an example application which does this.

0 Kudos
Reply

2,436 Views
alexsels
Contributor I

Thank you for answer,

Can you show me a code example how to do this?

0 Kudos
Reply

2,436 Views
michelle
NXP Pro Support
NXP Pro Support

Hi

The arm processor should just recognize aarch32 instructions and execute them in that mode.  The trick is making the change in state from aarch64 to aarch32 which needs to happen at an exception boundary.  So running in aarch64, get an exception at EL1 or EL0 (trap etc), and in that handler have code that is aarch32 run.  Easy as falling off a log :smileyhappy:

0 Kudos
Reply

2,436 Views
alexsels
Contributor I

Thank you for information.

My question was about code for switching Aarch64 state to Aarch32. When LS1043A-RDB starts, Uboot is running after reset and only if uboot is working,  CMSIS-DAP is able connect to target. Uboot is working in Aarch64 and Baremetal application is not able to run in this state. Can you suggest a right way how to switch to Aarch32 state?

Thank you!

0 Kudos
Reply

2,436 Views
Pavel
NXP Employee
NXP Employee

Use CodeWarrior Development Software for ARM v8 64-bit based QorIQ LS-Series Processors. This CodeWarrior is available on the following page:

http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/qoriq-arm-processors/qori...

This CodeWarrior supports Aarch64 and Aarch32 project. See attached file.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply