Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12589 Discussions

プログラムサイズが大きい為、NiosII SBTでビルドエラーが発生しました。そこで、ビルド時、またはビルド前に、on chip memoryに対し、どのくらいプログラムサイズがオーバーしているのか確認する方法を教えて下さい。 サンプルデザインでも、再Generateしないとビルドが成功しないのでしょうか。

Songokuu
Beginner
2,242 Views

■概要(質問の経緯)

 下記環境を使用し、下記資料1のP.17~P.20の手順で作業したところ、ビルド時エラーが発生しましたが、プログラムサイズを小さくすることで回避しました。

 ・デザイン:Nios II ADC /LCD Display Controller Design Example 

https://fpgacloud.intel.com/devstore/platform/17.1.0/Standard/nios-ii-adc-lcd-display-controller-design-example/

 ・ツール

QuartusPSE v17.1

 ・資料1

https://fpgawiki.intel.com/uploads/b/b4/Evalkit_adc_lcd_controller_userguide.pdf

 

■エラー内容

 資料1の手順10のBuild Allで下記エラーメッセージ1が発生します

 

//エラーメッセージ1//

Task欄

16:32:21 **** Incremental Build of configuration Nios II for project niosMAx10EvalBoard ****

make all

Info: Building ../niosMAx10EvalBoard_bsp/

C:/intelFPGA/17.1/nios2eds/bin/gnu/H-x86_64-mingw32/bin/make --no-print-directory -C ../niosMAx10EvalBoard_bsp/

[BSP build complete]

Info: Linking niosMAx10EvalBoard.elf

nios2-elf-g++ -T'../niosMAx10EvalBoard_bsp//linker.x' -msys-crt0='../niosMAx10EvalBoard_bsp//obj/HAL/src/crt0.o' -msys-lib=hal_bsp -L../niosMAx10EvalBoard_bsp/  -Wl,-Map=niosMAx10EvalBoard.map  -O0 -g -Wall  -mno-hw-div -mno-hw-mul -mno-hw-mulx -mgpopt=global -o niosMAx10EvalBoard.elf obj/default/src/devices/adcMAX10.o obj/default/src/devices/lcdGeneric.o obj/default/src/devices/mcp23017.o obj/default/src/drivers/i2c.o obj/default/src/main.o -lm -msys-lib=m

c:/intelfpga/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x8d50 of niosMAx10EvalBoard.elf section `.rwdata' is not within region `ONCHIP_RAM_16K'

c:/intelfpga/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0xa4ec of niosMAx10EvalBoard.elf section `.bss' is not within region `ONCHIP_RAM_16K'

c:/intelfpga/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x8d50 of niosMAx10EvalBoard.elf section `.rwdata' is not within region `ONCHIP_RAM_16K'

c:/intelfpga/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0xa4ec of niosMAx10EvalBoard.elf section `.bss' is not within region `ONCHIP_RAM_16K'

collect2.exe: error: ld returned 1 exit status

make: *** [niosMAx10EvalBoard.elf] Error 1

 

16:32:23 Build Finished (took 1s.854ms)

 

■原因

 下記URLよりプログラムサイズが、on chip memory のサイズをオーバーしている可能性があると分かりました。

 https://service.macnica.co.jp/support/faq/120145

 

■回避方法

 そこで、下記方法によりプログラムサイズを小さくしたところ正常にビルドできました。

 [ハード部分の手順]

・PlatformDesigner起動

・ONCHIP_RAM_16KブロックのInitialize memory contentにチェックを入れる

・System > Assign Base Address

・再Generate

・Quartusで再コンパイル

 

 [ソフト部分の手順]

・資料1のHow to compile the softwareの中で、下記のtempltesを使用してビルドする。

  Hello World Smallのtempltes

0 Kudos
1 Solution
GuaBin_N_Intel
Employee
972 Views

By right, when it's fail to compile, you should be able to see the error message in NIOS console that shows how much of memory size needed. If there is no such details, you could enlarge the onchip memory size or use other larger off-board memory to build the project and evaluate the resources.

View solution in original post

3 Replies
GuaBin_N_Intel
Employee
972 Views

These are two command lines to check the program size from .elf https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/nios2/edh_ed51004.pdf

1) nios2-stackreport <>.elf

2) nios2-elf-size <>.elf

0 Kudos
Songokuu
Beginner
972 Views

 

ご返信ありがとうございます。

ビルドエラーが発生した場合、elfファイルは生成されません。

その場合、どのくらいのプログラムサイズになるのか確認する方法はあるでしょうか。

0 Kudos
GuaBin_N_Intel
Employee
973 Views

By right, when it's fail to compile, you should be able to see the error message in NIOS console that shows how much of memory size needed. If there is no such details, you could enlarge the onchip memory size or use other larger off-board memory to build the project and evaluate the resources.

Reply