This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Stack Pointer base address

Other Parts Discussed in Thread: RM48L950, HALCOGEN

Hello.

I've been reading RM48l950's documentation in search for information about the stack pointer, which I need since I'm writing my own startup code (InitRegs, InitVfp, .... ).

I was unable to find that information anywhere in the documentation (maybe it's somewhere I haven't looked), but I saw that HALcogen uses 0x08000000 as a base address and defines sizes for for user stack, supervisor stack, undefined stack, etc... Does anyone here know where to get that information? Is it arbitrary? Can I define any address and any stack length?

Sorry to keep bothering everybody with my questions, but I've very recently started working with the cortex-R architecture. So ... prepare for more questions : )

  • Pablo,

    Stack is a section of memory user defines to save local variables. There is no requirement about where to put it. You need to analyze your application to check the stack size you would need. In the link command file, you can define a memory section for the stack. In your bootup code, you can assign the stack pointer register with the initial stack address. I am attaching a bootup code and a link command file as an example.

    5516.boot_esm_error_EABI.asm

    http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/766/7317.lnk32_5F00_flash1_5F00_Flash_5F00_Random_5F00_3MB_5F00_EEPROM.cmd

    Please let me know if the above information answers your question.

    Thanks and regards,

    Zhaohong

  • Thank you very much for your response. Sorry I asked such a pretty basic question (after you said it I felt shame for asking that hehe), but I had never written asm code for for booting the system, I always had an already functional init code.

    Thank you again and I'll certainly be troubling you in the future with more questions, especially questions about the microcontroller's safety features ... certainly I won't be able to understand something