Altera_Forum
Honored Contributor
7 years agoBare metal application on Cyclone V too slow - DE10-Nano
Hello all,
I'm trying to develop some bare metal application in C using DS-5 with arm-altera-eabi-gcc with the DE10-Nano (ARM Cortex A9) but after some time developing the code I realized that my program is running too slow when compared to run the same code on linux/LXDE for this board. The program is simple, I have an image of 640x480 in the SDRAM and I created a function to get the pixel level (1 Byte) at time what means 307.200 bytes to read and it takes almost 140 ms to execute and print the "." as in the code below. Is there some tricky that I need to do to speedup the code with caches / anything related or this time it's normal because I'm using just one core of ARM-A9? :confused::confused:# include <assert.h>#include <stdbool.h># include <stdio.h># include <stdlib.h>
# include "alt_clock_manager.h"# include "alt_generalpurpose_io.h"# include "alt_globaltmr.h"# include "hwlib.h"# include "socal/alt_gpio.h"# include "socal/hps.h"# include "socal/socal.h"# include "hps_0.h"# include "system_crios.h"# include "mser.h"
int main(void) {
setup_system();
mserInit();
// drawTestImage();
uint32_t test = 0;
uint8_t test2;
while (1) {
//mserFindRegions();
//delay_us(ALT_MICROSECS_IN_A_SEC/10);
for(test = 0; test < 307200; test++) test2 = getPixelLevel(test);
printf("\n\r.");
}
return 0;
}