- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The followings are my c code, and "perf_print_formatted_report" has c code error... I don't no why...
#include "sys/alt_stdio.h"
#include "stdio.h"
#include "system.h"
#include "altera_avalon_pio_regs.h"
#include "altera_avalon_performance_counter.h"
#define SECTION_1 1
int main()
{
int count=0;
int delay;
alt_putstr("Hello from Nios II!\n");
PERF_RESET(PERFORMANCE_COUNTER_BASE);
PERF_START_MEASURING (PERFORMANCE_COUNTER_BASE);
PERF_BEGIN (PERFORMANCE_COUNTER_BASE,1);
PERF_END (PERFORMANCE_COUNTER_BASE,1);
PERF_STOP_MEASURING(PERFORMANCE_COUNTER_BASE);
perf_print_formatted_report (
(void *)PERFORMANCE_COUNTER_BASE, // Peripheral's HW base address
ALT_CPU_FREQ, // defined in "system.h"
1,
"1st_test"
);
while(1){
IOWR_ALTERA_AVALON_PIO_DATA(LED_BASE,count);
delay = 0;
while(delay<20000000){
delay++;
}
count++;
}
/* Event loop never exits. */
printf("Goodbye from Nios II - returning from main()!\n");
return 0;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
the code looks fine only you don't have to use these two headers:
#include "sys/alt_stdio.h"
#include "stdio.h"
The error is because the tools failed to make the files, I encourage you to follow the following steps to fix this error:
https://www.intel.com/content/altera-www/global/en_us/index/support/support-resources/knowledge-base/embedded/2019/error---makefile-is-not-up-to-date-.html
Regards,

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page