dimag0g / nios_duino

NIOSDuino - Arduino framework running on NIOS II
GNU Lesser General Public License v2.1
17 stars 2 forks source link

Support for EPCQ serial flash #1

Closed alpensalamander closed 5 years ago

alpensalamander commented 5 years ago

I love the Project and it works well with my Cyclone IV Dev Board. Now with my CYC1000 Board with external RAM the NIOS Core doesn't work with the EPCS and would need an EPCQ instead. Could somebody tell me what to do to get this Board to work?

dimag0g commented 5 years ago

Hi, the software will likely work just the same, it's the Qsys project that must be adapted in order to use EPCQ. AFAIK EPCQ can be used the same way as EPCS (with a bootloader copying the software from Flash to RAM), and additionally it can be configured to execute the software directly from the Flash. I'll see if I can get EPCQ component to work with my hardware, or eventually I'll get that board you mention, then I'll update the Qsys file, but it will take a while. You're welcome to contribute if you figure it out first.

alpensalamander commented 5 years ago

So I tried it myself but ran into an error. I included the epcq controller like that: Contents Address Vector And got this error when creating the Nios project in Eclipse: Message

Here are my project files: NIOSDuino10.zip

alpensalamander commented 5 years ago

This is my Error: SEVERE: [Error] altera_hal_linkerx_generator: Required linker section mappings do not exist: "[.entry, .exceptions, .rodata, .rwdata, .text, .bss, .heap, .stack]" SEVERE: [Error] altera_hal_linkerx_generator: Required linker section mappings do not exist: "[.entry, .exceptions, .rodata, .rwdata, .text, .bss, .heap, .stack]" SEVERE: nios2-bsp-create-settings failed. nios2-bsp: nios2-bsp-create-settings failed

dimag0g commented 5 years ago

Your settings suggest that you're trying to use a boot copier to copy EPCQ contents to SDRAM and execute the code from SDRAM. In this case you need to make sure that all linker sections are set to SDRAM (Linker Script tab in BSP editor), and all advanced linker settings ("allow code at reset", etc) are unchecked.

Alternatively, you can try to set up your system to execute the code in-place from EPCQ. That would require setting the reset vector to avl_mem instead of avl_csr, and adjusting linker settings as described e.g. here: https://docplayer.net/51472292-Nios-ii-processor-booting-from-altera-serial-flash-epcq.html

Edit: I just made a system with "Altera Serial Flash Controller" which supports EPCS16 (instead of "Altera Serial Flash Controller II" that you use and that only supports EPCQxx), and it indeed works as expected, including in-place execution.

alpensalamander commented 5 years ago

This is also fixed, by the way