Hi Scott,
>Let us know how you make out :-)
Status today: Everything seems to work.
I tested the interrupt system using a timer in my user application
and it works perfect.
At this time I have no further problems.
I can see a lot of people have been looking at this topic.
So for anyone reading this topic and reaching all the way down to this post.
I would like to sum up everything I did to get this far.
I will not comment on why the settings are the way they are.
This info can be found in the text above (replys).
So here goes:
TARGET:
1. Make an independent bootloader that loads a user application from a nios hardware interface into SDRAM.
(this interface could be anything rs232, parallel port, usb, TCP/IP or custom something).
My project uses a custom interface between a PowerPC and the nios.
2. Bootloader has to call and execute the user application at the end of user application transfer.
3. A nios reset should restart the bootloader so the user application
can be updated or reloaded.
NIOS HARDWARE minimum:
Nios cpu (no comment)
Internal on chip memory (program memory for bootloader)
User application memory (SDRAM in my case)
Interface hardware (my PowerPC - NIOS interface, anything could be used).
SOPC SETTINGS:
Reset address: on chip ram
Exception address: user application memory (sdram)
Break location: whatever
SOFTWARE SETTINGS (Nios IDE)
1. Bootloader:
Program mem (.text): on chip ram
Read only mem (.rodata) : on chip ram
Read/write mem (.rwdata) : on chip ram
Heap mem: on chip ram
Stack mem: on chip ram
System clock timer: select none
2. User application
Program mem (.text): SDRAM
Read only mem (.rodata) : SDRAM
Read/write mem (.rwdata) : SDRAM
Heap mem: SDRAM
Stack mem: SDRAM
SOFTWARE BOOTLOADER
This should be a freestanding application.
Use hallo freestanding as template.
Delete any init functions calls in this code
(These will probably cause something bad to happen).
//alt_sys_init();
//alt_sys_init();
//alt_io_redirect();
The first thing the bootloader should do is to
copy the user program into the user application memory.
Can’t help with this. This depends on the interface you are using)
When this is done all that is left is to call the user application, flush icache and dcache.
alt_icache_flush_all();
alt_dcache_flush_all();
AppStartP = (void*)0x10001c8; // _start address (found in objdump file)
AppStartP(); // call application
SOFTWARE USER APP:
Do whatever you need to do.
GENERATION OF USER APPLICATION UPLOAD FILE
Click Start->All programs->Altera->Nios II development kit -> nios II SDK shell
In the console use elf2hex:
elf2hex --input=userapp.elf --start=0x1000000 --end=0x1ffffff –width= 8
This creates a hex file named userapp.hex that contains the user program.
This can be changed to binary or whatever are needed using normal hex2bin tools.
It’s not needed to set end addr to the end of the sdram(my case) only to the end of user application (look in objdump file)
---------------------------------------------
This seems real simple when you know how.
-comments to Scott
>My guess is: (1) you have at least 1 timer
Correct! What a great guess
> It’s selected as the system clock in your syslib properties
Correct again!
Now Scott how do you know all this (all of it)? Your understanding of the nios system seems amazing,
you deserve the NIOS GOD status of your profile.
Your help has been amazing and I’m very grateful to you, but also to the nios
community for making this possible.
Thank you all
Feel free to comment on anything.
I will be reading any comments.
Regards,
--Rasdan