Forum Discussion
Altera_Forum
Honored Contributor
20 years agoUpgrading Nios Software - external flash
Dear all, I would like to upgrade my NIOS code by RS232. The NIOS runs from external memory. This is my procedure: - I transfer the .elf file to the .flash file by the instruction el...
Altera_Forum
Honored Contributor
20 years agocode for erasing flash sector
void EraseFlashSector(unsigned int offset) { unsigned char i = 0; volatile char * CommandSeq1 = (char*)(FLASHCTRL_BASE + 0xaaa); *CommandSeq1 = 0xaa; volatile char * CommandSeq2 = (char*)(FLASHCTRL_BASE + 0x555); *CommandSeq2 = 0x55; volatile char * CommandSeq3 = (char*)(FLASHCTRL_BASE + 0xaaa); *CommandSeq3 = 0x80; volatile char * CommandSeq4 = (char*)(FLASHCTRL_BASE + 0xaaa); *CommandSeq4 = 0xaa; volatile char * CommandSeq5 = (char*)(FLASHCTRL_BASE + 0x555); *CommandSeq5 = 0x55; volatile char * CommandSeq6 = (char*)(FLASHCTRL_BASE + offset); *CommandSeq6 = 0x30; // wait for erase completion while(*CommandSeq6 != 0xffffffff){} }