- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have a system with a 1s10 and Nios II with an exception address pointing to an internal Boot Monitor ROM. I have built (in SOPC builder) into the Boot ROM a .c file which turns on some lights and things. When that is done running - I want it to set the program counter to run out of either RAM or Flash. Anybody know how I can direct the PC to a new address (in c code compiled by SOPC builder into a ROM)??? thanks, JohnLink Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi John,
You can do something like this:#define SOME_ADDR 0x ....
void whatever ()
{
void (*foo)(void) = (void (*)(void)) SOME_ADDR;
...
foo(); /* call SOME_ADDR */
}
Regards, --Scott
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the tip. I'll try it this morning sometime and I'll let you know...
Of course it will be hard for me to tell if it works because I'm having a problem running out of external flash. When I program external flash with my program (via the Flash Programmer in the N2 IDE which reports success) and set the reset vector to external flash in SOPC builder - nothing happens on reset or power up, the program doesn't run. Yet I can run from external RAM no problem. Any ideas on that one? thanks again!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I presume you are setting the reset vector before generating your software. If you have modified your hardware more recently than your software then this may be your problem.
You can debug your boot loader (with the 1.1 kit) by setting up a launch configuration for the project and selecting the "reset target and attach to program at reset vector" option. You should then be able to step into your code. You will need a processor with hardware breakpoints if you want to insert breakpoints or step over anything.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page