Main Site Documentation

G120HDR, Keil and RLP


#1

I’m trying to get RLP wokring with G120 and Keil. So I created new project in Keil and selected LPC1788 as a device. Then I set up R/O and R/W bases as:

R/O: 0xA0F00000
R/W: 0xA0F7FFFC

Next I add rlp.c file with next contents:

#include "rlp.h"

//to silence linker we need next 2 methods:
int main() {}
void SystemInit(){}

int test(unsigned int *generalArray, void **args, unsigned int argsCount, unsigned int *argSize)
{
	return 55;
}

Code compiles and .axf file is created. However this file does not work and causes an exception when calling RLP.LoadELF(elf_file);

The thread '<No Name>' (0x2) has exited with code 0 (0x0).
    #### Exception System.Exception - 0xffffffff (1) ####
    #### Message: 
    #### GHI.Premium.Native.RLP::LoadELF [IP: 0000] ####
    #### GHI.Premium.Native.RLP::LoadELF [IP: 000a] ####
    #### RLP_example.Program::Main [IP: 000d] ####
A first chance exception of type 'System.Exception' occurred in GHI.Premium.Native.dll
An unhandled exception of type 'System.Exception' occurred in GHI.Premium.Native.dll

In Keil I tried toggling couple of settings (eg. ASM tab -> Thumb mode) but nothing worked. RLP simply won’t load anything I compile with Keil.
Can anybody more experienced help me get it working?

Thanks, Greg

EDIT: I’m running latest firmware. yagarto .elf files work.

 Loader (TinyBooter) Version: 4.2.10.0
 Firmware (TinyCLR) Version: 4.2.10.1

#2

I made a little progress. Problem is “startup_LPC177x_8x.s” file which adds additional program header to elf file:

** Program header #0 (PT_LOAD) [PF_X + PF_R]
    Size : 4 bytes
    Virtual address: 0x000002fc (Alignment 4)

With modifying the startup file I managed to get RLP load but now it throws exception when calling RLP.InitializeBSSRegion(elf_file);


#3

You can skip this one, just do not make any assumptions about global variables being cleared to zero.