CROSS_TARGET = fwbc.hex fwflash.hex
# all projects
-all: $(HOSTOBJECTS) $(ARMOBJECTS)
+all: $(HOST_TARGET) $(CROSS_TARGET)
# arm code
-arm: arm_clean $(ARMOBJECTS)
+arm: arm_clean $(CROSS_TARGET)
# fwbc
fwbc:
- $(ARMCC) $(ARMCFLAGS) -c fwbc.c -o fwbc
+ $(CROSS_CC) $(CROSS_CFLAGS) -c fwbc.c -o fwbc
fwbc.hex: fwbc
- $(ARMOBJCOPY) -O ihex fwbc fwbc.hex
+ $(CROSS_OBJCOPY) -O ihex fwbc fwbc.hex
# fwflash
fwflash:
- $(ARMCC) $(ARMCFLAGS) -c fwflash.c -o fwflash
+ $(CROSS_CC) $(CROSS_CFLAGS) -c fwflash.c -o fwflash
fwflash.hex: fwflash
- $(ARMOBJCOPY) -O ihex fwflash fwflash.hex
+ $(CROSS_OBJCOPY) -O ihex fwflash fwflash.hex
clean:
rm -f lpcload fwdump
arm_clean:
- rm -f $(ARMOBJECTS) fwbc fwflash
+ rm -f $(CROSS_TARGET) fwbc fwflash
#define BANK0 0x80000000
#define BANK2 0x82000000
-/* flash cmd addresses */
-#define B0F555 (*((volatile unsigned long *)(BANK0|0x555)))
-#define B0F2AA (*((volatile unsigned long *)(BANK0|0x2aa)))
-#define B2F555 (*((volatile unsigned long *)(BANK2|0x555)))
-#define B2F2AA (*((volatile unsigned long *)(BANK2|0x2aa)))
+/* flash cmd addresses - flash[0-18] <--> arm[1-19]*/
+#define B0F555 (*((volatile unsigned long *)(BANK0|0xaaa))) // 0x555
+#define B0F2AA (*((volatile unsigned long *)(BANK0|0x554))) // 0x2aa
+#define B2F555 (*((volatile unsigned long *)(BANK2|0xaaa))) // 0x555
+#define B2F2AA (*((volatile unsigned long *)(BANK2|0x554))) // 0x2aa
/* commands */
#define CMD_READ 'R'