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++
12600 Discussions

ver171を使用しています。 標準関数の質問です。 # niosii_gen2(/e) +ram(64k) + led(pio) の構成。 # /mnt/host の機能を有効。 nios2_gen2 でfopenは使用できますか? 現在、Buildエラーが発生しています。 fopenが使用できる場合、どこから確認すればよいでしょうか? # なお、LEDは、デバッグ目的で点灯させます。 よろしくお願いします。

garry
Novice
912 Views

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include "system.h"

#include "io.h"

 

int main(void){

FILE *fp;

 

fp = fopen ("/mnt/host/test.txt", "r");

 

IOWR(LED_BASE,0,1); // LED

 

if (fp == NULL){

__asm("NOP"); // for break point

IOWR(LED_BASE,0,2); // LED

}

 

fclose(fp);

 

IOWR(LED_BASE,0,3); // LED

while(1){

__asm("NOP"); // trap

IOWR(LED_BASE,0,4); // LED

}

 

return 0;

}

 

0 Kudos
3 Replies
LeonWaksman
Super User
703 Views

#include <stdio.h>

 

Leon

 

0 Kudos
garry
Novice
703 Views

設定ミスでした。

bsp-editorの"enable_small_c_library"​にチェックを入れていました。

無事にBuildできたので、​本件closeとさせてください。

お騒がせしました。

Fawaz_Al-Jubori
Employee
703 Views

Hello,

This is due to small memory size in Qsys. If you increase the size, you will be able to build. this option "enable_small_c_library" is used to optimize the BSP size in case of low memory space available.

0 Kudos
Reply