Hello
I have made same minor changes to make a better support for flashing a 
pic32mx220f032b chip.
This chip has 3k boot flash, 32k program flash an 8k ram.
Page size is 1k bytes or 256 words.
Row size is 128 bytes or 32 words.

The modifications were made in src/flash/nor/pic32mx.c

The output of diff:

53,56c53,56
< #define PIC32MX_DEVCFG0               0xBFC02FFC
< #define PIC32MX_DEVCFG1               0xBFC02FF8
< #define PIC32MX_DEVCFG2               0xBFC02FF4
< #define PIC32MX_DEVCFG3               0xBFC02FF0
---
 > #define PIC32MX_DEVCFG0               0xBFC00BFC
 > #define PIC32MX_DEVCFG1               0xBFC00BF8
 > #define PIC32MX_DEVCFG2               0xBFC00BF4
 > #define PIC32MX_DEVCFG3               0xBFC00BF0
340c340
<       0x2CD30080,             /* sltiu $s3, $a2, 128 */
---
 >       0x2CD30020,             /* sltiu $s3, $a2, 128----->32 */
346,347c346,347
<       0x24840200,             /* addiu $a0, $a0, 512 */
<       0x24A50200,             /* addiu $a1, $a1, 512 */
---
 >       0x24840080,             /* addiu $a0, $a0, 512 ----->128 */
 >       0x24A50080,             /* addiu $a1, $a1, 512 ----->128*/
349c349
<       0x24C6FF80,             /* addiu $a2, $a2, -128 */
---
 >       0x24C6FFE0,             /* addiu $a2, $a2, -128 ------> -32*/
633c633
<       page_size = 4096;
---
 >       page_size = 1024;
648c648
<               num_pages = (12 * 1024);
---
 >               num_pages = (3 * 1024);
656c656
<                       num_pages = (512 * 1024);
---
 >                       num_pages = (32 * 1024);






In this chip  resolution of the BMX registers (Program/Data RAM) is 1k 
not 2K.

Now programming flash and erasing sectors work ok.

Hope someone is interested in adding support for this kind of chips.

Thanks for your good good work.

Salvador



------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to