Forum Discussion
Altera_Forum
Honored Contributor
15 years agoYou need to write an Avalon MM master that is connected external pins and use that to write to the memory. You probably have a suitable external interface already (used for other command/status info).
The interface doesn't need to be 32bit since efficiency isn't a big problem! With an 8 bit interface I'd do something like: 4 bytes data (read/write) 4 (maybe 3) bytes address (24bit addressing is probably enough) 1 byte command status. Commands include 'read word', 'write word', 'assert reset', 'remove reset' (etc). If you don't want to assume that the Avalon cycle will be quicker than the host cycle, you'll need to read to check each cycle is complete. Loading from a fully fixed-up elf program file is easy - look at the program headers. Alternatively you can use objcopy to extract the sections and convert them into arm object files which can be linked as data into your arm program (you can even link the arm program with the symbol table from the nios program!).