-Steff test
-Svenne test
+Steff test\r
+Svenne test\r
-system_LPC17xx.o: CMSIS/system_LPC17xx.c CMSIS/LPC17xx.h CMSIS/core_cm3.h \
- CMSIS/system_LPC17xx.h
-
-CMSIS/LPC17xx.h:
-
-CMSIS/core_cm3.h:
-
-CMSIS/system_LPC17xx.h:
+system_LPC17xx.o: CMSIS/system_LPC17xx.c CMSIS/LPC17xx.h CMSIS/core_cm3.h \\r
+ CMSIS/system_LPC17xx.h\r
+\r
+CMSIS/LPC17xx.h:\r
+\r
+CMSIS/core_cm3.h:\r
+\r
+CMSIS/system_LPC17xx.h:\r
-CC = gcc
-LD = gcc
-LDFLAGS = -Wall -O4 -std=c99
-EXES = lpcrc
-
-all: $(EXES)
-
-% : %.c
- $(LD) $(LDFLAGS) -o $@ $<
-
-clean:
- rm -f $(EXES)
+CC = gcc\r
+LD = gcc\r
+LDFLAGS = -Wall -O4 -std=c99\r
+EXES = lpcrc\r
+\r
+all: $(EXES)\r
+\r
+% : %.c\r
+ $(LD) $(LDFLAGS) -o $@ $<\r
+\r
+clean: \r
+ rm -f $(EXES)\r
-/*
- * Software License Agreement (BSD License)
- *
- * Copyright (c) 2010, Roel Verdult
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <stdio.h>
-#include <stdint.h>
-
-#define BLOCK_COUNT 7
-#define BLOCK_LENGTH 4
-#define BLOCK_TOTAL (BLOCK_COUNT*BLOCK_LENGTH)
-
-typedef unsigned char byte_t;
-
-int main(int argc, char *argv[])
-{
- FILE* pf;
- byte_t buf[BLOCK_TOTAL];
- uint32_t crc = 0;
- uint32_t block;
-
- // Check for required arguments
- if (argc < 2)
- {
- printf("syntax: lpcrc <firmware.bin>\n");
- return 1;
- }
-
- // Try to open the supplied firmware
- if ((pf = fopen(argv[1],"rb+")) == NULL)
- {
- printf("error: could not open file [%s] with write access\n",argv[1]);
- return 1;
- }
-
- // Read out the data blocks used for crc calculation
- if (fread(buf,1,BLOCK_TOTAL,pf) != BLOCK_TOTAL)
- {
- printf("error: could not read required bytes\n");
- fclose(pf);
- return 1;
- }
-
- // Compute the crc value
- for (block=0; block<BLOCK_COUNT; block++)
- {
- crc += *((uint32_t*)(buf+(block*BLOCK_LENGTH)));
- }
- crc = (~crc) + 1;
-
- // Reposition the file stream indicator to switch between read and write
- if (fseek(pf,0,SEEK_CUR) != 0)
- {
- printf("error: could not switch from read to write mode\n");
- fclose(pf);
- return 1;
- }
-
- // Write the crc back to the file
- if (fwrite((byte_t*)&crc,1,BLOCK_LENGTH,pf) != BLOCK_LENGTH)
- {
- printf("error: could not write crc back to file\n");
- fclose(pf);
- return 1;
- }
-
- printf("succesfully updated crc to: %08x\n",crc);
- fclose(pf);
-
- return 0;
-}
-
+/*\r
+ * Software License Agreement (BSD License)\r
+ *\r
+ * Copyright (c) 2010, Roel Verdult\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the copyright holders nor the\r
+ * names of its contributors may be used to endorse or promote products\r
+ * derived from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY\r
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ */\r
+\r
+#include <stdio.h>\r
+#include <stdint.h>\r
+\r
+#define BLOCK_COUNT 7\r
+#define BLOCK_LENGTH 4\r
+#define BLOCK_TOTAL (BLOCK_COUNT*BLOCK_LENGTH)\r
+\r
+typedef unsigned char byte_t;\r
+\r
+int main(int argc, char *argv[])\r
+{\r
+ FILE* pf;\r
+ byte_t buf[BLOCK_TOTAL];\r
+ uint32_t crc = 0;\r
+ uint32_t block;\r
+ \r
+ // Check for required arguments\r
+ if (argc < 2)\r
+ {\r
+ printf("syntax: lpcrc <firmware.bin>\n");\r
+ return 1;\r
+ }\r
+ \r
+ // Try to open the supplied firmware\r
+ if ((pf = fopen(argv[1],"rb+")) == NULL)\r
+ {\r
+ printf("error: could not open file [%s] with write access\n",argv[1]);\r
+ return 1;\r
+ }\r
+\r
+ // Read out the data blocks used for crc calculation\r
+ if (fread(buf,1,BLOCK_TOTAL,pf) != BLOCK_TOTAL)\r
+ {\r
+ printf("error: could not read required bytes\n");\r
+ fclose(pf);\r
+ return 1;\r
+ }\r
+\r
+ // Compute the crc value\r
+ for (block=0; block<BLOCK_COUNT; block++)\r
+ {\r
+ crc += *((uint32_t*)(buf+(block*BLOCK_LENGTH)));\r
+ }\r
+ crc = (~crc) + 1;\r
+ \r
+ // Reposition the file stream indicator to switch between read and write\r
+ if (fseek(pf,0,SEEK_CUR) != 0)\r
+ {\r
+ printf("error: could not switch from read to write mode\n");\r
+ fclose(pf);\r
+ return 1;\r
+ }\r
+ \r
+ // Write the crc back to the file\r
+ if (fwrite((byte_t*)&crc,1,BLOCK_LENGTH,pf) != BLOCK_LENGTH)\r
+ {\r
+ printf("error: could not write crc back to file\n");\r
+ fclose(pf);\r
+ return 1;\r
+ }\r
+\r
+ printf("succesfully updated crc to: %08x\n",crc);\r
+ fclose(pf);\r
+ \r
+ return 0;\r
+}\r
+\r
-main.o: main.c CMSIS/LPC17xx.h CMSIS/core_cm3.h CMSIS/system_LPC17xx.h \
- io-pin.h
-
-CMSIS/LPC17xx.h:
-
-CMSIS/core_cm3.h:
-
-CMSIS/system_LPC17xx.h:
-
-io-pin.h:
+main.o: main.c CMSIS/LPC17xx.h CMSIS/core_cm3.h CMSIS/system_LPC17xx.h \\r
+ io-pin.h\r
+\r
+CMSIS/LPC17xx.h:\r
+\r
+CMSIS/core_cm3.h:\r
+\r
+CMSIS/system_LPC17xx.h:\r
+\r
+io-pin.h:\r
-
-main.elf: file format elf32-littlearm
-main.elf
-architecture: arm, flags 0x00000112:
-EXEC_P, HAS_SYMS, D_PAGED
-start address 0x00000041
-
-Program Header:
- LOAD off 0x00008000 vaddr 0x00000000 paddr 0x00000000 align 2**15
- filesz 0x00000234 memsz 0x00000234 flags r-x
- LOAD off 0x00010000 vaddr 0x10000000 paddr 0x00000234 align 2**15
- filesz 0x00000004 memsz 0x00000008 flags rw-
-private flags = 5000002: [Version5 EABI] [has entry point]
-
-Sections:
-Idx Name Size VMA LMA File off Algn
- 0 .text 00000234 00000000 00000000 00008000 2**2
- CONTENTS, ALLOC, LOAD, READONLY, CODE
- 1 .data 00000004 10000000 00000234 00010000 2**2
- CONTENTS, ALLOC, LOAD, DATA
- 2 .bss 00000004 10000004 00000238 00010004 2**2
- ALLOC
- 3 .comment 00000011 00000000 00000000 00010004 2**0
- CONTENTS, READONLY
- 4 .ARM.attributes 00000031 00000000 00000000 00010015 2**0
- CONTENTS, READONLY
-SYMBOL TABLE:
-00000000 l d .text 00000000 .text
-10000000 l d .data 00000000 .data
-10000004 l d .bss 00000000 .bss
-00000000 l d .comment 00000000 .comment
-00000000 l d .ARM.attributes 00000000 .ARM.attributes
-00000000 l df *ABS* 00000000 startup.c
-00000000 l df *ABS* 00000000 system_LPC17xx.c
-00000000 l df *ABS* 00000000 main.c
-00000168 l F .text 00000014 delay.clone.0
-00000084 w F .text 00000002 DebugMon_Handler
-00000084 w F .text 00000002 HardFault_Handler
-0000017c g F .text 00000010 SysTick_Handler
-00000084 w F .text 00000002 PendSV_Handler
-00000084 w F .text 00000002 NMI_Handler
-00000234 g .text 00000000 _etext
-10000004 g .bss 00000000 _sbss
-10000004 g O .bss 00000004 current_time
-10000000 g O .data 00000004 SystemCoreClock
-00000084 w F .text 00000002 UsageFault_Handler
-10000000 g .data 00000000 _sdata
-10000004 g .bss 00000000 _ebss
-00000040 w F .text 00000044 Reset_Handler
-00000084 g F .text 00000002 Default_Handler
-00000000 g O .text 00000040 interrupt_vectors
-00000084 w F .text 00000002 MemManage_Handler
-0000018c g F .text 000000a8 main
-00000084 w F .text 00000002 SVC_Handler
-00000088 g F .text 000000e0 SystemInit
-10008000 g *ABS* 00000000 _sstack
-10000004 g .data 00000000 _edata
-00000084 w F .text 00000002 BusFault_Handler
-00000000 g .text 00000000 _stext
-
-
+\r
+main.elf: file format elf32-littlearm\r
+main.elf\r
+architecture: arm, flags 0x00000112:\r
+EXEC_P, HAS_SYMS, D_PAGED\r
+start address 0x00000041\r
+\r
+Program Header:\r
+ LOAD off 0x00008000 vaddr 0x00000000 paddr 0x00000000 align 2**15\r
+ filesz 0x00000234 memsz 0x00000234 flags r-x\r
+ LOAD off 0x00010000 vaddr 0x10000000 paddr 0x00000234 align 2**15\r
+ filesz 0x00000004 memsz 0x00000008 flags rw-\r
+private flags = 5000002: [Version5 EABI] [has entry point]\r
+\r
+Sections:\r
+Idx Name Size VMA LMA File off Algn\r
+ 0 .text 00000234 00000000 00000000 00008000 2**2\r
+ CONTENTS, ALLOC, LOAD, READONLY, CODE\r
+ 1 .data 00000004 10000000 00000234 00010000 2**2\r
+ CONTENTS, ALLOC, LOAD, DATA\r
+ 2 .bss 00000004 10000004 00000238 00010004 2**2\r
+ ALLOC\r
+ 3 .comment 00000011 00000000 00000000 00010004 2**0\r
+ CONTENTS, READONLY\r
+ 4 .ARM.attributes 00000031 00000000 00000000 00010015 2**0\r
+ CONTENTS, READONLY\r
+SYMBOL TABLE:\r
+00000000 l d .text 00000000 .text\r
+10000000 l d .data 00000000 .data\r
+10000004 l d .bss 00000000 .bss\r
+00000000 l d .comment 00000000 .comment\r
+00000000 l d .ARM.attributes 00000000 .ARM.attributes\r
+00000000 l df *ABS* 00000000 startup.c\r
+00000000 l df *ABS* 00000000 system_LPC17xx.c\r
+00000000 l df *ABS* 00000000 main.c\r
+00000168 l F .text 00000014 delay.clone.0\r
+00000084 w F .text 00000002 DebugMon_Handler\r
+00000084 w F .text 00000002 HardFault_Handler\r
+0000017c g F .text 00000010 SysTick_Handler\r
+00000084 w F .text 00000002 PendSV_Handler\r
+00000084 w F .text 00000002 NMI_Handler\r
+00000234 g .text 00000000 _etext\r
+10000004 g .bss 00000000 _sbss\r
+10000004 g O .bss 00000004 current_time\r
+10000000 g O .data 00000004 SystemCoreClock\r
+00000084 w F .text 00000002 UsageFault_Handler\r
+10000000 g .data 00000000 _sdata\r
+10000004 g .bss 00000000 _ebss\r
+00000040 w F .text 00000044 Reset_Handler\r
+00000084 g F .text 00000002 Default_Handler\r
+00000000 g O .text 00000040 interrupt_vectors\r
+00000084 w F .text 00000002 MemManage_Handler\r
+0000018c g F .text 000000a8 main\r
+00000084 w F .text 00000002 SVC_Handler\r
+00000088 g F .text 000000e0 SystemInit\r
+10008000 g *ABS* 00000000 _sstack\r
+10000004 g .data 00000000 _edata\r
+00000084 w F .text 00000002 BusFault_Handler\r
+00000000 g .text 00000000 _stext\r
+\r
+\r
-
-Allocating common symbols
-Common symbol size file
-
-current_time 0x4 main.o
-
-Discarded input sections
-
- .text 0x0000000000000000 0x0 startup.o
- .data 0x0000000000000000 0x0 startup.o
- .bss 0x0000000000000000 0x0 startup.o
- .text 0x0000000000000000 0x0 CMSIS/system_LPC17xx.o
- .data 0x0000000000000000 0x0 CMSIS/system_LPC17xx.o
- .bss 0x0000000000000000 0x0 CMSIS/system_LPC17xx.o
- .text.SystemCoreClockUpdate
- 0x0000000000000000 0xfc CMSIS/system_LPC17xx.o
- .text 0x0000000000000000 0x0 main.o
- .data 0x0000000000000000 0x0 main.o
- .bss 0x0000000000000000 0x0 main.o
- .text.delay 0x0000000000000000 0x14 main.o
-
-Memory Configuration
-
-Name Origin Length Attributes
-flash 0x0000000000000000 0x0000000000080000 xr
-ram 0x0000000010000000 0x0000000000008000 xrw
-*default* 0x0000000000000000 0xffffffffffffffff
-
-Linker script and memory map
-
- 0x0000000000000000 . = 0x0
-
-.text 0x0000000000000000 0x234
- 0x0000000000000000 _stext = .
- *(.cs3.interrupt_vector)
- .cs3.interrupt_vector
- 0x0000000000000000 0x40 startup.o
- 0x0000000000000000 interrupt_vectors
- *(.text*)
- .text.Reset_Handler
- 0x0000000000000040 0x44 startup.o
- 0x0000000000000040 Reset_Handler
- .text.Default_Handler
- 0x0000000000000084 0x2 startup.o
- 0x0000000000000084 DebugMon_Handler
- 0x0000000000000084 HardFault_Handler
- 0x0000000000000084 PendSV_Handler
- 0x0000000000000084 NMI_Handler
- 0x0000000000000084 UsageFault_Handler
- 0x0000000000000084 Default_Handler
- 0x0000000000000084 MemManage_Handler
- 0x0000000000000084 SVC_Handler
- 0x0000000000000084 BusFault_Handler
- *fill* 0x0000000000000086 0x2 00
- .text.SystemInit
- 0x0000000000000088 0xe0 CMSIS/system_LPC17xx.o
- 0x0000000000000088 SystemInit
- .text.delay.clone.0
- 0x0000000000000168 0x14 main.o
- .text.SysTick_Handler
- 0x000000000000017c 0x10 main.o
- 0x000000000000017c SysTick_Handler
- .text.main 0x000000000000018c 0xa8 main.o
- 0x000000000000018c main
- *(.rodata*)
- 0x0000000000000234 . = ALIGN (0x4)
- 0x0000000000000234 _etext = .
-
-.glue_7 0x0000000000000234 0x0
- .glue_7 0x0000000000000000 0x0 linker stubs
-
-.glue_7t 0x0000000000000234 0x0
- .glue_7t 0x0000000000000000 0x0 linker stubs
-
-.vfp11_veneer 0x0000000000000234 0x0
- .vfp11_veneer 0x0000000000000000 0x0 linker stubs
-
-.v4_bx 0x0000000000000234 0x0
- .v4_bx 0x0000000000000000 0x0 linker stubs
-
-.data 0x0000000010000000 0x4 load address 0x0000000000000234
- 0x0000000010000000 _sdata = .
- *(.data*)
- .data.SystemCoreClock
- 0x0000000010000000 0x4 CMSIS/system_LPC17xx.o
- 0x0000000010000000 SystemCoreClock
- 0x0000000010000004 _edata = .
-
-.bss 0x0000000010000004 0x4 load address 0x0000000000000238
- 0x0000000010000004 _sbss = .
- *(.bss*)
- 0x0000000010000004 . = ALIGN (0x4)
- 0x0000000010000004 _ebss = .
- COMMON 0x0000000010000004 0x4 main.o
- 0x0000000010000004 current_time
- 0x0000000010008000 _sstack = 0x10008000
-LOAD startup.o
-LOAD CMSIS/system_LPC17xx.o
-LOAD main.o
-OUTPUT(main.elf elf32-littlearm)
-
-.comment 0x0000000000000000 0x11
- .comment 0x0000000000000000 0x11 startup.o
- 0x12 (size before relaxing)
- .comment 0x0000000000000000 0x12 CMSIS/system_LPC17xx.o
- .comment 0x0000000000000000 0x12 main.o
-
-.ARM.attributes
- 0x0000000000000000 0x31
- .ARM.attributes
- 0x0000000000000000 0x31 startup.o
- .ARM.attributes
- 0x0000000000000031 0x31 CMSIS/system_LPC17xx.o
- .ARM.attributes
- 0x0000000000000062 0x31 main.o
+\r
+Allocating common symbols\r
+Common symbol size file\r
+\r
+current_time 0x4 main.o\r
+\r
+Discarded input sections\r
+\r
+ .text 0x0000000000000000 0x0 startup.o\r
+ .data 0x0000000000000000 0x0 startup.o\r
+ .bss 0x0000000000000000 0x0 startup.o\r
+ .text 0x0000000000000000 0x0 CMSIS/system_LPC17xx.o\r
+ .data 0x0000000000000000 0x0 CMSIS/system_LPC17xx.o\r
+ .bss 0x0000000000000000 0x0 CMSIS/system_LPC17xx.o\r
+ .text.SystemCoreClockUpdate\r
+ 0x0000000000000000 0xfc CMSIS/system_LPC17xx.o\r
+ .text 0x0000000000000000 0x0 main.o\r
+ .data 0x0000000000000000 0x0 main.o\r
+ .bss 0x0000000000000000 0x0 main.o\r
+ .text.delay 0x0000000000000000 0x14 main.o\r
+\r
+Memory Configuration\r
+\r
+Name Origin Length Attributes\r
+flash 0x0000000000000000 0x0000000000080000 xr\r
+ram 0x0000000010000000 0x0000000000008000 xrw\r
+*default* 0x0000000000000000 0xffffffffffffffff\r
+\r
+Linker script and memory map\r
+\r
+ 0x0000000000000000 . = 0x0\r
+\r
+.text 0x0000000000000000 0x234\r
+ 0x0000000000000000 _stext = .\r
+ *(.cs3.interrupt_vector)\r
+ .cs3.interrupt_vector\r
+ 0x0000000000000000 0x40 startup.o\r
+ 0x0000000000000000 interrupt_vectors\r
+ *(.text*)\r
+ .text.Reset_Handler\r
+ 0x0000000000000040 0x44 startup.o\r
+ 0x0000000000000040 Reset_Handler\r
+ .text.Default_Handler\r
+ 0x0000000000000084 0x2 startup.o\r
+ 0x0000000000000084 DebugMon_Handler\r
+ 0x0000000000000084 HardFault_Handler\r
+ 0x0000000000000084 PendSV_Handler\r
+ 0x0000000000000084 NMI_Handler\r
+ 0x0000000000000084 UsageFault_Handler\r
+ 0x0000000000000084 Default_Handler\r
+ 0x0000000000000084 MemManage_Handler\r
+ 0x0000000000000084 SVC_Handler\r
+ 0x0000000000000084 BusFault_Handler\r
+ *fill* 0x0000000000000086 0x2 00\r
+ .text.SystemInit\r
+ 0x0000000000000088 0xe0 CMSIS/system_LPC17xx.o\r
+ 0x0000000000000088 SystemInit\r
+ .text.delay.clone.0\r
+ 0x0000000000000168 0x14 main.o\r
+ .text.SysTick_Handler\r
+ 0x000000000000017c 0x10 main.o\r
+ 0x000000000000017c SysTick_Handler\r
+ .text.main 0x000000000000018c 0xa8 main.o\r
+ 0x000000000000018c main\r
+ *(.rodata*)\r
+ 0x0000000000000234 . = ALIGN (0x4)\r
+ 0x0000000000000234 _etext = .\r
+\r
+.glue_7 0x0000000000000234 0x0\r
+ .glue_7 0x0000000000000000 0x0 linker stubs\r
+\r
+.glue_7t 0x0000000000000234 0x0\r
+ .glue_7t 0x0000000000000000 0x0 linker stubs\r
+\r
+.vfp11_veneer 0x0000000000000234 0x0\r
+ .vfp11_veneer 0x0000000000000000 0x0 linker stubs\r
+\r
+.v4_bx 0x0000000000000234 0x0\r
+ .v4_bx 0x0000000000000000 0x0 linker stubs\r
+\r
+.data 0x0000000010000000 0x4 load address 0x0000000000000234\r
+ 0x0000000010000000 _sdata = .\r
+ *(.data*)\r
+ .data.SystemCoreClock\r
+ 0x0000000010000000 0x4 CMSIS/system_LPC17xx.o\r
+ 0x0000000010000000 SystemCoreClock\r
+ 0x0000000010000004 _edata = .\r
+\r
+.bss 0x0000000010000004 0x4 load address 0x0000000000000238\r
+ 0x0000000010000004 _sbss = .\r
+ *(.bss*)\r
+ 0x0000000010000004 . = ALIGN (0x4)\r
+ 0x0000000010000004 _ebss = .\r
+ COMMON 0x0000000010000004 0x4 main.o\r
+ 0x0000000010000004 current_time\r
+ 0x0000000010008000 _sstack = 0x10008000\r
+LOAD startup.o\r
+LOAD CMSIS/system_LPC17xx.o\r
+LOAD main.o\r
+OUTPUT(main.elf elf32-littlearm)\r
+\r
+.comment 0x0000000000000000 0x11\r
+ .comment 0x0000000000000000 0x11 startup.o\r
+ 0x12 (size before relaxing)\r
+ .comment 0x0000000000000000 0x12 CMSIS/system_LPC17xx.o\r
+ .comment 0x0000000000000000 0x12 main.o\r
+\r
+.ARM.attributes\r
+ 0x0000000000000000 0x31\r
+ .ARM.attributes\r
+ 0x0000000000000000 0x31 startup.o\r
+ .ARM.attributes\r
+ 0x0000000000000031 0x31 CMSIS/system_LPC17xx.o\r
+ .ARM.attributes\r
+ 0x0000000000000062 0x31 main.o\r
-# The IMX31PDK eval board has a single IMX31 chip
-source [find interface/ngxtech.cfg]
-source [find target/lpc1768.cfg]
+# The IMX31PDK eval board has a single IMX31 chip\r
+source [find interface/ngxtech.cfg]\r
+source [find target/lpc1768.cfg]\r
-#!/bin/sh
-HELP='Usage:
- quiet fname cmd args ...
-
-Runs the passed in command printing only "cmd" and "fname" unless an
-error occurs in which case it prints the whole command line and
-colorized program output. Useful for running compilation commands since
-it removes the cluter, making it easier to spot errors and warnings.
-
-'
-# Copyright (c) 2008-2010 LoEE
-# This program is released under the new BSD license.
-
-if [ $# -lt 2 ]; then
- printf "$HELP"
- exit
-fi
-
-GREEN=""
-RED=""
-NORM=""
-if [ "$TERM@" = "rxvt@" ]; then
- GREEN="printf \033[32m"
- RED="printf \033[31m"
- YELLOW="printf \033[33m" # this is not yellow :)
- NORM="printf \033[m\017"
-fi
-if [ "$OSTYPE@" = "msys@" ]; then
- OLDATTR=$(eecolor.exe)
- GREEN="eecolor.exe 0 10"
- RED="eecolor.exe 0 12"
- YELLOW="eecolor 0 14"
- NORM="eecolor.exe ${OLDATTR}"
-fi
-
-MSG="$(printf "%-16s $1" "$2")"
-shift;
-
-printf "${MSG}\r" 1>&2
-
-rm -f quiet.log
-"$@" 2>> quiet.log
-RET=$?
-# if we check $? we won't notice the warnings
-if [ $RET -ne 0 -o -s quiet.log ]; then
- echo "$@" >& 2
- if [ $RET -ne 0 ]; then
- $RED >& 2
- else
- $YELLOW >& 2
- fi
- cat quiet.log >& 2
- $NORM &> 2
-
- exit $RET
-else
- $GREEN >& 2
- printf "${MSG}\n" 1>&2
- $NORM >& 2
-fi
-rm quiet.log
-exit $RET
+#!/bin/sh\r
+HELP='Usage:\r
+ quiet fname cmd args ...\r
+\r
+Runs the passed in command printing only "cmd" and "fname" unless an\r
+error occurs in which case it prints the whole command line and\r
+colorized program output. Useful for running compilation commands since\r
+it removes the cluter, making it easier to spot errors and warnings.\r
+\r
+'\r
+# Copyright (c) 2008-2010 LoEE\r
+# This program is released under the new BSD license.\r
+\r
+if [ $# -lt 2 ]; then\r
+ printf "$HELP"\r
+ exit\r
+fi\r
+\r
+GREEN=""\r
+RED=""\r
+NORM=""\r
+if [ "$TERM@" = "rxvt@" ]; then\r
+ GREEN="printf \033[32m"\r
+ RED="printf \033[31m"\r
+ YELLOW="printf \033[33m" # this is not yellow :)\r
+ NORM="printf \033[m\017"\r
+fi\r
+if [ "$OSTYPE@" = "msys@" ]; then\r
+ OLDATTR=$(eecolor.exe)\r
+ GREEN="eecolor.exe 0 10"\r
+ RED="eecolor.exe 0 12" \r
+ YELLOW="eecolor 0 14"\r
+ NORM="eecolor.exe ${OLDATTR}" \r
+fi\r
+\r
+MSG="$(printf "%-16s $1" "$2")"\r
+shift;\r
+\r
+printf "${MSG}\r" 1>&2\r
+\r
+rm -f quiet.log\r
+"$@" 2>> quiet.log\r
+RET=$?\r
+# if we check $? we won't notice the warnings\r
+if [ $RET -ne 0 -o -s quiet.log ]; then\r
+ echo "$@" >& 2\r
+ if [ $RET -ne 0 ]; then\r
+ $RED >& 2\r
+ else \r
+ $YELLOW >& 2\r
+ fi\r
+ cat quiet.log >& 2\r
+ $NORM &> 2\r
+\r
+ exit $RET\r
+else\r
+ $GREEN >& 2\r
+ printf "${MSG}\n" 1>&2\r
+ $NORM >& 2\r
+fi\r
+rm quiet.log\r
+exit $RET\r
-startup.o: startup.c CMSIS/LPC17xx.h CMSIS/core_cm3.h \
- CMSIS/system_LPC17xx.h
-
-CMSIS/LPC17xx.h:
-
-CMSIS/core_cm3.h:
-
-CMSIS/system_LPC17xx.h:
+startup.o: startup.c CMSIS/LPC17xx.h CMSIS/core_cm3.h \\r
+ CMSIS/system_LPC17xx.h\r
+\r
+CMSIS/LPC17xx.h:\r
+\r
+CMSIS/core_cm3.h:\r
+\r
+CMSIS/system_LPC17xx.h:\r
-CROSS_COMPILE ?= arm-none-eabi
-CC=$(CROSS_COMPILE)-gcc
-LD=$(CROSS_COMPILE)-ld
-AR=$(CROSS_COMPILE)-ar
-AS=$(CROSS_COMPILE)-as
-STRINGS=$(CROSS_COMPILE)-strings
-STRIP=$(CROSS_COMPILE)-strip
-OBJCOPY=$(CROSS_COMPILE)-objcopy
-OBJDUMP=$(CROSS_COMPILE)-objdump
-
-LDFLAGS=-nostdlib
-
-ALL=main
-OBJS=main.o sysinit.o
-
-$(ALL): $(OBJS)
-
-.PHONY: clean
-clean:
- rm -f $(ALL) $(OBJS)
+CROSS_COMPILE ?= arm-none-eabi\r
+CC=$(CROSS_COMPILE)-gcc\r
+LD=$(CROSS_COMPILE)-ld\r
+AR=$(CROSS_COMPILE)-ar\r
+AS=$(CROSS_COMPILE)-as\r
+STRINGS=$(CROSS_COMPILE)-strings\r
+STRIP=$(CROSS_COMPILE)-strip\r
+OBJCOPY=$(CROSS_COMPILE)-objcopy\r
+OBJDUMP=$(CROSS_COMPILE)-objdump\r
+\r
+LDFLAGS=-nostdlib\r
+\r
+ALL=main\r
+OBJS=main.o sysinit.o\r
+\r
+$(ALL): $(OBJS)\r
+\r
+.PHONY: clean\r
+clean:\r
+ rm -f $(ALL) $(OBJS)\r
-#include "sysinit.h"
-
-int main(int argc, char **argv) {
- sysinit();
- return 0;
-}
+#include "sysinit.h"\r
+\r
+int main(int argc, char **argv) {\r
+ sysinit();\r
+ return 0;\r
+}\r
-void sysinit() {
- // xtal_freq = 12000000;
-
- volatile int *scs;
- scs = (int *)0x400fc1a0;
- // enable main oscillator
- *scs = 0x20;
-
- // wait for oscillator to get ready
- while ((*scs & (1<<6)) == 0);
-
- volatile int *cclkcfg;
- cclkcfg = (int *)0x400FC104;
- // set clockdivider to 1/4x
- *cclkcfg = 0x03;
-
- // peripheral clocks (all set to 1/4x cclk)
- volatile int *pclksel0, *pclksel1;
- pclksel0=(int *)0x400FC1A8;
- *pclksel0 = 0;
- pclksel1=(int *)0x400FC1AC;
- *pclksel1 = 0;
-
- // main clock set (pll0)
- volatile int *clksrcsel;
- clksrcsel = (int *)0x400FC10C;
- *clksrcsel = 0x01;
-
- volatile int *pll0con, *pll0stat, *pll0feed, *pll0cfg;
- pll0con=(int*)0x400FC080;
- pll0stat=(int *)0x400FC088;
- // pll0feed : feed 0xAA followed by 0x55 to feed
- pll0feed=(int *)0x400FC08C;
- pll0cfg=(int *)0x400FC084;
-
- // FORMULA = FCCO = (2 * M * FIN) / N
- // as Xtal (FIN) is 12MHz, N = 6 , M = 25 gives 100 MHz
- // as both msel and nsel stores "N-1" store 24 and 5
- *pll0cfg = 24 | (5 << 16);
-
- // feed to set clock
- *pll0feed = 0xaa;
- *pll0feed = 0x55;
-
-
- // enable pll0
- *pll0con = 0x01;
- *pll0feed = 0xaa;
- *pll0feed = 0x55;
-
- // wait for enable
- while (!(*pll0stat & (1<<26)));
-
- // lock pll0
- *pll0con = 0x03;
- *pll0feed = 0xaa;
- *pll0feed = 0x55;
-
- // wait for lock
- while (!(*pll0stat & ((1<<25) | (1<<24))));
-
- volatile int *pll1con, *pll1cfg, *pll1stat, *pll1feed;
- pll1con=(int *)0x400FC0A0;
- pll1cfg=(int *)0x400FC0A4;
- pll1stat=(int *)0x400FC0A8;
- pll1feed=(int *)0x400FC0AC;
-
- // setup pll1 (multiplier 4, divider 6)
- *pll1cfg = 3 | (0x01 << 5);
-
- // enable pll1
- *pll1con = 0x01;
- *pll1feed = 0xaa;
- *pll1feed = 0x55;
- while (!(*pll1stat & (1<<10)));
-
- // connect pll1
- *pll1con = 0x03;
- *pll1feed = 0xaa;
- *pll1feed = 0x55;
- while (!(*pll1stat & ((1<< 9) | (1<< 8))));
-}
+void sysinit() {\r
+ // xtal_freq = 12000000;\r
+\r
+ volatile int *scs; \r
+ scs = (int *)0x400fc1a0;\r
+ // enable main oscillator\r
+ *scs = 0x20;\r
+\r
+ // wait for oscillator to get ready\r
+ while ((*scs & (1<<6)) == 0);\r
+\r
+ volatile int *cclkcfg; \r
+ cclkcfg = (int *)0x400FC104;\r
+ // set clockdivider to 1/4x\r
+ *cclkcfg = 0x03;\r
+\r
+ // peripheral clocks (all set to 1/4x cclk)\r
+ volatile int *pclksel0, *pclksel1;\r
+ pclksel0=(int *)0x400FC1A8;\r
+ *pclksel0 = 0;\r
+ pclksel1=(int *)0x400FC1AC;\r
+ *pclksel1 = 0;\r
+\r
+ // main clock set (pll0)\r
+ volatile int *clksrcsel;\r
+ clksrcsel = (int *)0x400FC10C;\r
+ *clksrcsel = 0x01;\r
+\r
+ volatile int *pll0con, *pll0stat, *pll0feed, *pll0cfg;\r
+ pll0con=(int*)0x400FC080;\r
+ pll0stat=(int *)0x400FC088;\r
+ // pll0feed : feed 0xAA followed by 0x55 to feed \r
+ pll0feed=(int *)0x400FC08C;\r
+ pll0cfg=(int *)0x400FC084;\r
+\r
+ // FORMULA = FCCO = (2 * M * FIN) / N\r
+ // as Xtal (FIN) is 12MHz, N = 6 , M = 25 gives 100 MHz\r
+ // as both msel and nsel stores "N-1" store 24 and 5\r
+ *pll0cfg = 24 | (5 << 16);\r
+\r
+ // feed to set clock\r
+ *pll0feed = 0xaa;\r
+ *pll0feed = 0x55;\r
+\r
+\r
+ // enable pll0\r
+ *pll0con = 0x01;\r
+ *pll0feed = 0xaa;\r
+ *pll0feed = 0x55;\r
+\r
+ // wait for enable\r
+ while (!(*pll0stat & (1<<26)));\r
+\r
+ // lock pll0\r
+ *pll0con = 0x03;\r
+ *pll0feed = 0xaa;\r
+ *pll0feed = 0x55;\r
+\r
+ // wait for lock\r
+ while (!(*pll0stat & ((1<<25) | (1<<24))));\r
+\r
+ volatile int *pll1con, *pll1cfg, *pll1stat, *pll1feed;\r
+ pll1con=(int *)0x400FC0A0;\r
+ pll1cfg=(int *)0x400FC0A4;\r
+ pll1stat=(int *)0x400FC0A8;\r
+ pll1feed=(int *)0x400FC0AC;\r
+\r
+ // setup pll1 (multiplier 4, divider 6)\r
+ *pll1cfg = 3 | (0x01 << 5);\r
+\r
+ // enable pll1\r
+ *pll1con = 0x01;\r
+ *pll1feed = 0xaa;\r
+ *pll1feed = 0x55;\r
+ while (!(*pll1stat & (1<<10)));\r
+\r
+ // connect pll1\r
+ *pll1con = 0x03;\r
+ *pll1feed = 0xaa;\r
+ *pll1feed = 0x55;\r
+ while (!(*pll1stat & ((1<< 9) | (1<< 8))));\r
+}\r
-void sysinit();
+void sysinit();\r
-target remote localhost:3333
+target remote localhost:3333\r
-PROJECT=rapper
-PLATFORM ?= arm-none-eabi
-LDFLAGS=--gc-sections -g -T LPC1768-flash.ld
-CFLAGS=-W -Wall --std=gnu99 -fgnu89-inline -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -I. -g
-#CFLAGS+=-Os
-
-# objects are separated by space
-OBJECTS=startup.o system_LPC17xx.o main.o core_cm3.o
-
-
-all: $(PROJECT).elf
-
-$(PROJECT).elf: $(OBJECTS)
- $(PLATFORM)-ld -Map $(PROJECT).map $(LDFLAGS) $(OBJECTS) -o $@
-
-%.o: %.c
- $(PLATFORM)-gcc -MM $< -MF $(patsubst %.o,%.d,$@) -MP
- $(PLATFORM)-gcc $(CFLAGS) -c $< -o $@
-
-.PHONY: clean gdb
-
-clean:
- rm -f $(PROJECT).elf $(OBJECTS) $(OBJECTS:.o=.d) $(PROJECT).map
-
-gdb:
- $(PLATFORM)-gdb $(PROJECT).elf
+PROJECT=rapper\r
+PLATFORM ?= arm-none-eabi\r
+LDFLAGS=--gc-sections -g -T LPC1768-flash.ld\r
+CFLAGS=-W -Wall --std=gnu99 -fgnu89-inline -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -I. -g\r
+#CFLAGS+=-Os\r
+\r
+# objects are separated by space\r
+OBJECTS=startup.o system_LPC17xx.o main.o core_cm3.o\r
+\r
+\r
+all: $(PROJECT).elf\r
+\r
+$(PROJECT).elf: $(OBJECTS)\r
+ $(PLATFORM)-ld -Map $(PROJECT).map $(LDFLAGS) $(OBJECTS) -o $@\r
+\r
+%.o: %.c\r
+ $(PLATFORM)-gcc -MM $< -MF $(patsubst %.o,%.d,$@) -MP\r
+ $(PLATFORM)-gcc $(CFLAGS) -c $< -o $@\r
+\r
+.PHONY: clean gdb\r
+\r
+clean:\r
+ rm -f $(PROJECT).elf $(OBJECTS) $(OBJECTS:.o=.d) $(PROJECT).map\r
+\r
+gdb:\r
+ $(PLATFORM)-gdb $(PROJECT).elf\r
-source [find interface/ngxtech.cfg]
-source [find target/lpc1768.cfg]
+source [find interface/ngxtech.cfg]\r
+source [find target/lpc1768.cfg]\r