0
\$\begingroup\$

I have searched for hours trying to find stack structures for cortex m and cortex a devices. I am attempting to add freertos debugging support for the cortex a5 to eclipse via the jlink SDK. The code for the jlink and the code for openocd are similar, and both show the same offsets for the cortex M, which show a non contiguous arrangement. All the data sheets I can find for the a5 and the M don’t show in what order these are pushed and popped into stack ram, but obviously the writers of that code found it somewhere. Perhaps I just don’t know what to google, or maybe I have a misunderstanding here, but where could I find this information?

\$\endgroup\$
  • \$\begingroup\$ Have you looked in the core architecture documentation published by ARM? It's a bit indirect, and I can't remember ARM's nomenclature, but they have some code for the architecture. You need to go speelunking on their website to find the correct documents. (And, alas, I'm not at the computer where I have copies of those, so I can't give you their numbers). \$\endgroup\$ – TimWescott Jan 5 at 0:03
  • \$\begingroup\$ It’s probably a case of not knowing how to look. Is it going to be more generic than cortex A5 docs for example? \$\endgroup\$ – Erik Friesen Jan 5 at 0:17
  • \$\begingroup\$ So I look in the ARM ® Cortex -M4 Processor Technical Reference Manual, which points me to the ARM ® v7-M Architecture Reference Manual, and if I'm remembering correctly it's the Architecture Reference Manual that has all the useful bits (after much digging -- this stuff is not laid out like a textboox!). The Cortex M0 uses the v6-M architecture; I dunno about the M0+ or the M7. \$\endgroup\$ – TimWescott Jan 5 at 4:29
0
\$\begingroup\$

This is defined in GDB, GCC and FreeRTOS rather than ARM. I had some misconceptions about how this worked, and really the stack info I needed was stored in the TCBstub/List pointer in the order specified by the port and the items being pushed onto the stack before context switching.

The order of the 'g' packet is defined by gcc/gdb and can be viewed by the command "maint print registers" from the gdb console.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.