Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
883 Views

Proper way of connecting EPCQ configuration to Nios II-based system

Hi All!

 

What is correct IP to connect EPCQ32-A configuration flash to Nios II-based system (on Cyclone IV). There are four options in Quartus 18.1:

  1. Legacy EPCS/EPCQx1 Flash controller
  2. Serial Flash Controller
  3. Serial Flash Controller II
  4. Generic Serial Flash Interface

 

Nios II boots from EPCQ starting at some address (after fpga image).

 

The main problem is that we are unable to use quartus_pgm utility with --nios2 command line flag. We tried all of the IPs above, but it fails in different ways:

  1. Unable to reset and pause target processor
  2. Unable to erase flash
  3. Verify step passes, erase step fails
  4. Unable to locate CSR register while erasing (--erase_all option), but programming works ok with same --csr setting
  5. Crashing with access violation after correct programming (this is with option #2, but only if EPCQ base address is not 0x0)

 

Access violation arrives every time quartus_pgm exits with success (code 0x0).

 

Is there any reference design or template for this configuration (Cyclone IV, Nios II, EPCQ-A)?

 

Yurii

0 Kudos
3 Replies
Highlighted
Beginner
28 Views

I think I've figured out the root cause of all problems. EPCQ reset was not connected to Nios II debug_reset_request signal.

But the problem with access violation persists. Every time quartus_pgm finishes programming of EPCQ flash (with --nios2 option)

it returns code 0x0 and programs everything correctly, but displays an access violation message.

 

Below is the full log of quartus_pgm utility. First it programs *.sof file, then programs *.flash files.

 

Info: *******************************************************************

Info: Running Quartus Prime Programmer

   Info: Version 18.1.0 Build 625 09/12/2018 SJ Lite Edition

   Info: Copyright (C) 2018 Intel Corporation. All rights reserved.

   Info: Your use of Intel Corporation's design tools, logic functions

   Info: and other software and tools, and its AMPP partner logic

   Info: functions, and any output files from any of the foregoing

   Info: (including device programming or simulation files), and any

   Info: associated documentation or information are expressly subject

   Info: to the terms and conditions of the Intel Program License

   Info: Subscription Agreement, the Intel Quartus Prime License Agreement,

   Info: the Intel FPGA IP License Agreement, or other applicable license

   Info: agreement, including, without limitation, that your use is for

   Info: the sole purpose of programming logic devices manufactured by

   Info: Intel and sold by Intel or its authorized distributors. Please

   Info: refer to the applicable agreement for further details.

   Info: Processing started: Wed Feb 06 12:37:53 2019

Info: Command: quartus_pgm -c "USB-Blaster [USB-0]" -m jtag -o p;mk.sof

Info (213045): Using programming cable "USB-Blaster [USB-0]"

Info (213011): Using programming file mk.sof with checksum 0x00BECB69 for device

 EP4CE40F23@1

Info (209060): Started Programmer operation at Wed Feb 06 12:37:54 2019

Info (209016): Configuring device index 1

Info (209017): Device 1 contains JTAG ID code 0x020F40DD

Info (209007): Configuration succeeded -- 1 device(s) configured

Info (209011): Successfully performed operation(s)

Info (209061): Ended Programmer operation at Wed Feb 06 12:37:57 2019

Info: Quartus Prime Programmer was successful. 0 errors, 0 warnings

   Info: Peak virtual memory: 298 megabytes

   Info: Processing ended: Wed Feb 06 12:37:57 2019

   Info: Elapsed time: 00:00:04

   Info: Total CPU time (on all processors): 00:00:01

Info: *******************************************************************

Info: Running Quartus Prime Programmer

   Info: Version 18.1.0 Build 625 09/12/2018 SJ Lite Edition

   Info: Copyright (C) 2018 Intel Corporation. All rights reserved.

   Info: Your use of Intel Corporation's design tools, logic functions

   Info: and other software and tools, and its AMPP partner logic

   Info: functions, and any output files from any of the foregoing

   Info: (including device programming or simulation files), and any

   Info: associated documentation or information are expressly subject

   Info: to the terms and conditions of the Intel Program License

   Info: Subscription Agreement, the Intel Quartus Prime License Agreement,

   Info: the Intel FPGA IP License Agreement, or other applicable license

   Info: agreement, including, without limitation, that your use is for

   Info: the sole purpose of programming logic devices manufactured by

   Info: Intel and sold by Intel or its authorized distributors. Please

   Info: refer to the applicable agreement for further details.

   Info: Processing started: Wed Feb 06 12:37:57 2019

Info: Command: quartus_pgm --nios2 -c "USB-Blaster [USB-0]" --base=0x800000 --de

vice=1 --epcq --csr=0xc00000 --program mk.flash

Info (18932): Using cable "USB-Blaster [USB-0]", device 1, instance 0x00

Info (18932): Resetting and pausing target processor:

Info (18932): OK

Info (18932):              : Checksumming existing contents

Info (18932): 00000000     : Verifying existing contents

Info (18932): 00010000     : Verifying existing contents

Info (18932): 00020000     : Verifying existing contents

Info (18932): 00030000     : Verifying existing contents

Info (18932): 00040000     : Verifying existing contents

Info (18932): 00050000     : Verifying existing contents

Info (18932): 00060000     : Verifying existing contents

Info (18932): 00070000     : Verifying existing contents

Info (18932): 00200000     : Verifying existing contents

Info (18932): 00210000     : Verifying existing contents

Info (18932): 00220000     : Verifying existing contents

Info (18932): 00230000     : Verifying existing contents

Info (18932): 00300000     : Verifying existing contents

Info (18932): 003C0000     : Verifying existing contents

Info (18932): 00200000     : Reading existing contents

Info (18932): 00210000     : Reading existing contents

Info (18932): 00220000     : Reading existing contents

Info (18932): 00230000     : Reading existing contents

Info (18932): 00300000     : Reading existing contents

Info (18932): 003C0000     : Reading existing contents

Info (18932): Checksummed/read 850kB in 0.0s

 

Info (18932): 00200000 ( 0%): Erasing

Info (18932): 00210000 (16%): Erasing

Info (18932): 00220000 (33%): Erasing

Info (18932): 00230000 (50%): Erasing

Info (18932): 00300000 (66%): Erasing

Info (18932): 003C0000 (83%): Erasing

Info (18932): Erased 384kB in 0.0s

Info (18932): 00000000 ( 0%): Programming

Info (18932): 00010000 ( 0%): Programming

Info (18932): 00020000 ( 0%): Programming

Info (18932): 00030000 ( 0%): Programming

Info (18932): 00040000 ( 0%): Programming

Info (18932): 00050000 ( 0%): Programming

Info (18932): 00060000 ( 0%): Programming

Info (18932): 00070000 ( 0%): Programming

Info (18932): 00200000 ( 0%): Programming

Info (18932): 00210000 ( 7%): Programming

Info (18932): 00220000 (15%): Programming

Info (18932): 00230000 (22%): Programming

Info (18932): 00300000 (30%): Programming

Info (18932): 003C0000 (37%): Programming

Info (18932): Programmed 719KB +131KB in 0.0s

Info (18932): Did not attempt to verify device contents

 

Info (18932): Leaving target processor paused

Info: Quartus Prime Programmer was successful. 0 errors, 0 warnings

   Info: Peak virtual memory: 268 megabytes

   Info: Processing ended: Wed Feb 06 12:38:24 2019

   Info: Elapsed time: 00:00:27

   Info: Total CPU time (on all processors): 00:00:00

 

*** Fatal Error: Access Violation at 0X000007FEF32E15C3

Module: quartus_pgm.exe

Stack Trace:

   0x115c2: AJI_CLIENT::disconnect_all + 0xc2 (jtag_client)

   0x21c37: DllMain + 0x27 (jtag_client)

   0x22420: __DllMainCRTStartup + 0x8c (jtag_client)

   0x3778a: LdrShutdownProcess + 0x1da (ntdll)

   0x3c1df: RtlExitUserProcess + 0x8f (ntdll)

   0x229a6: _initterm_e + 0x21a (MSVCR120)

   0x22cf1: __tmainCRTStartup + 0x125 (quartus_pgm)

   0x159cc: BaseThreadInitThunk + 0xc (kernel32)

   0x5385c: RtlUserThreadStart + 0x1c (ntdll)

 

End-trace

 

Quartus version is 18.1, running on Windows 7 x64.

 

Yurii

0 Kudos
Highlighted
28 Views

Hi,

 

Can you try to program example given in the link also follow the steps from AN736

https://fpgawiki.intel.com/wiki/User_talk:Booting_NIOS_II_from_Altera_Serial_Flash_Controller_(EPCQ)...

https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/an/an736.pdf

 

Let me know if your are able to program it or if you need any further assistance.

 

Regards

Anand

0 Kudos
Highlighted
Beginner
28 Views

Hi, Anand

 

We have solved all problems with hardware right now (please read log in my second message). The only problem

is that quartus_pgm --nios2 crashes with access violation after successful programming. This problem is also

present in Quartus 17.1 with the same trace message.

 

As a solution, I've moved from using quartus_pgm with --nios2 flag to JIC-file based programming flow.

I've composed JIC-file with SOF data, Nios II program, DSP program and custom settings.

And it works perfectly (erasing only modified regions) and programming succeeds every time.

 

Yurii

0 Kudos