Forum Discussion
Altera_Forum
Honored Contributor
20 years ago<div class='quotetop'>QUOTE </div>
--- Quote Start --- I want to run the firmware in on_chip_ram. The reset address should be the EPCS4 address. The flash loader program copys the firmware from epcs4 and relocates it to the on_chip_ram. The exception address should in the on_chip_ram address. So maybe the exception handlier will conflit with the firmware. For example, the EPCS4 start address is 0x000000, the on_chip_ram start address is 0x1000000, so the reset address is setted at 0x000000, and the exception address is at 0x100020, is it OK? Why?[/b] --- Quote End --- The exception address should be located in the onchip memory range. Did you mean 0x100020 or 0x01000020? (you said onchip ram is located at 0x01000000) Reset should be located at the EPCS controller because it contains a bootloader that you want to run at reset which copies the code compiled for onchip ram (selected in the system library project in the Nios II IDE) into the onchip ram. <div class='quotetop'>QUOTE </div> --- Quote Start --- I can controll the external RAM or FIFO using Avalon registered bus. How can I create the HAL drivers for on_chip_ram, FIFOs, or user logic? If I use the full flag to interrupt the niosII, how to do?[/b] --- Quote End --- I'm not going to cover the external RAM since I don't know what memory you are referring to (you either have it directly mapped, or use a HAL function that handles the protocol between the controller and memory). The full flag can be used as the interrupt signal into SOPC Builder (so add a custom interface to your FIFO with readdata, clk, reset, read_n, irq, etc....) then the interrupt triggers an interrupt service routine to start emptying the FIFO. <div class='quotetop'>QUOTE </div> --- Quote Start --- I have read some Altera documents but finf no answers. What documents shopuld I read?[/b] --- Quote End --- http://www.altera.com/literature/hb/nios2/...sw_nii52006.pdf (http://www.altera.com/literature/hb/nios2/n2sw_nii52006.pdf) <--- exception handling (for your interrupt) http://www.altera.com/literature/hb/nios2/...sw_nii52010.pdf (http://www.altera.com/literature/hb/nios2/n2sw_nii52010.pdf) <--- HAL http://www.altera.com/literature/hb/nios2/...w_nii5v2_02.pdf (http://www.altera.com/literature/hb/nios2/n2sw_nii5v2_02.pdf) <--- HAL http://www.altera.com/literature/hb/qts/qt...ts_qii54005.pdf (http://www.altera.com/literature/hb/qts/qts_qii54005.pdf) <--- Component Editor That should get you started.