Main Site Documentation

RLP on Fez Panda II using YAGARTO


Hi all,

I want to use an native interrupt counter on Fez Panda II as the managed interrupt handler can only achieve ~3.6kHz which is way too slow for my goal. Now I thought RLP would be the solution.
I have YAGARTO installed and I compiled a test C source file with the make command. So far so good. But now the elf file is 32Kb!!! When I look into it with a hex editor. 99% of the file is just 0x00. This is the code of the C file, it is just to see if I can get RLP to work.

int a = 0;
int b = 0;

int GetA(unsigned int *generalArray, void **args, unsigned int argsCount, unsigned int *argSize)
    return a;

int SetA(unsigned int *generalArray, void **args, unsigned int argsCount , unsigned int *argSize)
    int (value) = *(int*)args[0];
    a = value;

    return a;

This is my console output of compilation:

rm ./Output/.elf ./Output/.map
rm: cannot remove ./Output/*.elf': No such file or directory rm: cannot remove./Output/*.map’: No such file or directory
make: [clean] Error 1 (ignored)
arm-none-eabi-gcc -c -Os -g0 -mlittle-endian -mcpu=arm7tdmi -Wall -I. -I./inclu
de -mapcs-frame -fno-builtin RLPExample.c -o RLPExample1.o
arm-none-eabi-gcc -nostartfiles -Wl,–Map -Wl,./Output/ -lc -lgcc
-T -o ./Output/RLPExample.elf RLPExample1.o
rm *.o[/quote]

As you can see I have used -Os to optimize for size.
Any hints on how to use RLP on Fez Panda II? As Fez says (with a very small managed application of loading the elf and blinking a led) that its out of memory when loading the resource elf file.



Are you using the makefile and linker script from the wiki?


@ godefroi - Yes absolutely. I downloaded the files using this link: [quote]The following contains examples and the RLP extensions header file (RLP.h):[/quote]

First see EDIT at bottom.
And then see EDIT2

This is what the Makefile looks like:



CC      =arm-none-eabi-gcc
LD      =arm-none-eabi-gcc

CCFLAGS=  -Os -g0 -mlittle-endian -mcpu=arm7tdmi  -Wall -I. -I$(INCL)
CCFLAGS+= -mapcs-frame -fno-builtin 

LDFLAGS =-nostartfiles -Wl,--Map -Wl,./Output/$(OUTFILE).map
LDFLAGS+=-lc -lgcc

OBJS+= RLPExample1.o 

rebuild: clean all del_o

all: $(OBJS)
	$(LD) $(LDFLAGS) -o ./Output/$(OUTFILE).elf $(OBJS)

RLPExample1.o: RLPExample.c
	$(CC) -c $(CCFLAGS) RLPExample.c -o RLPExample1.o

	-rm ./Output/*.elf ./Output/*.map

	-rm *.o

	-rm ./Output/*.map

And this is the linker script

/* Copyright(c) GHI Electronics, LLC */

OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")

  SDRAM (wx) : ORIGIN = 0xA0F00000, LENGTH = 0x000FFFFC

        . = ALIGN(4);
        .text : 

        . = ALIGN(4);
        .rodata : 
          *(.rodata )
        . = ALIGN(4);
        .data : 

         . = ALIGN(4);
        .bss : 
            __bss_start__ = .;
            __bss_end__ = .;

end = .;  /* define a global symbol marking the end of application RAM */

I have read there should be examples in the file for all GHI platforms, but I only find the examples for EMX. Am I right, or should I download the files somewhere else?

When I compile without make, directly using gcc with this commandline: [quote]C:\yagarto-4.5.1\bin\arm-none-eabi-gcc.exe -g3 -s -Os -mlittle-end
ian -mcpu=arm7tdmi -Wall -I. -c C:\RLPExample\RLPExample.c -o C:/RLPExample/Out
put/RLPExample.elf[/quote] it produces a 8KB file. Haven’t tested whether it works on Panda II though.

Edit 2:
I have tested the elf file with ~8k of size. Now the resource can be loaded, no OutOfMemory Exception anymore. But now a exception is thrown by



Looks like you’re using the data for EMX instead of USBizi

// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!   The user must set these settings according to the used platform    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// ChipworkX
//#define RLP_ADDRESS		0xA0000000
//#define RLP_SIZE		0x001FB3FC

// EMX
 #define RLP_ADDRESS		0xA0F00000
 #define RLP_SIZE		0x000FFFFC

// USBizi
//#define RLP_ADDRESS		0x40000440
//#define RLP_SIZE		0x000027FC