Skip to content

Instantly share code, notes, and snippets.

@ssvb
Created August 15, 2015 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssvb/e395652fc5a3012f8f4b to your computer and use it in GitHub Desktop.
Save ssvb/e395652fc5a3012f8f4b to your computer and use it in GitHub Desktop.
A80 fel stack location test
# str sp, [pc]
fel fill 0x10000 1 0x00
fel fill 0x10001 1 0xd0
fel fill 0x10002 1 0x8f
fel fill 0x10003 1 0xe5
# bx lr
fel fill 0x10004 1 0x1e
fel fill 0x10005 1 0xff
fel fill 0x10006 1 0x2f
fel fill 0x10007 1 0xe1
fel exe 0x10000
fel hex 0x10008 4
@wens
Copy link

wens commented Aug 17, 2015

result:

00010008: d0 5a 01 00 __ __ __ __ __ __ __ __ __ __ __ __ .Z..............

@ssvb
Copy link
Author

ssvb commented Aug 17, 2015

It means that the stack pointer is at 0x15AD0. And given that 0x15AD0 - 0x12000 = 15056 bytes (about that much is available for the uploaded code without the risk of overwriting the BROM FEL stack), the stack layout looks pretty much similar to other Allwinner SoC variants. Except that the base address is 0x10000 instead of 0x0.

@ssvb
Copy link
Author

ssvb commented Aug 18, 2015

Indeed, the addresses of the stacks on A80 are 0x12000 and 0x17000 as can be seen in the A80 BROM disassembly listing: https://github.com/hno/Allwinner-Info/blob/master/A80/BROM.S#L80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment