William Reynolds
/
LPC_Bootloader
ID.cpp@5:6134277e4d57, 2011-09-30 (annotated)
- Committer:
- daugihao
- Date:
- Fri Sep 30 11:52:20 2011 +0000
- Revision:
- 5:6134277e4d57
- Parent:
- 4:8046ba0a87b5
- Child:
- 7:d0f98d61ec4c
Added compatibility with ID codes of various lengths
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
daugihao | 0:15536fa79743 | 1 | #include "mbed.h" |
daugihao | 0:15536fa79743 | 2 | #include "LPC.h" |
daugihao | 0:15536fa79743 | 3 | //Function to document the relevant information on LPC chips to load onto |
daugihao | 0:15536fa79743 | 4 | int SerialBuffered::IDCheck(int idcode) { |
daugihao | 0:15536fa79743 | 5 | switch (idcode) { |
daugihao | 4:8046ba0a87b5 | 6 | |
daugihao | 0:15536fa79743 | 7 | //Cortex M3 - LPC17xx |
daugihao | 5:6134277e4d57 | 8 | case 637615927: //Works |
daugihao | 1:0872c208795f | 9 | strcpy(strChipType, "LPC1768 - Cortex M3"); //Chip name |
daugihao | 1:0872c208795f | 10 | lastSector = 29; //Last available sector in Flash |
daugihao | 1:0872c208795f | 11 | RAM = 268435968; //First RAM address |
daugihao | 3:eb6d9211592d | 12 | strcpy(speed, "4000"); //Chip speed |
daugihao | 0:15536fa79743 | 13 | break; |
daugihao | 4:8046ba0a87b5 | 14 | |
daugihao | 4:8046ba0a87b5 | 15 | case 1023410219: |
daugihao | 5:6134277e4d57 | 16 | strcpy(strChipType, "LPC1343 - Cortex M3"); //Can run up to 115200 baud (working on compatability) |
daugihao | 5:6134277e4d57 | 17 | lastSector = 7; |
daugihao | 5:6134277e4d57 | 18 | RAM = 0x10000000; |
daugihao | 5:6134277e4d57 | 19 | strcpy(speed, "4000"); |
daugihao | 5:6134277e4d57 | 20 | break; |
daugihao | 5:6134277e4d57 | 21 | |
daugihao | 5:6134277e4d57 | 22 | case 71569451: |
daugihao | 5:6134277e4d57 | 23 | strcpy(strChipType, "LPC1114 - Cortex M3"); //Can run up to 115200 baud (working on compatability) |
daugihao | 5:6134277e4d57 | 24 | lastSector = 7; |
daugihao | 5:6134277e4d57 | 25 | RAM = 0x10000000; |
daugihao | 4:8046ba0a87b5 | 26 | strcpy(speed, "4000"); |
daugihao | 4:8046ba0a87b5 | 27 | break; |
daugihao | 4:8046ba0a87b5 | 28 | |
daugihao | 1:0872c208795f | 29 | //ARM7 |
daugihao | 5:6134277e4d57 | 30 | case 117702437: //Works |
daugihao | 1:0872c208795f | 31 | strcpy(strChipType, "LPC2387 - ARM7"); |
daugihao | 1:0872c208795f | 32 | lastSector = 27; |
daugihao | 1:0872c208795f | 33 | RAM = 0x40000200; |
daugihao | 4:8046ba0a87b5 | 34 | strcpy(speed, "4000"); |
daugihao | 0:15536fa79743 | 35 | break; |
daugihao | 0:15536fa79743 | 36 | |
daugihao | 0:15536fa79743 | 37 | default: |
daugihao | 0:15536fa79743 | 38 | strcpy(strChipType, "\n\rUnrecognised chip! Please add into the \"CheckTargetPresent\" function the chip's relevant information.\r\n\n"); |
daugihao | 1:0872c208795f | 39 | return(2); |
daugihao | 0:15536fa79743 | 40 | } |
daugihao | 0:15536fa79743 | 41 | return 0; |
daugihao | 0:15536fa79743 | 42 | } |