Skip to content

Why not set stack-pointer to end of stack? #37

@cobratbq

Description

@cobratbq

I noticed that the stack-pointer is initialized to just below the end of the stack. Is there a specific reason for this? My understanding is that the stack-pointer is decremented upon each use of the stack, so setting it to TK1_RAM_BASE+TK1_RAM_SIZE (or ORIGIN(RAM) + LENGTH(RAM) in terms of the linker-script), should be optimal.

libcrt0/crt0.S:

/* init stack below 0x40020000 (TK1_RAM_BASE+TK1_RAM_SIZE) */
li sp, 0x4001fff0

Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions