lpc2000: fix LPC810 programming support 43/1843/2
authorNemui Trinomius <nemuisan_kawausogasuki@live.jp>
Fri, 27 Dec 2013 03:25:33 +0000 (12:25 +0900)
committerSpencer Oliver <spen@spen-soft.co.uk>
Sat, 11 Jan 2014 22:19:57 +0000 (22:19 +0000)
IAP commands fail on programming LPC810 because it has only 1kByte of SRAM.
This patch is fixing cmd51_max_buffer suitable size for LPC810,LPC811 and
other LPC1000 series.
Tested on a LPC810,LPC812,LPC11u14,and LPC1114(DIP28).

Change-Id: Iecec9fd963cb63bdff4a7bd3bbf4f8b1a7c60fbd
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/1843
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/flash/nor/lpc2000.c

index c0c7e41ee30cab35c18d92ca1bc218e1386cb079..259b42f1c4b7ab784750c5be2ec75c56afafd875 100644 (file)
  * - 176x (tested with LPC1768)
  *
  * lpc4300 (also available as lpc1800 - alias)
  * - 176x (tested with LPC1768)
  *
  * lpc4300 (also available as lpc1800 - alias)
- * - 43x2 | 3 | 5 | 7 (tested with 4337)
+ * - 43x2 | 3 | 5 | 7 (tested with LPC4337/LPC4357)
  * - 18x2 | 3 | 5 | 7
  *
  * lpc800:
  * - 18x2 | 3 | 5 | 7
  *
  * lpc800:
- * - 810 | 1 | 2 (tested with 812)
+ * - 810 | 1 | 2 (tested with LPC810/LPC812)
  */
 
 typedef enum {
  */
 
 typedef enum {
@@ -230,15 +230,15 @@ static int lpc2000_build_sector_list(struct flash_bank *bank)
        } else if (lpc2000_info->variant == lpc1700) {
                switch (bank->size) {
                        case 4 * 1024:
        } else if (lpc2000_info->variant == lpc1700) {
                switch (bank->size) {
                        case 4 * 1024:
-                               lpc2000_info->cmd51_max_buffer = 1024;
+                               lpc2000_info->cmd51_max_buffer = 256;
                                bank->num_sectors = 1;
                                break;
                        case 8 * 1024:
                                bank->num_sectors = 1;
                                break;
                        case 8 * 1024:
-                               lpc2000_info->cmd51_max_buffer = 1024;
+                               lpc2000_info->cmd51_max_buffer = 512;
                                bank->num_sectors = 2;
                                break;
                        case 16 * 1024:
                                bank->num_sectors = 2;
                                break;
                        case 16 * 1024:
-                               lpc2000_info->cmd51_max_buffer = 1024;
+                               lpc2000_info->cmd51_max_buffer = 512;
                                bank->num_sectors = 4;
                                break;
                        case 32 * 1024:
                                bank->num_sectors = 4;
                                break;
                        case 32 * 1024:
@@ -303,9 +303,11 @@ static int lpc2000_build_sector_list(struct flash_bank *bank)
                        lpc2000_info->cmd51_max_buffer = 1024;
                switch (bank->size) {
                        case 4 * 1024:
                        lpc2000_info->cmd51_max_buffer = 1024;
                switch (bank->size) {
                        case 4 * 1024:
+                               lpc2000_info->cmd51_max_buffer = 256;
                                bank->num_sectors = 4;
                                break;
                        case 8 * 1024:
                                bank->num_sectors = 4;
                                break;
                        case 8 * 1024:
+                               lpc2000_info->cmd51_max_buffer = 512;
                                bank->num_sectors = 8;
                                break;
                        case 16 * 1024:
                                bank->num_sectors = 8;
                                break;
                        case 16 * 1024:

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)