Browse Source

cc2538 algo: erase CCA first when erasing the full chip

This ensures that we'll unlock pages if needed.

Change-Id: I689dd1cb977b31a0fe03429966c9f55ef40e2a0e
jim
Jim Paris 2 years ago
committed by Jim Paris <jim@jim.sh>
parent
commit
96a0939ba9
2 changed files with 81 additions and 76 deletions
  1. +71
    -71
      contrib/loaders/flash/cc2538/cc2538_algo.inc
  2. +10
    -5
      contrib/loaders/flash/cc2538/flash.c

+ 71
- 71
contrib/loaders/flash/cc2538/cc2538_algo.inc View File

@@ -1,7 +1,7 @@
/* Autogenerated with ../../../../src/helper/bin2char.sh */
0x72,0xb6,0x4f,0xf0,0x00,0x00,0x80,0xf3,0x14,0x88,0xbf,0xf3,0x6f,0x8f,0x09,0x48,
0x85,0x46,0xbf,0xf3,0x6f,0x8f,0x4f,0xf0,0x00,0x00,0x07,0x49,0x07,0x4a,0x91,0x42,
0xb8,0xbf,0x41,0xf8,0x04,0x0b,0xfa,0xdb,0x00,0xf0,0x06,0xfa,0x00,0xf0,0x2c,0xf9,
0xb8,0xbf,0x41,0xf8,0x04,0x0b,0xfa,0xdb,0x00,0xf0,0x08,0xfa,0x00,0xf0,0x2c,0xf9,
0xfe,0xe7,0x00,0x00,0xd8,0x1b,0x00,0x20,0x1c,0x0b,0x00,0x20,0x40,0x0c,0x00,0x20,
0x06,0x48,0x07,0x4b,0x10,0xb5,0x83,0x42,0x04,0xd0,0x06,0x4b,0x00,0x2b,0x01,0xd0,
0x00,0xf0,0x4e,0xf8,0x10,0xbc,0x01,0xbc,0x00,0x47,0xc0,0x46,0x18,0x0b,0x00,0x20,
@@ -11,9 +11,9 @@
0x18,0x0b,0x00,0x20,0x00,0x00,0x00,0x00,0x10,0xb5,0x08,0x4c,0x23,0x78,0x00,0x2b,
0x09,0xd1,0xff,0xf7,0xcd,0xff,0x06,0x4b,0x00,0x2b,0x02,0xd0,0x05,0x48,0xaf,0xf3,
0x00,0x80,0x01,0x23,0x23,0x70,0x10,0xbc,0x01,0xbc,0x00,0x47,0x1c,0x0b,0x00,0x20,
0x00,0x00,0x00,0x00,0xc0,0x06,0x00,0x20,0x06,0x4b,0x10,0xb5,0x00,0x2b,0x03,0xd0,
0x00,0x00,0x00,0x00,0xc4,0x06,0x00,0x20,0x06,0x4b,0x10,0xb5,0x00,0x2b,0x03,0xd0,
0x05,0x49,0x06,0x48,0xaf,0xf3,0x00,0x80,0xff,0xf7,0xc6,0xff,0x10,0xbc,0x01,0xbc,
0x00,0x47,0xc0,0x46,0x00,0x00,0x00,0x00,0x20,0x0b,0x00,0x20,0xc0,0x06,0x00,0x20,
0x00,0x47,0xc0,0x46,0x00,0x00,0x00,0x00,0x20,0x0b,0x00,0x20,0xc4,0x06,0x00,0x20,
0x18,0x47,0xc0,0x46,0xd4,0x30,0x9f,0xe5,0x00,0x00,0x53,0xe3,0xc8,0x30,0x9f,0x05,
0x03,0xd0,0xa0,0xe1,0x00,0x20,0x0f,0xe1,0x0f,0x00,0x12,0xe3,0x15,0x00,0x00,0x0a,
0xd1,0xf0,0x21,0xe3,0x03,0xd0,0xa0,0xe1,0x01,0xaa,0x4d,0xe2,0x0a,0x30,0xa0,0xe1,
@@ -23,23 +23,23 @@
0xff,0x30,0xc3,0xe3,0xff,0x3c,0xc3,0xe3,0x04,0x30,0x03,0xe5,0x00,0x20,0x53,0xe9,
0xc0,0x20,0x82,0xe3,0x02,0xf0,0x21,0xe1,0x01,0xa8,0x43,0xe2,0x00,0x10,0xb0,0xe3,
0x01,0xb0,0xa0,0xe1,0x01,0x70,0xa0,0xe1,0x5c,0x00,0x9f,0xe5,0x5c,0x20,0x9f,0xe5,
0x00,0x20,0x52,0xe0,0x01,0x30,0x8f,0xe2,0x13,0xff,0x2f,0xe1,0x00,0xf0,0x7e,0xf9,
0x00,0x20,0x52,0xe0,0x01,0x30,0x8f,0xe2,0x13,0xff,0x2f,0xe1,0x00,0xf0,0x80,0xf9,
0x10,0x4b,0x00,0x2b,0x01,0xd0,0xfe,0x46,0x9f,0x46,0x0f,0x4b,0x00,0x2b,0x01,0xd0,
0xfe,0x46,0x9f,0x46,0x00,0x20,0x00,0x21,0x04,0x00,0x0d,0x00,0x0d,0x48,0x00,0xf0,
0x07,0xf9,0x00,0xf0,0x41,0xf9,0x20,0x00,0x29,0x00,0x00,0xf0,0x65,0xf8,0x00,0xf0,
0x09,0xf9,0x7b,0x46,0x18,0x47,0x00,0x00,0x11,0x00,0x00,0xef,0x00,0x00,0x08,0x00,
0x09,0xf9,0x00,0xf0,0x43,0xf9,0x20,0x00,0x29,0x00,0x00,0xf0,0x65,0xf8,0x00,0xf0,
0x0b,0xf9,0x7b,0x46,0x18,0x47,0x00,0x00,0x11,0x00,0x00,0xef,0x00,0x00,0x08,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x0b,0x00,0x20,
0x40,0x0c,0x00,0x20,0xfd,0x03,0x00,0x20,0x38,0xb5,0x0d,0x46,0x14,0x46,0x00,0x21,
0x28,0x22,0x00,0xf0,0x4b,0xf9,0x4f,0xf4,0x80,0x72,0x05,0x61,0x44,0x62,0x00,0x21,
0x02,0x48,0x00,0xf0,0x43,0xf9,0x00,0x20,0x38,0xbd,0x00,0xbf,0x38,0x0b,0x00,0x20,
0x40,0x0c,0x00,0x20,0x01,0x04,0x00,0x20,0x38,0xb5,0x0d,0x46,0x14,0x46,0x00,0x21,
0x28,0x22,0x00,0xf0,0x4d,0xf9,0x4f,0xf4,0x80,0x72,0x05,0x61,0x44,0x62,0x00,0x21,
0x02,0x48,0x00,0xf0,0x45,0xf9,0x00,0x20,0x38,0xbd,0x00,0xbf,0x38,0x0b,0x00,0x20,
0x10,0xb5,0x00,0xf0,0xa7,0xf8,0x04,0x46,0x38,0xb9,0x4f,0xf4,0x80,0x72,0x01,0x21,
0x03,0x48,0x00,0xf0,0x33,0xf9,0x20,0x46,0x10,0xbd,0x40,0xf2,0x01,0x14,0xfa,0xe7,
0x03,0x48,0x00,0xf0,0x35,0xf9,0x20,0x46,0x10,0xbd,0x40,0xf2,0x01,0x14,0xfa,0xe7,
0x38,0x0b,0x00,0x20,0xf8,0xb5,0x01,0x27,0xa1,0xf5,0x00,0x11,0x01,0x39,0xa0,0xf5,
0x00,0x14,0x01,0x44,0x0c,0x4e,0xe4,0x0a,0xcd,0x0a,0xac,0x42,0x01,0xd9,0x00,0x20,
0x0e,0xe0,0xa3,0x5d,0x73,0xb9,0x04,0xf5,0x80,0x60,0xc0,0x02,0x00,0xf0,0x60,0xf8,
0x38,0xb1,0x00,0x04,0x00,0xf4,0x7f,0x00,0x40,0xea,0x04,0x60,0x40,0xf4,0x81,0x70,
0xf8,0xbd,0xa7,0x55,0x01,0x34,0xe8,0xe7,0x38,0x0b,0x00,0x20,0x08,0xb5,0x00,0xf0,
0x87,0xf8,0x00,0x20,0x08,0xbd,0x00,0x00,0xf8,0xb5,0x20,0x4a,0x20,0x49,0x21,0x48,
0x89,0xf8,0x00,0x20,0x08,0xbd,0x00,0x00,0xf8,0xb5,0x20,0x4a,0x20,0x49,0x21,0x48,
0x20,0x4e,0xff,0xf7,0xa9,0xff,0x00,0x23,0x14,0x25,0x34,0x46,0x1e,0x4f,0x3b,0x60,
0x3b,0x68,0x05,0xfb,0x03,0x63,0x03,0xf1,0x08,0x02,0x51,0x68,0x00,0x29,0xfc,0xd0,
0x12,0x68,0x02,0x2a,0x0d,0xd0,0x03,0x2a,0x11,0xd0,0x01,0x2a,0x14,0xd1,0xff,0xf7,
@@ -49,65 +49,65 @@
0x02,0x43,0x19,0x7b,0x18,0x73,0x59,0x7b,0x58,0x73,0x99,0x7b,0x82,0xf0,0x01,0x02,
0x98,0x73,0xd9,0x7b,0x3a,0x60,0xd8,0x73,0xca,0xe7,0x00,0xbf,0x00,0x24,0x00,0x20,
0x00,0x1c,0x00,0x20,0xd8,0x1b,0x00,0x20,0x38,0x0c,0x00,0x20,0xfe,0xe7,0x00,0x00,
0x08,0xb5,0x02,0x68,0x4f,0xf4,0x00,0x73,0x01,0x32,0x0d,0xd1,0x01,0x3b,0xfd,0xd1,
0x00,0x20,0x08,0xbd,0x82,0x1c,0x04,0xd0,0x00,0x28,0xf9,0xd0,0x40,0xf2,0x03,0x10,
0xf7,0xe7,0x4f,0xf4,0x81,0x70,0xf4,0xe7,0x05,0x4b,0x4f,0xf4,0x00,0x61,0x1b,0x68,
0xdb,0x68,0x98,0x47,0x43,0x1c,0xed,0xd1,0x40,0xf2,0x01,0x10,0xe9,0xe7,0x00,0xbf,
0xd8,0x06,0x00,0x20,0x38,0xb5,0x00,0x24,0x08,0x4d,0x2b,0x68,0x5b,0x68,0x98,0x47,
0xb4,0xeb,0xd0,0x2f,0x01,0xd3,0x00,0x20,0x38,0xbd,0x04,0xf5,0x80,0x60,0xc0,0x02,
0xff,0xf7,0xce,0xff,0x00,0x28,0xf7,0xd1,0x01,0x34,0xee,0xe7,0xd8,0x06,0x00,0x20,
0x08,0xb5,0x0a,0x4b,0x1b,0x68,0x1b,0x69,0x98,0x47,0x42,0x1c,0x07,0xd0,0x83,0x1c,
0x08,0xd0,0x00,0x28,0x40,0xf2,0x03,0x10,0x08,0xbf,0x00,0x20,0x08,0xbd,0x40,0xf2,
0x01,0x10,0xfb,0xe7,0x4f,0xf4,0x81,0x70,0xf8,0xe7,0x00,0xbf,0xd8,0x06,0x00,0x20,
0x10,0xb5,0x01,0x00,0x00,0x23,0x00,0x22,0x00,0x20,0x00,0xf0,0xb1,0xf8,0x10,0xbc,
0x02,0xbc,0x08,0x47,0x10,0xb5,0x00,0x21,0x04,0x00,0x00,0xf0,0xef,0xf8,0x05,0x4b,
0x18,0x68,0xc3,0x6b,0x00,0x2b,0x01,0xd0,0x00,0xf0,0x06,0xf8,0x20,0x00,0xff,0xf7,
0x95,0xff,0xc0,0x46,0xd0,0x06,0x00,0x20,0x18,0x47,0xc0,0x46,0x70,0xb5,0x0a,0x4b,
0x0a,0x4c,0xe4,0x1a,0xa4,0x10,0x0a,0xd0,0x09,0x4a,0xa5,0x18,0xad,0x00,0xed,0x18,
0x2b,0x68,0x01,0x3c,0x00,0xf0,0x0e,0xf8,0x04,0x3d,0x00,0x2c,0xf8,0xd1,0x00,0xf0,
0x49,0xf9,0x70,0xbc,0x01,0xbc,0x00,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xff,0xff,0xff,0x3f,0x18,0x47,0xc0,0x46,0x70,0xb5,0x0f,0x4e,0x0f,0x4d,0xad,0x1b,
0xad,0x10,0x07,0xd0,0x00,0x24,0xa3,0x00,0xf3,0x58,0x01,0x34,0x00,0xf0,0x1c,0xf8,
0xa5,0x42,0xf8,0xd1,0x00,0xf0,0x28,0xf9,0x09,0x4e,0x0a,0x4d,0xad,0x1b,0xad,0x10,
0x07,0xd0,0x00,0x24,0xa3,0x00,0xf3,0x58,0x01,0x34,0x00,0xf0,0x0d,0xf8,0xa5,0x42,
0xf8,0xd1,0x70,0xbc,0x01,0xbc,0x00,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x47,0xc0,0x46,0xf0,0xb5,0x83,0x07,
0x4a,0xd0,0x54,0x1e,0x00,0x2a,0x44,0xd0,0x0d,0x06,0x2d,0x0e,0x02,0x00,0x03,0x26,
0x02,0xe0,0x1a,0x00,0x01,0x3c,0x3c,0xd3,0x53,0x1c,0x15,0x70,0x33,0x42,0xf8,0xd1,
0x03,0x2c,0x2d,0xd9,0xff,0x22,0x0a,0x40,0x15,0x02,0x15,0x43,0x2a,0x04,0x15,0x43,
0x0f,0x2c,0x16,0xd9,0x27,0x00,0x10,0x3f,0x3f,0x09,0x3e,0x01,0xb4,0x46,0x1e,0x00,
0x1a,0x00,0x10,0x36,0x66,0x44,0x15,0x60,0x55,0x60,0x95,0x60,0xd5,0x60,0x10,0x32,
0xb2,0x42,0xf8,0xd1,0x0f,0x22,0x01,0x37,0x3f,0x01,0xdb,0x19,0x14,0x40,0x03,0x2c,
0x0e,0xd9,0x26,0x1f,0xb6,0x08,0xb7,0x00,0xbc,0x46,0x1a,0x00,0x1f,0x1d,0x67,0x44,
0x20,0xc2,0xba,0x42,0xfc,0xd1,0x03,0x22,0x01,0x36,0xb6,0x00,0x9b,0x19,0x14,0x40,
0x00,0x2c,0x06,0xd0,0x09,0x06,0x1c,0x19,0x09,0x0e,0x19,0x70,0x01,0x33,0x9c,0x42,
0xfb,0xd1,0xf0,0xbc,0x02,0xbc,0x08,0x47,0x14,0x00,0x03,0x00,0xc0,0xe7,0xc0,0x46,
0xf0,0xb5,0xc6,0x46,0x00,0xb5,0x20,0x4c,0x24,0x68,0x82,0xb0,0x01,0x94,0xa4,0x24,
0x01,0x9d,0x64,0x00,0x2d,0x59,0x00,0x2d,0x2d,0xd0,0x6c,0x68,0x1f,0x2c,0x30,0xdc,
0x00,0x28,0x0b,0xd1,0x00,0x20,0x63,0x1c,0x02,0x34,0xa4,0x00,0x6b,0x60,0x61,0x51,
0x02,0xb0,0x04,0xbc,0x90,0x46,0xf0,0xbc,0x02,0xbc,0x08,0x47,0x88,0x27,0xa6,0x00,
0xae,0x19,0xf2,0x51,0x01,0x37,0xff,0x37,0xbc,0x46,0x01,0x22,0xac,0x44,0x67,0x46,
0xa2,0x40,0x3f,0x68,0x90,0x46,0x17,0x43,0x62,0x46,0x17,0x60,0x84,0x27,0x7f,0x00,
0xf3,0x51,0x02,0x28,0xde,0xd1,0x2b,0x00,0x40,0x46,0x8d,0x33,0xff,0x33,0x1a,0x68,
0x10,0x43,0x18,0x60,0xd6,0xe7,0x01,0x9d,0x01,0x9e,0x4d,0x35,0xff,0x35,0x35,0x51,
0xcb,0xe7,0x01,0x20,0x40,0x42,0xd3,0xe7,0xd0,0x06,0x00,0x20,0xf0,0xb5,0x4e,0x46,
0xde,0x46,0x57,0x46,0x45,0x46,0xe0,0xb5,0x2e,0x4b,0x1b,0x68,0x83,0xb0,0x1a,0x00,
0x00,0x93,0xa4,0x23,0x5b,0x00,0xd6,0x58,0x01,0x22,0x01,0x90,0x0f,0x00,0x93,0x46,
0x99,0x46,0x00,0x2e,0x31,0xd0,0x74,0x68,0x65,0x1e,0x2e,0xd4,0xc4,0x23,0x5b,0x00,
0x9a,0x46,0x01,0x34,0xa4,0x00,0x34,0x19,0xb2,0x44,0x02,0xe0,0x04,0x3c,0x01,0x3d,
0x23,0xd3,0x00,0x2f,0x04,0xd0,0x63,0x1c,0xff,0x33,0x1b,0x68,0xbb,0x42,0xf5,0xd1,
0x73,0x68,0x01,0x3b,0x22,0x68,0xab,0x42,0x20,0xd0,0x00,0x23,0x23,0x60,0x00,0x2a,
0xec,0xd0,0x73,0x68,0x98,0x46,0x5b,0x46,0x51,0x46,0xab,0x40,0x09,0x68,0x19,0x42,
0x16,0xd1,0x00,0xf0,0x29,0xf8,0x4a,0x46,0x00,0x9b,0x9b,0x58,0x72,0x68,0x42,0x45,
0x01,0xd1,0x9e,0x42,0xda,0xd0,0x1e,0x1e,0xcd,0xd1,0x03,0xb0,0x3c,0xbc,0x90,0x46,
0x99,0x46,0xa2,0x46,0xab,0x46,0xf0,0xbc,0x01,0xbc,0x00,0x47,0x75,0x60,0xde,0xe7,
0x30,0x00,0x21,0x00,0x8d,0x30,0xff,0x30,0x00,0x68,0x80,0x31,0x09,0x68,0x18,0x42,
0x03,0xd1,0x01,0x98,0x00,0xf0,0x08,0xf8,0xdd,0xe7,0x08,0x00,0x00,0xf0,0x04,0xf8,
0xd9,0xe7,0xc0,0x46,0xd0,0x06,0x00,0x20,0x10,0x47,0xc0,0x46,0x04,0x4b,0x10,0xb5,
0x00,0x2b,0x02,0xd0,0x03,0x48,0xff,0xf7,0x93,0xfe,0x10,0xbc,0x01,0xbc,0x00,0x47,
0x00,0x00,0x00,0x00,0xfd,0x03,0x00,0x20,0xf8,0xb5,0xc0,0x46,0xf8,0xbc,0x08,0xbc,
0x9e,0x46,0x70,0x47,0xf8,0xb5,0xc0,0x46,0xf8,0xbc,0x08,0xbc,0x9e,0x46,0x70,0x47,
0x00,0x00,0x00,0x00,0x30,0xfa,0xff,0x7f,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x08,0xb5,0x00,0x23,0x1a,0x58,0x01,0x32,0x0f,0xd1,0x01,0x33,0xb3,0xf5,0x00,0x7f,
0xf8,0xd1,0x00,0x20,0x08,0xbd,0x82,0x1c,0x04,0xd0,0x00,0x28,0xf9,0xd0,0x40,0xf2,
0x03,0x10,0xf7,0xe7,0x4f,0xf4,0x81,0x70,0xf4,0xe7,0x05,0x4b,0x4f,0xf4,0x00,0x61,
0x1b,0x68,0xdb,0x68,0x98,0x47,0x43,0x1c,0xed,0xd1,0x40,0xf2,0x01,0x10,0xe9,0xe7,
0xd8,0x06,0x00,0x20,0x70,0xb5,0x0a,0x4b,0x00,0x24,0x1b,0x68,0x5b,0x68,0x98,0x47,
0xc5,0x0a,0x05,0xf2,0xff,0x36,0xa5,0x42,0x01,0xd1,0x00,0x20,0x06,0xe0,0x30,0x1b,
0xc0,0x02,0xff,0xf7,0xcd,0xff,0x01,0x34,0x00,0x28,0xf4,0xd0,0x70,0xbd,0x00,0xbf,
0xd8,0x06,0x00,0x20,0x08,0xb5,0x0a,0x4b,0x92,0x08,0x1b,0x68,0x1b,0x69,0x98,0x47,
0x42,0x1c,0x07,0xd0,0x83,0x1c,0x08,0xd0,0x00,0x28,0x14,0xbf,0x4f,0xf4,0x83,0x70,
0x00,0x20,0x08,0xbd,0x4f,0xf4,0x82,0x70,0xfb,0xe7,0x40,0xf2,0x05,0x10,0xf8,0xe7,
0xd8,0x06,0x00,0x20,0x10,0xb5,0x01,0x00,0x00,0x23,0x00,0x22,0x00,0x20,0x00,0xf0,
0xb1,0xf8,0x10,0xbc,0x02,0xbc,0x08,0x47,0x10,0xb5,0x00,0x21,0x04,0x00,0x00,0xf0,
0xef,0xf8,0x05,0x4b,0x18,0x68,0xc3,0x6b,0x00,0x2b,0x01,0xd0,0x00,0xf0,0x06,0xf8,
0x20,0x00,0xff,0xf7,0x93,0xff,0xc0,0x46,0xd0,0x06,0x00,0x20,0x18,0x47,0xc0,0x46,
0x70,0xb5,0x0a,0x4b,0x0a,0x4c,0xe4,0x1a,0xa4,0x10,0x0a,0xd0,0x09,0x4a,0xa5,0x18,
0xad,0x00,0xed,0x18,0x2b,0x68,0x01,0x3c,0x00,0xf0,0x0e,0xf8,0x04,0x3d,0x00,0x2c,
0xf8,0xd1,0x00,0xf0,0x49,0xf9,0x70,0xbc,0x01,0xbc,0x00,0x47,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x3f,0x18,0x47,0xc0,0x46,0x70,0xb5,0x0f,0x4e,
0x0f,0x4d,0xad,0x1b,0xad,0x10,0x07,0xd0,0x00,0x24,0xa3,0x00,0xf3,0x58,0x01,0x34,
0x00,0xf0,0x1c,0xf8,0xa5,0x42,0xf8,0xd1,0x00,0xf0,0x28,0xf9,0x09,0x4e,0x0a,0x4d,
0xad,0x1b,0xad,0x10,0x07,0xd0,0x00,0x24,0xa3,0x00,0xf3,0x58,0x01,0x34,0x00,0xf0,
0x0d,0xf8,0xa5,0x42,0xf8,0xd1,0x70,0xbc,0x01,0xbc,0x00,0x47,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x47,0xc0,0x46,
0xf0,0xb5,0x83,0x07,0x4a,0xd0,0x54,0x1e,0x00,0x2a,0x44,0xd0,0x0d,0x06,0x2d,0x0e,
0x02,0x00,0x03,0x26,0x02,0xe0,0x1a,0x00,0x01,0x3c,0x3c,0xd3,0x53,0x1c,0x15,0x70,
0x33,0x42,0xf8,0xd1,0x03,0x2c,0x2d,0xd9,0xff,0x22,0x0a,0x40,0x15,0x02,0x15,0x43,
0x2a,0x04,0x15,0x43,0x0f,0x2c,0x16,0xd9,0x27,0x00,0x10,0x3f,0x3f,0x09,0x3e,0x01,
0xb4,0x46,0x1e,0x00,0x1a,0x00,0x10,0x36,0x66,0x44,0x15,0x60,0x55,0x60,0x95,0x60,
0xd5,0x60,0x10,0x32,0xb2,0x42,0xf8,0xd1,0x0f,0x22,0x01,0x37,0x3f,0x01,0xdb,0x19,
0x14,0x40,0x03,0x2c,0x0e,0xd9,0x26,0x1f,0xb6,0x08,0xb7,0x00,0xbc,0x46,0x1a,0x00,
0x1f,0x1d,0x67,0x44,0x20,0xc2,0xba,0x42,0xfc,0xd1,0x03,0x22,0x01,0x36,0xb6,0x00,
0x9b,0x19,0x14,0x40,0x00,0x2c,0x06,0xd0,0x09,0x06,0x1c,0x19,0x09,0x0e,0x19,0x70,
0x01,0x33,0x9c,0x42,0xfb,0xd1,0xf0,0xbc,0x02,0xbc,0x08,0x47,0x14,0x00,0x03,0x00,
0xc0,0xe7,0xc0,0x46,0xf0,0xb5,0xc6,0x46,0x00,0xb5,0x20,0x4c,0x24,0x68,0x82,0xb0,
0x01,0x94,0xa4,0x24,0x01,0x9d,0x64,0x00,0x2d,0x59,0x00,0x2d,0x2d,0xd0,0x6c,0x68,
0x1f,0x2c,0x30,0xdc,0x00,0x28,0x0b,0xd1,0x00,0x20,0x63,0x1c,0x02,0x34,0xa4,0x00,
0x6b,0x60,0x61,0x51,0x02,0xb0,0x04,0xbc,0x90,0x46,0xf0,0xbc,0x02,0xbc,0x08,0x47,
0x88,0x27,0xa6,0x00,0xae,0x19,0xf2,0x51,0x01,0x37,0xff,0x37,0xbc,0x46,0x01,0x22,
0xac,0x44,0x67,0x46,0xa2,0x40,0x3f,0x68,0x90,0x46,0x17,0x43,0x62,0x46,0x17,0x60,
0x84,0x27,0x7f,0x00,0xf3,0x51,0x02,0x28,0xde,0xd1,0x2b,0x00,0x40,0x46,0x8d,0x33,
0xff,0x33,0x1a,0x68,0x10,0x43,0x18,0x60,0xd6,0xe7,0x01,0x9d,0x01,0x9e,0x4d,0x35,
0xff,0x35,0x35,0x51,0xcb,0xe7,0x01,0x20,0x40,0x42,0xd3,0xe7,0xd0,0x06,0x00,0x20,
0xf0,0xb5,0x4e,0x46,0xde,0x46,0x57,0x46,0x45,0x46,0xe0,0xb5,0x2e,0x4b,0x1b,0x68,
0x83,0xb0,0x1a,0x00,0x00,0x93,0xa4,0x23,0x5b,0x00,0xd6,0x58,0x01,0x22,0x01,0x90,
0x0f,0x00,0x93,0x46,0x99,0x46,0x00,0x2e,0x31,0xd0,0x74,0x68,0x65,0x1e,0x2e,0xd4,
0xc4,0x23,0x5b,0x00,0x9a,0x46,0x01,0x34,0xa4,0x00,0x34,0x19,0xb2,0x44,0x02,0xe0,
0x04,0x3c,0x01,0x3d,0x23,0xd3,0x00,0x2f,0x04,0xd0,0x63,0x1c,0xff,0x33,0x1b,0x68,
0xbb,0x42,0xf5,0xd1,0x73,0x68,0x01,0x3b,0x22,0x68,0xab,0x42,0x20,0xd0,0x00,0x23,
0x23,0x60,0x00,0x2a,0xec,0xd0,0x73,0x68,0x98,0x46,0x5b,0x46,0x51,0x46,0xab,0x40,
0x09,0x68,0x19,0x42,0x16,0xd1,0x00,0xf0,0x29,0xf8,0x4a,0x46,0x00,0x9b,0x9b,0x58,
0x72,0x68,0x42,0x45,0x01,0xd1,0x9e,0x42,0xda,0xd0,0x1e,0x1e,0xcd,0xd1,0x03,0xb0,
0x3c,0xbc,0x90,0x46,0x99,0x46,0xa2,0x46,0xab,0x46,0xf0,0xbc,0x01,0xbc,0x00,0x47,
0x75,0x60,0xde,0xe7,0x30,0x00,0x21,0x00,0x8d,0x30,0xff,0x30,0x00,0x68,0x80,0x31,
0x09,0x68,0x18,0x42,0x03,0xd1,0x01,0x98,0x00,0xf0,0x08,0xf8,0xdd,0xe7,0x08,0x00,
0x00,0xf0,0x04,0xf8,0xd9,0xe7,0xc0,0x46,0xd0,0x06,0x00,0x20,0x10,0x47,0xc0,0x46,
0x04,0x4b,0x10,0xb5,0x00,0x2b,0x02,0xd0,0x03,0x48,0xff,0xf7,0x93,0xfe,0x10,0xbc,
0x01,0xbc,0x00,0x47,0x00,0x00,0x00,0x00,0x01,0x04,0x00,0x20,0xf8,0xb5,0xc0,0x46,
0xf8,0xbc,0x08,0xbc,0x9e,0x46,0x70,0x47,0xf8,0xb5,0xc0,0x46,0xf8,0xbc,0x08,0xbc,
0x9e,0x46,0x70,0x47,0x00,0x00,0x00,0x00,0x2c,0xfa,0xff,0x7f,0x01,0x00,0x00,0x00,
0xe8,0x06,0x00,0x20,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xe8,0x06,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd4,0x09,0x00,0x20,
0x3c,0x0a,0x00,0x20,0xa4,0x0a,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -176,7 +176,7 @@
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xc9,0x00,0x00,0x20,0x99,0x00,0x00,0x20,0x8d,0x06,0x00,0x20,0x00,0x00,0x00,0x00,
0xc9,0x00,0x00,0x20,0x99,0x00,0x00,0x20,0x91,0x06,0x00,0x20,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,


