Browse Source

cc2538 algo: use flash_erase_sector for flash_bulk_erase

Change-Id: I9609bb83db620e79639f285ac83b139787ec4945
jim
Jim Paris 3 years ago
committed by Jim Paris <jim@jim.sh>
parent
commit
bf75ea8737
5 changed files with 139 additions and 206 deletions
  1. +110
    -110
      contrib/loaders/flash/cc2538/cc2538_algo.inc
  2. +18
    -13
      contrib/loaders/flash/cc2538/flash.c
  3. +8
    -0
      contrib/loaders/flash/cc2538/flash.h
  4. +3
    -71
      contrib/loaders/flash/cc2538/flashloader.c
  5. +0
    -12
      contrib/loaders/flash/cc2538/flashloader.h

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

@@ -1,19 +1,19 @@
/* 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,0x4c,0xfa,0x00,0xf0,0x94,0xf9,
0xfe,0xe7,0x00,0x00,0xd8,0x1b,0x00,0x20,0x34,0x0c,0x00,0x20,0x58,0x0d,0x00,0x20,
0xb8,0xbf,0x41,0xf8,0x04,0x0b,0xfa,0xdb,0x00,0xf0,0xf0,0xf9,0x00,0xf0,0x2c,0xf9,
0xfe,0xe7,0x00,0x00,0xd8,0x1b,0x00,0x20,0xec,0x0a,0x00,0x20,0x10,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,0x30,0x0c,0x00,0x20,
0x30,0x0c,0x00,0x20,0x00,0x00,0x00,0x00,0x08,0x48,0x09,0x49,0x09,0x1a,0x89,0x10,
0x00,0xf0,0x4e,0xf8,0x10,0xbc,0x01,0xbc,0x00,0x47,0xc0,0x46,0xe8,0x0a,0x00,0x20,
0xe8,0x0a,0x00,0x20,0x00,0x00,0x00,0x00,0x08,0x48,0x09,0x49,0x09,0x1a,0x89,0x10,
0xcb,0x0f,0x59,0x18,0x10,0xb5,0x49,0x10,0x04,0xd0,0x06,0x4b,0x00,0x2b,0x01,0xd0,
0x00,0xf0,0x36,0xf8,0x10,0xbc,0x01,0xbc,0x00,0x47,0xc0,0x46,0x30,0x0c,0x00,0x20,
0x30,0x0c,0x00,0x20,0x00,0x00,0x00,0x00,0x10,0xb5,0x08,0x4c,0x23,0x78,0x00,0x2b,
0x00,0xf0,0x36,0xf8,0x10,0xbc,0x01,0xbc,0x00,0x47,0xc0,0x46,0xe8,0x0a,0x00,0x20,
0xe8,0x0a,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,0x34,0x0c,0x00,0x20,
0x00,0x00,0x00,0x00,0xd8,0x07,0x00,0x20,0x06,0x4b,0x10,0xb5,0x00,0x2b,0x03,0xd0,
0x00,0x80,0x01,0x23,0x23,0x70,0x10,0xbc,0x01,0xbc,0x00,0x47,0xec,0x0a,0x00,0x20,
0x00,0x00,0x00,0x00,0x94,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,0x38,0x0c,0x00,0x20,0xd8,0x07,0x00,0x20,
0x00,0x47,0xc0,0x46,0x00,0x00,0x00,0x00,0xf0,0x0a,0x00,0x20,0x94,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,111 +23,91 @@
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,0x0a,0xfa,
0x00,0x20,0x52,0xe0,0x01,0x30,0x8f,0xe2,0x13,0xff,0x2f,0xe1,0x00,0xf0,0x68,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,
0x4d,0xf9,0x00,0xf0,0x87,0xf9,0x20,0x00,0x29,0x00,0x00,0xf0,0xcd,0xf8,0x00,0xf0,
0x4f,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,0x34,0x0c,0x00,0x20,
0x58,0x0d,0x00,0x20,0x89,0x04,0x00,0x20,0x38,0xb5,0x0d,0x46,0x14,0x46,0x00,0x21,
0x28,0x22,0x00,0xf0,0xd7,0xf9,0x4f,0xf4,0x80,0x72,0x05,0x61,0x44,0x62,0x00,0x21,
0x02,0x48,0x00,0xf0,0xcf,0xf9,0x00,0x20,0x38,0xbd,0x00,0xbf,0x50,0x0c,0x00,0x20,
0x10,0xb5,0x00,0xf0,0xf7,0xf8,0x04,0x46,0x38,0xb9,0x4f,0xf4,0x80,0x72,0x01,0x21,
0x03,0x48,0x00,0xf0,0xbf,0xf9,0x20,0x46,0x10,0xbd,0x40,0xf2,0x01,0x14,0xfa,0xe7,
0x50,0x0c,0x00,0x20,0xf8,0xb5,0x01,0x27,0x4d,0x1e,0x05,0x44,0x0b,0x4e,0xc4,0x0a,
0xed,0x0a,0xac,0x42,0x01,0xd9,0x00,0x20,0x0c,0xe0,0xa3,0x5d,0x63,0xb9,0xe0,0x02,
0x00,0xf0,0xce,0xf8,0x38,0xb1,0x00,0x04,0x00,0xf4,0x7f,0x00,0x40,0xea,0x04,0x60,
0x40,0xf4,0x81,0x70,0xf8,0xbd,0xa7,0x55,0x01,0x34,0xea,0xe7,0x50,0x0c,0x00,0x20,
0xb2,0xf5,0x00,0x6f,0xf8,0xb5,0x07,0x46,0x0e,0x46,0x15,0x46,0x0c,0xd8,0x11,0x46,
0x30,0x46,0xff,0xf7,0xd7,0xff,0x04,0x46,0x20,0xb9,0x2a,0x46,0x31,0x46,0x38,0x46,
0x00,0xf0,0xd2,0xf8,0x20,0x46,0xf8,0xbd,0x4f,0xf4,0x82,0x74,0xfa,0xe7,0x00,0x00,
0x2d,0xe9,0xf0,0x4f,0x0d,0x46,0x4f,0xf0,0x00,0x09,0x53,0x1e,0x85,0xb0,0x0b,0x44,
0xdb,0x0a,0x02,0x90,0x4f,0xea,0xd1,0x28,0x16,0x46,0x00,0x21,0x4f,0xf4,0x80,0x72,
0x20,0x48,0xdf,0xf8,0x84,0xa0,0x01,0x93,0x4f,0xea,0xc8,0x27,0x00,0xf0,0x6a,0xf9,
0xc5,0xf3,0x0a,0x03,0x01,0x9a,0x90,0x45,0x03,0xd9,0x00,0x20,0x05,0xb0,0xbd,0xe8,
0xf0,0x8f,0xac,0x19,0x07,0xf5,0x00,0x6b,0x5c,0x45,0x94,0xbf,0x34,0x46,0xc4,0xf3,
0x0a,0x04,0x4f,0xf4,0x00,0x62,0x39,0x46,0x13,0x48,0x88,0xbf,0x34,0x1b,0x03,0x93,
0x00,0xf0,0x0a,0xf9,0x02,0x9b,0x22,0x46,0x03,0xeb,0x09,0x01,0x03,0x9b,0x08,0xf1,
0x01,0x08,0x0a,0xeb,0x03,0x00,0x00,0xf0,0xff,0xf8,0x4f,0xf4,0x00,0x61,0x38,0x46,
0xff,0xf7,0x88,0xff,0x00,0x28,0xd9,0xd1,0x39,0x46,0x4f,0xf4,0x00,0x62,0x50,0x46,
0x25,0x44,0x00,0xf0,0x81,0xf8,0x36,0x1b,0xc5,0xf3,0x0a,0x03,0xa1,0x44,0x5f,0x46,
0xc8,0xe7,0x00,0xbf,0x50,0x0c,0x00,0x20,0x00,0x2c,0x00,0x20,0x08,0xb5,0x00,0xf0,
0x73,0xf8,0x00,0x20,0x08,0xbd,0x00,0x00,0xf8,0xb5,0x20,0x4a,0x20,0x49,0x21,0x48,
0x20,0x4e,0xff,0xf7,0x41,0xff,0x00,0x23,0x14,0x25,0x34,0x46,0x1e,0x4f,0x3b,0x60,
0xf1,0xf8,0x00,0xf0,0x2b,0xf9,0x20,0x00,0x29,0x00,0x00,0xf0,0x65,0xf8,0x00,0xf0,
0xf3,0xf8,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,0xec,0x0a,0x00,0x20,
0x10,0x0c,0x00,0x20,0xd1,0x03,0x00,0x20,0x38,0xb5,0x0d,0x46,0x14,0x46,0x00,0x21,
0x28,0x22,0x00,0xf0,0x35,0xf9,0x4f,0xf4,0x80,0x72,0x05,0x61,0x44,0x62,0x00,0x21,
0x02,0x48,0x00,0xf0,0x2d,0xf9,0x00,0x20,0x38,0xbd,0x00,0xbf,0x08,0x0b,0x00,0x20,
0x10,0xb5,0x00,0xf0,0x9f,0xf8,0x04,0x46,0x38,0xb9,0x4f,0xf4,0x80,0x72,0x01,0x21,
0x03,0x48,0x00,0xf0,0x1d,0xf9,0x20,0x46,0x10,0xbd,0x40,0xf2,0x01,0x14,0xfa,0xe7,
0x08,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,0x08,0x0b,0x00,0x20,0x08,0xb5,0x00,0xf0,
0x7f,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,
0x3f,0xff,0x3a,0x68,0x98,0xb1,0x14,0x22,0x3b,0x68,0x02,0xfb,0x03,0x44,0xe0,0x60,
0xa7,0xff,0x3a,0x68,0x98,0xb1,0x14,0x22,0x3b,0x68,0x02,0xfb,0x03,0x44,0xe0,0x60,
0xfe,0xe7,0x18,0x69,0x19,0x68,0x5a,0x68,0xff,0xf7,0xd0,0xff,0xf1,0xe7,0x18,0x68,
0x59,0x68,0xff,0xf7,0x3f,0xff,0xec,0xe7,0x40,0xf2,0x05,0x10,0xeb,0xe7,0x05,0xfb,
0x59,0x68,0xff,0xf7,0xa7,0xff,0xec,0xe7,0x40,0xf2,0x05,0x10,0xeb,0xe7,0x05,0xfb,
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,0x50,0x0d,0x00,0x20,0xfe,0xe7,0x00,0x00,
0x00,0x1c,0x00,0x20,0xd8,0x1b,0x00,0x20,0x08,0x0c,0x00,0x20,0xfe,0xe7,0x00,0x00,
0x08,0xb5,0x0b,0x4b,0x4f,0xf4,0x00,0x61,0x1b,0x68,0xdb,0x68,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,
0xa8,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,0xd6,0xff,0x00,0x28,0xf7,0xd1,0x01,0x34,0xee,0xe7,0xa8,0x06,0x00,0x20,
0x02,0x4b,0x03,0x4a,0x1a,0x60,0x01,0x32,0x5a,0x61,0xfe,0xe7,0xe4,0x1b,0x00,0x20,
0xf1,0xff,0xee,0xee,0x10,0xb5,0x0b,0x4b,0x1b,0x68,0xdc,0x68,0x5b,0x68,0x98,0x47,
0x01,0x46,0x4f,0xf4,0x00,0x10,0xa0,0x47,0x38,0xb1,0x43,0x1c,0x06,0xd0,0x02,0x30,
0x40,0xf2,0x03,0x10,0x08,0xbf,0x4f,0xf4,0x81,0x70,0x10,0xbd,0x40,0xf2,0x01,0x10,
0xfb,0xe7,0x00,0xbf,0xf0,0x07,0x00,0x20,0x02,0x4b,0x03,0x4a,0x1a,0x60,0x01,0x32,
0x5a,0x61,0xfe,0xe7,0xe4,0x1b,0x00,0x20,0xb1,0xbb,0xaa,0xaa,0x10,0xb5,0x01,0x00,
0x00,0x23,0x00,0x22,0x00,0x20,0x00,0xf0,0xf7,0xf8,0x10,0xbc,0x02,0xbc,0x08,0x47,
0x10,0xb5,0x00,0x21,0x04,0x00,0x00,0xf0,0x35,0xf9,0x05,0x4b,0x18,0x68,0xc3,0x6b,
0x00,0x2b,0x01,0xd0,0x00,0xf0,0x06,0xf8,0x20,0x00,0xff,0xf7,0xb7,0xff,0xc0,0x46,
0xe8,0x07,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,0x8f,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,0x6e,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,0x0f,0x2a,0x3a,0xd9,0x0d,0x00,
0x05,0x43,0x0c,0x00,0x03,0x00,0xad,0x07,0x38,0xd1,0x10,0x27,0x15,0x00,0xbc,0x46,
0x10,0x3d,0x2d,0x09,0x2e,0x01,0x36,0x18,0xb4,0x44,0x27,0x68,0x66,0x68,0x1f,0x60,
0x5e,0x60,0xa7,0x68,0xe6,0x68,0x9f,0x60,0xde,0x60,0x10,0x33,0x10,0x34,0x63,0x45,
0xf3,0xd1,0x0f,0x24,0x01,0x35,0x2d,0x01,0x49,0x19,0x14,0x40,0x45,0x19,0x03,0x2c,
0x1e,0xd9,0x00,0x23,0xce,0x58,0xee,0x50,0x04,0x33,0xe6,0x1a,0x03,0x2e,0xf9,0xd8,
0x03,0x23,0x04,0x3c,0xa4,0x08,0x01,0x34,0xa4,0x00,0x2d,0x19,0x09,0x19,0x1a,0x40,
0x05,0xd0,0x00,0x23,0xcc,0x5c,0xec,0x54,0x01,0x33,0x93,0x42,0xfa,0xd1,0xf0,0xbc,
0x02,0xbc,0x08,0x47,0x05,0x00,0x00,0x2a,0xf3,0xd1,0xf8,0xe7,0x05,0x00,0xf0,0xe7,
0x22,0x00,0xf8,0xe7,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,
0xe8,0x07,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,0xe8,0x07,0x00,0x20,
0x10,0x47,0xc0,0x46,0x04,0x4b,0x10,0xb5,0x00,0x2b,0x02,0xd0,0x03,0x48,0xff,0xf7,
0x4d,0xfe,0x10,0xbc,0x01,0xbc,0x00,0x47,0x00,0x00,0x00,0x00,0x89,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,0x18,0xf9,0xff,0x7f,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x20,0x00,0x00,0x00,0x00,
0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x20,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xec,0x0a,0x00,0x20,0x54,0x0b,0x00,0x20,0xbc,0x0b,0x00,0x20,
0xb1,0xbb,0xaa,0xaa,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,0xab,0xff,0xc0,0x46,0xa0,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,0xa0,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,0xa0,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,0xd1,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,0x5c,0xfa,0xff,0x7f,0x01,0x00,0x00,0x00,
0xb8,0x06,0x00,0x20,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xb8,0x06,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa4,0x09,0x00,0x20,
0x0c,0x0a,0x00,0x20,0x74,0x0a,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,0x00,0x00,0x00,0x00,
@@ -137,8 +117,8 @@
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,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0e,0x33,0xcd,0xab,0x34,0x12,0x6d,0xe6,0xec,0xde,0x05,0x00,0x0b,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x33,0xcd,0xab,0x34,0x12,0x6d,0xe6,
0xec,0xde,0x05,0x00,0x0b,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -193,8 +173,28 @@
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,0x00,0x00,0x00,0x00,0xc9,0x00,0x00,0x20,0x99,0x00,0x00,0x20,
0xa5,0x07,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xc9,0x00,0x00,0x20,0x99,0x00,0x00,0x20,0x61,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,
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,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,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,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,
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,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,


+ 18
- 13
contrib/loaders/flash/cc2538/flash.c View File

@@ -51,23 +51,28 @@ struct rom_api {

extern uint32_t flash_sector_erase(uint32_t sector_address)
{
*(uint32_t *)0x20001be4 = 0xeeeefff1;
*(uint32_t *)0x20001bf8 = 0xeeeefff2;
for (;;)
continue;

}

extern uint32_t flash_bank_erase(void)
{
long ret = ROM->PageErase(FLASHMEM_BASE, ROM->GetFlashSize());
if (ret == 0)
return 0;
long ret;
ret = ROM->PageErase(sector_address, FLASH_ERASE_SIZE);
if (ret == -1)
return 0x101;
if (ret == -2)
return 0x102;
return 0x103;
if (ret != 0)
return 0x103;
return 0;
}

extern uint32_t flash_bank_erase(void)
{
int i;
long ret;
for (i = 0; i < ROM->GetFlashSize() / FLASH_ERASE_SIZE; i++)
{
ret = flash_sector_erase(flash_sector_to_address(i));
if (ret != 0)
return ret;
}
return 0;
}

extern uint32_t flash_program(uint8_t *data_buffer, uint32_t address,


+ 8
- 0
contrib/loaders/flash/cc2538/flash.h View File

@@ -50,4 +50,12 @@ extern uint32_t flash_bank_erase(void);
extern uint32_t flash_program(uint8_t *data_buffer, uint32_t address,
uint32_t count);

static inline uint32_t flash_address_to_sector(uint32_t address) {
return ((address - FLASHMEM_BASE) / FLASH_ERASE_SIZE);
};

static inline uint32_t flash_sector_to_address(uint32_t sector) {
return ((sector * FLASH_ERASE_SIZE) + FLASHMEM_BASE);
};

#endif /* #ifndef OPENOCD_LOADERS_FLASH_CC2538_FLASH_H */

+ 3
- 71
contrib/loaders/flash/cc2538/flashloader.c View File

@@ -57,74 +57,6 @@ uint32_t flashloader_init(struct flash_params *params, uint8_t *buf1,
return STATUS_OK;
}

uint32_t flashloader_erase_and_program(uint8_t *src, uint32_t address,
uint32_t byte_count)
{
if (byte_count > BUFFER_LEN)
return STATUS_FAILED_INVALID_ARGUMENTS;

/* Erase affected sectors */
uint32_t status = flashloader_erase_sectors(address, byte_count);

if (status != STATUS_OK)
return status;

/* Program data */
status = flashloader_program(src, address, byte_count);

return status;
}

uint32_t flashloader_program_with_retain(uint8_t *src, uint32_t address,
uint32_t byte_count)
{
#if (BUFFER_LEN > FLASH_ERASE_SIZE)
#error Buffer size cannot be larger than the flash sector size!
#endif

uint32_t first_sector_idx;
uint32_t last_sector_idx;
uint32_t status = STATUS_OK;
uint32_t i;

first_sector_idx = flashloader_address_to_sector(address);
last_sector_idx = flashloader_address_to_sector(address + byte_count - 1);

/* Mark all sectors as "not erased" before starting */
memset(g_is_erased, false, sizeof(g_is_erased));

uint32_t sec_offset = address % FLASH_ERASE_SIZE;
uint32_t curr_count;
uint32_t src_offset = 0;

for (i = first_sector_idx; i <= last_sector_idx; i++) {

/* Chop off at sector boundary if data goes into the next sector. */
curr_count = byte_count;
if ((address + byte_count) > ((i+1) * FLASH_ERASE_SIZE))
curr_count -= (address + byte_count) % FLASH_ERASE_SIZE;

/* Copy flash sector to retain buffer */
memcpy(g_retain_buf, (void *)(i * FLASH_ERASE_SIZE), FLASH_ERASE_SIZE);

/* Copy data buffer to retain buffer */
memcpy(&g_retain_buf[sec_offset], &src[src_offset], curr_count);

/* Erase and program from retain buffer */
status = flashloader_erase_and_program(g_retain_buf,
(i * FLASH_ERASE_SIZE), FLASH_ERASE_SIZE);
if (status != STATUS_OK)
return status;

address += curr_count;
sec_offset = address % FLASH_ERASE_SIZE;
byte_count -= curr_count;
src_offset += curr_count;
}

return status;
}

