OpenCores
no use no use 1/1 no use no use
Stack configuration
by ClockworkRed on Apr 27, 2016
ClockworkRed
Posts: 19
Joined: May 6, 2011
Last seen: Oct 26, 2016
Hi all,

we just migrated to the new openrisc newlib compiler toolchain and encounter a problem with the stack.

Is there a simple example how to set up the stack via linker script or a board def file somewhere one could point us to?

From the boot up code it looks like we have to set

_or1k_board_mem_base
_or1k_board_mem_size
_or1k_exception_stack_size
_or1k_stack_size

but somehow as soon as the or1k_init function is called that uses the stack for the first time, we get an access to a completely wrong address.

Thanks for any help,
regards,
Daniel
RE: Stack configuration
by wallento on Apr 27, 2016
wallento
Posts: 28
Joined: Jan 24, 2009
Last seen: Nov 8, 2018
Hi Daniel,

you are right about what you find. The default way is to use a board file using the -mboard switch. The default is or1ksim: https://github.com/openrisc/newlib/blob/or1k/libgloss/or1k/boards/or1ksim.S

I think everything that is "weak" can be overwritten by user code, so your method should work actually. I will double-check to test it, too. Which version are you using?

Cheers,
Stefan
RE: Stack configuration
by ClockworkRed on Apr 27, 2016
ClockworkRed
Posts: 19
Joined: May 6, 2011
Last seen: Oct 26, 2016
Thanks Stefan,

with the example we solved the problem.

Regards,
Daniel
RE: Stack configuration
by olof on Apr 27, 2016
olof
Posts: 218
Joined: Feb 10, 2010
Last seen: Dec 17, 2018
Hi Daniel,

If you need more help in the future, you can also sign up on the OpenRISC mailing list at https://lists.librecores.org/ or join us on IRC #openrisc @ freenode.net

Best Regards,
Olof Kindgren
no use no use 1/1 no use no use
© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.