From f023a1a8f772edb1b4b80864fbd9a8098ca13e2a Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Wed, 15 Apr 2009 11:58:29 -0400 Subject: [PATCH] turn on thumb. untested. make system still links in a lot of unnecessary stuff. --- config.mk | 2 +- tests/nvm-read.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/config.mk b/config.mk index 5ed41231c..5aa77d34e 100644 --- a/config.mk +++ b/config.mk @@ -26,7 +26,7 @@ # clean the slate ... PLATFORM_LDFLAGS = PLATFORM_RELFLAGS = -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -PLATFORM_CPPFLAGS = -march=armv4 -mtune=arm7tdmi -DCONFIG_ARM -D__ARM__ +PLATFORM_CPPFLAGS = -march=armv4t -mthumb -mtune=arm7tdmi-s -mthumb-interwork -DCONFIG_ARM -D__ARM__ TEXT_BASE = 0x00400000 ######################################################################### diff --git a/tests/nvm-read.c b/tests/nvm-read.c index cdd9f68b0..3bf208aff 100644 --- a/tests/nvm-read.c +++ b/tests/nvm-read.c @@ -13,6 +13,7 @@ #define GPIO_DATA0 0x80000008 #include "embedded_types.h" +#include "nvm.h" #define reg(x) (*(volatile uint32_t *)(x)) @@ -30,6 +31,8 @@ const uint8_t hex[16]={'0','1','2','3','4','5','6','7', __attribute__ ((section ("startup"))) void main(void) { uint8_t c; + nvmType_t type; + nvmErr_t err; *(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000100; @@ -50,6 +53,16 @@ void main(void) { reg(UART1_CON) = 0x00000003; /* enable receive and transmit */ reg(GPIO_FUNC_SEL0) = ( (0x01 << (14*2)) | (0x01 << (15*2)) ); /* set GPIO15-14 to UART (UART1 TX and RX)*/ + puts("Detecting internal nvm\n\r"); + + err = nvm_detect(gNvmInternalInterface_c, &type); + + puts("nvm_detect returned: "); + putc(err); + puts(" type is: "); + putc(type); + puts("\n\r"); + while(1) { }; }