(原創) 如何解決Nios II的『Leaving target processor paused』的錯誤訊息 (II)? (SOC) (Nios II) (SOPC Builder) (DE2-70)

Abstract
『Leaving target processor paused』是Nios II初學者常遇到的錯誤訊息,我今天又遇到了,我將我debug的過程跟大家分享。

Introduction
使用環境:Quartus II 8.0 + DE2-70 (Cyclone II EP2C70F896C6N) + TRDB-LTM

(原創) 如何解決Nios II的『Leaving target processor paused』的錯誤訊息? (IC Design) (Quartus II) (SOPC Builder) (Nios II)中,我曾討論過解決『Leaving target processor paused』常用的方法,但這個錯誤訊息引起的原因很多,只能case by case解決,今天剛好用遇到這個錯誤訊息,順便將我debug的方法跟大家分享。

錯誤訊息

pause00

關鍵在這一行

Verify failed between address 0x4000000 and 0x400F547


已經告訴我們在0x4000000 and 0x400F547這個範圍有錯,趕快將SOPC Builder打開:

pause01

原來是SDRAM有問題!!最少已經將目標鎖定在SDRAM!!

若你是直接使用Nios II的reference design做Nios II開發,如((原創) DE2_NIOS_Lite 1.1 (SOC) (Nios II) (SOPC Builder) (μC/OS-II) (DE2)(原創) 哪裡有DE2-70的Nios II reference design可以參考? (SOC) (DE2-70) (Nios II) (SOPC Builder)),就不會遇到這種問題,因為這些範例已經將你的SDRAM搞定了,但若你是將原本DE2/DE2-70的範例自己加上Nios II,準備做軟硬體設計,就可能像我一樣,必須將原本Sdram_Control_4Port控制的SDRAM,改成由Avalon Bus所控制的SDRAM,這時SDRAM的pin腳必須自己重新接過。

1 DE2_70_SOPC nios0 (
2   // 1) global signals:
3   .clk_50(iCLK_50),
4   .pll_c0_system(CPU_CLK),
5   .pll_c1_memory(SRAM_CLK),
6   .pll_c2_audio(oAUD_XCK),//CLK_18M324),
7   .reset_n(CPU_RESET_N),
8   // the_sdram (u1)
9   .zs_addr_from_the_sdram_u1(oDRAM0_A),
10   .zs_ba_from_the_sdram_u1(oDRAM0_BA),
11   .zs_cas_n_from_the_sdram_u1(oDRAM0_CAS_N),
12   .zs_cke_from_the_sdram_u1(oDRAM0_CKE),
13   .zs_cs_n_from_the_sdram_u1(oDRAM0_CS_N),
14   .zs_dq_to_and_from_the_sdram_u1(DRAM_DQ[15:0]),
15   .zs_dqm_from_the_sdram_u1({oDRAM0_UDQM1,oDRAM0_LDQM0}),
16   .zs_ras_n_from_the_sdram_u1(oDRAM0_RAS_N),
17   .zs_we_n_from_the_sdram_u1(oDRAM0_WE_N),
18   // the_sdram (u2)
19   .zs_addr_from_the_sdram_u2(oDRAM1_A),
20   .zs_ba_from_the_sdram_u2(oDRAM1_BA),
21   .zs_cas_n_from_the_sdram_u2(oDRAM1_CAS_N),
22   .zs_cke_from_the_sdram_u2(oDRAM1_CKE),
23   .zs_cs_n_from_the_sdram_u2(oDRAM1_CS_N),
24   .zs_dq_to_and_from_the_sdram_u2(DRAM_DQ[31:16]),
25   .zs_dqm_from_the_sdram_u2({oDRAM1_UDQM1,oDRAM1_LDQM0}),
26   .zs_ras_n_from_the_sdram_u2(oDRAM1_RAS_N),
27   .zs_we_n_from_the_sdram_u2(oDRAM1_WE_N),
28   // the_tristate_bridge_avalon_slave (flash)
29   .address_to_the_cfi_flash({oFLASH_A[21:0],FLASH_16BIT_IP_A0}),
30   .data_to_and_from_the_cfi_flash({FLASH_DQ15_AM1,FLASH_DQ}),
31   .read_n_to_the_cfi_flash(oFLASH_OE_N),
32   .select_n_to_the_cfi_flash(oFLASH_CE_N),
33   .write_n_to_the_cfi_flash(oFLASH_WE_N),
34   // the_tristate_bridge_1_avalon_slave (ssram)
35   .address_to_the_ssram({oSRAM_A[17:0],SRAM_DUMMY_ADDR}),
36   .adsc_n_to_the_ssram(oSRAM_ADSC_N),
37   .bw_n_to_the_ssram(oSRAM_BE_N),
38   .bwe_n_to_the_ssram(oSRAM_WE_N),
39   .chipenable1_n_to_the_ssram(oSRAM_CE1_N),
40   .data_to_and_from_the_ssram((SRAM_DQ)),
41   .outputenable_n_to_the_ssram(oSRAM_OE_N),
42 );
43 


這樣乍看之下,一切都很正常,所有SDRAM的pin腳全部被SOPC接管,假如你也這樣認為,就會跟我一樣遇到 『Leaving target processor paused』的錯誤訊息。

Solution
原因是因為還有兩個port忘了指定:

// SDRAM
assign oDRAM0_CLK = SRAM_CLK;                  // SDRAM0 Clock
assign oDRAM1_CLK = SRAM_CLK;                  // SDRAM1 Clock


將這兩個clock補上後,結果就會正常了。

完整程式碼下載
DE2_70_D5M_LTM_NIOS_ltm_master.7z

Conclusion
『Leaving target processor paused』是初學者常遇到的錯誤訊息, 透過failed address,最少可以將debug目標鎖定在某個ip上,有可能是C的問題,有可能是Verilog的問題。像我這次忘了去指定SDRAM的clock,也是很容易忽略的錯誤,若你也遇到SDRAM的錯誤,別忘了查查看是不是跟我一樣,忘了指定SDRAM clock。

See Also
(原創) 如何解決Nios II的『Leaving target processor paused』的錯誤訊息? (IC Design) (Quartus II) (SOPC Builder) (Nios II)
(原創) DE2_NIOS_Lite 1.1 (SOC) (Nios II) (SOPC Builder) (μC/OS-II) (DE2)
(原創) 哪裡有DE2-70的Nios II reference design可以參考? (SOC) (DE2-70) (Nios II) (SOPC Builder)
(原創) 如何解決『Timestamp value does not match: image on board is older than expected』錯誤訊息? (SOC) (Nios II)

posted on 2008-10-14 20:02  真 OO无双  阅读(9458)  评论(60编辑  收藏  举报

导航