Forum Discussion
19 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- What's the point of that slow clock in the system? Nios II/f will definitely run on 75MHz, so I'd just use the same clock in all components. Are You using JTAG_UART in bootloader app? E.g. doing a printf() or something? --- Quote End --- I changed all the clocks to 75 except the input of the PLL, did not seem to make a difference. There are no prints in my .hex code, literally just the sys_init, 2 usleeps, and 2 IOWR to the LED to blink the LED. Also in the BSP editor, I have the stderr, input, output set to none instead of JTAG_UART. I did notice something interesting. Kind of confusing, if I...- Shut off power, turn on power
- Wait for the config to finish, the LED doesn't blink (program isn't running)
- Then program the FPGA in Quartus, the LED doesn't blink (program isn't running)
- Then run the Nios download from Eclipse, the LED starts to blink (program is running)
- Then reprogram the FPGA in Quartus, the LED stops while it's being programmed, then starts blinking again (program is running again)
- Altera_Forum
Honored Contributor
Paste the source code to pastebin.org
It should work if the hex is correct. - Altera_Forum
Honored Contributor
--- Quote Start --- Paste the source code to pastebin.org It should work if the hex is correct. --- Quote End --- Blocked, but I attached the file. - Altera_Forum
Honored Contributor
I came up with the most basic SOPC system and Nios design I could (basically just CPU, on chip RAM, LEDs, and sysid) and it works on powerup. I don't know if this is more discouraging or encouraging.
- Altera_Forum
Honored Contributor
You don't need that init stuff... Where did You find that? Try this:
# include "altera_avalon_pio_regs.h"# include "system.h"# include <stddef.h> int main(void) { while (1) { usleep(1000*1000); IOWR_ALTERA_AVALON_PIO_DATA(USER_LEDS_BASE, 1); usleep(1000*1000); IOWR_ALTERA_AVALON_PIO_DATA(USER_LEDS_BASE, 0); } return 0; } - Altera_Forum
Honored Contributor
The init stuff was in the advanced boot loader. I did this:
- Took out the init stuff
- Set the system timer to none in the BSP
- Changed the device configuration to active serial in the device and pin options (this is wrong, mine is active parallel)
- Altera_Forum
Honored Contributor
Too much changes to make a good conclusion, but I believe timer has nothing to do with the startup. It was probably that init stuff...
- Altera_Forum
Honored Contributor
My need is similar to yours Kirshna, The reason I'm using SDRAM is because the program is too big for on-chip RAM. Using nios2-download, I end up with the elf image running in SDRAM. So, what is the "magic" that allows this to work? If that can be duplicated in a stand-alone situation, then the problem is solved.
the fundamental question is what is Altera's recommendation for users who need to have the CPU on the board with the FPGA load the FPGA pattern and the nios elf image from files accessible to the CPU. Is it really such a big issue that the nios runs from SDRAM? This means that the FPGA load image can be upgraded in the field. This seems like a common need. We are not trying to do something out of the ordinary. What is the "offical" Altera solution? - Altera_Forum
Honored Contributor
Well You can use only pointers to copy all the data instead of memcpy() and it should save some space. Also I'd offer to use CRC for the binary data, since it is pretty common to have an invalid bit or byte in like 100 boot-ups.