+ 10
- 5
contrib/loaders/flash/cc2538/flash.c View File

@@ -56,7 +56,7 @@ extern uint32_t flash_sector_erase(uint32_t sector_address)
int i;

for (i = 0; i < FLASH_ERASE_SIZE / 4; i++) {
if ((*(uint32_t *)sector_address) != 0xffffffff) {
if ((*(uint32_t *)(sector_address + i)) != 0xffffffff) {
already_erased = false;
break;
}
@@ -78,7 +78,12 @@ extern uint32_t flash_bank_erase(void)
{
int i;
long ret;
for (i = 0; i < ROM->GetFlashSize() / FLASH_ERASE_SIZE; i++)
/* Some pages may be locked by bits in the CCA. Erasing the CCA
first will ensure that those pages will become unlocked.
So, since the CCA is the last page in flash, let's just erase
sectors backwards. */
int num_sectors = ROM->GetFlashSize() / FLASH_ERASE_SIZE;
for (i = num_sectors - 1; i >= 0; i--)
{
ret = flash_sector_erase(flash_sector_to_address(i));
if (ret != 0)
@@ -93,10 +98,10 @@ extern uint32_t flash_program(uint8_t *data_buffer, uint32_t address,
long ret;
ret = ROM->ProgramFlash((unsigned long *)data_buffer, address, count);
if (ret == -1)
return 0x101;
return 0x104;
if (ret == -2)
return 0x102;
return 0x105;
if (ret != 0)
return 0x103;
return 0x106;
return 0;
}

Loading…
Cancel
Save