Altera_Forum
Honored Contributor
11 years agocycloneive boot from sd card
Hello to all!
I'm working with a cycloneive board. I use the program university avalon sd card interface, and i can read and write a file (fat16) from/to a 2GB sd card. I would copy a .bin file to sd card, generated with "nios2-elf-objcopy -O binary file.elf output_file.hex" command, and store it in in sdram memory for execute it: int mem=0; int* pt_sdram=(SDRAM_0_BASE +0x00100000); unsigned char midata[4]; for(i=2020;i>0;i--){ mem=0; midata[0]= alt_up_sd_card_read(sd_fileh); midata[1]= alt_up_sd_card_read(sd_fileh); midata[2]= alt_up_sd_card_read(sd_fileh); midata[3]= alt_up_sd_card_read(sd_fileh); /* */ mem=midata[0]; mem<<=8; mem|=midata[1]; mem<<=8; mem|=midata[2]; mem<<=8; mem|=midata[3]; IOWR(pt_sdram,0,mem); ++pt_sdram; } //andrun it with: asm ( "call (SDRAM_0_BASE +0x00100000);" ); Is it possible? TNX, Luca