uint32_t flashloader_erase_all(void)
{
if (flash_bank_erase() != 0)
@@ -143,15 +75,15 @@ uint32_t flashloader_erase_sectors(uint32_t address, uint32_t byte_count)
uint32_t idx;

/* Floor address to the start of the sector and convert to sector number */
first_sector_idx = flashloader_address_to_sector(address);
last_sector_idx = flashloader_address_to_sector(address + byte_count - 1);
first_sector_idx = flash_address_to_sector(address);
last_sector_idx = flash_address_to_sector(address + byte_count - 1);

/* Erase given sector(s) */
for (idx = first_sector_idx; idx <= last_sector_idx; idx++) {

/* Only erase sectors that haven't already been erased */
if (g_is_erased[idx] == false) {
status = flash_sector_erase(idx * FLASH_ERASE_SIZE);
status = flash_sector_erase(flash_sector_to_address(idx));
if (status != 0) {
status = (STATUS_FAILED_SECTOR_ERASE |
((idx << STATUS_EXT_INFO_S) & STATUS_EXT_INFO_M) |


+ 0
- 12
contrib/loaders/flash/cc2538/flashloader.h View File

@@ -140,16 +140,4 @@ extern uint32_t flashloader_erase_sectors(uint32_t start_addr,
extern uint32_t flashloader_program(uint8_t *src, uint32_t address,
uint32_t byte_count);

/*
* Convert the input address into a sector number.
*
* address The address.
*
* Returns the flash sector which the address resides in. The first sector
* is sector 0.
*
*/
static inline uint32_t flashloader_address_to_sector(uint32_t address)
{ return (address / FLASH_ERASE_SIZE); };

#endif /* #ifndef OPENOCD_LOADERS_FLASH_CC2538_FLASHLOADER_H */

Loading…
Cancel
Save