Hi,

Flash control register numbers are changed in 54XX, it causing all code
using FCTLx to immediate reboot on 54XX.

There is the patch (tested on 5418):

>>>>>

--- /opt/mspgcc/msp430/include/msp430/flash.h   2009-06-22
14:41:13.000000000 +0400
+++ msp430/flash.h      2009-07-03 10:45:49.000000000 +0400
@@ -16,6 +16,8 @@
 __MSP430_HAS_FLASH2__
 */
 
+#if !defined(__MSP430X2__)
+
 #define FCTL1_              0x0128  /* FLASH Control 1 */
 sfrw (FCTL1,FCTL1_);
 #define FCTL2_              0x012A  /* FLASH Control 2 */
@@ -23,6 +25,21 @@ sfrw (FCTL2,FCTL2_);
 #define FCTL3_              0x012C  /* FLASH Control 3 */
 sfrw (FCTL3,FCTL3_);
 
+#else
+
+#define FCTL1_              0x0140  /* FLASH Control 1 */
+#define FCTL2_              0x0142  /* FLASH Control 2 */
+#define FCTL3_              0x0144  /* FLASH Control 3 */
+#define FCTL4_              0x0146  /* FLASH Control 4 */
+
+sfrw (FCTL1,FCTL1_);
+sfrw (FCTL2,FCTL2_);
+sfrw (FCTL3,FCTL3_);
+sfrw (FCTL4,FCTL4_);
+
+#endif
+
+
 #define FRKEY               0x9600  /* Flash key returned by read */
 #define FWKEY               0xA500  /* Flash key for write */
 #define FXKEY               0x3300  /* for use with XOR instruction */

<<<<<



Reply via email to