From: hackbard Date: Tue, 14 Aug 2007 21:24:20 +0000 (+0200) Subject: correct ext mem config (thnx colibri) + care for endianness X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=67e8acdb6e63a64f34120318e44238869891deff;p=my-code%2Farm.git correct ext mem config (thnx colibri) + care for endianness --- diff --git a/betty/Makefile b/betty/Makefile index d9f49e7..8d10030 100644 --- a/betty/Makefile +++ b/betty/Makefile @@ -2,7 +2,7 @@ CC = gcc CFLAGS = -Wall ARMCC = /scratch/arm-elf/bin/arm-elf-gcc -ARMCFLAGS = -Wall -mcpu=arm7tdmi-s +ARMCFLAGS = -Wall -mcpu=arm7tdmi-s -nostartfiles -nostdlib ARMOBJCOPY = /scratch/arm-elf/bin/arm-elf-objcopy HOSTOBJECTS = lpcload fwdump diff --git a/betty/fwbc.c b/betty/fwbc.c index 1694055..e8fea0d 100644 --- a/betty/fwbc.c +++ b/betty/fwbc.c @@ -77,8 +77,8 @@ int main(void) { /* external memory init */ - //BCFG0=; - //BCFG2=; + BCFG0=0x1000FBEF; // no boot[1:0] influence? (thnx colibri) + // BCFG2 should be fine as is flash=(u16 *)BANK0; /* wait for fwdump to send transmit start character */ @@ -93,10 +93,10 @@ int main(void) { for(i=0;i<524288;i++) { while(!(UART0_LSR&(1<<5))) continue; - UART0_THR=((*flash&0xff00)>>8); + UART0_THR=(*flash&0xff); // care for endianness while(!(UART0_LSR&(1<<5))) continue; - UART0_THR=(*flash&0xff); + UART0_THR=((*flash&0xff00)>>8); flash++; }