Forum Discussion
Altera_Forum
Honored Contributor
12 years agoHow to boot baremetal code from sd card
Hi I want to boot the baremetal code from sd card. I need some examples and the procedure about how to write the binary to SD card
Altera_Forum
Honored Contributor
12 years agoYou'll need to have boot code that understands how to read from the SD card as preset data in an M9K (or equivalent) memory block and to point the Nios's reset vector into that code.
Since you know the Avalon address that will be used for the boot code, you don't need to make it position independant - so it can be written in C quite easily. I've posted minimal linker scripts before - all you need in assembler are the instructions to set %gp and %sp and a jump to the start of your C code. Without any of the Altera HAL/libc functions you can do a lot in a small amount of code. Never mind non-RTOS images, ones without even the HAL (etc) support are very useful. Especially if you want to run from internal memory