CVS: jtag/funclets counter.S,1.3,1.4 counterplus.S,1.1,1.2 eraseFlash.S,1.6,1.7 eraseFlashSegment.S,1.3,1.4 progFlash.S,1.4,1.5
Chris Liechti <[email protected]>
| Newsgroups | gmane.comp.hardware.texas-instruments.msp430.gcc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mspgcc/jtag/funclets
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1839/jtag/funclets
Modified Files:
counter.S counterplus.S eraseFlash.S eraseFlashSegment.S
progFlash.S
Log Message:
- unify result value passing -> use registers, not CCR0
- update comments
Index: counter.S
===================================================================
RCS file: /cvsroot/mspgcc/jtag/funclets/counter.S,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- counter.S 29 Dec 2005 14:00:30 -0000 1.3
+++ counter.S 30 Dec 2005 03:30:50 -0000 1.4
@@ -11,9 +11,13 @@
msp430-jtag --result=rall --timeout=0.1 --funclet counter.a43
-This programm must be linked specialy so that it's placed in the RAM.
+Notes:
+- The funclet arguments can be used to setup the clock speed
+- see getDCOFreq() in CVS/jtag/msp430/funclets.c
+
+This program must be linked specialy so that it's placed in the RAM.
(see makefile).
-The first six bytes and its contents are mandatory. Also must the funclet
+The first six bytes and their content is mandatory. Also must the funclet
end with a "jmp $" instruction.
chris <[email protected]>
Index: counterplus.S
===================================================================
RCS file: /cvsroot/mspgcc/jtag/funclets/counterplus.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- counterplus.S 27 Dec 2005 13:37:11 -0000 1.1
+++ counterplus.S 30 Dec 2005 03:30:50 -0000 1.2
@@ -11,9 +11,13 @@
msp430-jtag --result=rall --timeout=0.1 --funclet counterplus.a43
-This programm must be linked specialy so that it's placed in the RAM.
+Notes:
+- The funclet arguments can be used to setup the clock speed
+- see getDCOPlusFreq() in CVS/jtag/msp430/funclets.c
+
+This program must be linked specialy so that it's placed in the RAM.
(see makefile).
-The first six bytes and its contents are mandatory. Also must the funclet
+The first six bytes and their content is mandatory. Also must the funclet
end with a "jmp $" instruction.
chris <[email protected]>
Index: eraseFlash.S
===================================================================
RCS file: /cvsroot/mspgcc/jtag/funclets/eraseFlash.S,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -d -r1.6 -r1.7
--- eraseFlash.S 28 Dec 2005 18:20:10 -0000 1.6
+++ eraseFlash.S 30 Dec 2005 03:30:50 -0000 1.7
@@ -1,13 +1,20 @@
-
/* Flash erase funclet to be used with MSP430mspgcc.dll/so.
+This funclet is used for MASS and MAIN erase modes.
+
Three arguments must be supplied in RAM:
-srinit: initial value for SR, used to switch of DCO+
-type: value for FCTL1, which selects MASS, MAIN or single segment erase
-addr: an address within the segment to be erased1
+srinit: initial value for SR, used to switch of FLL+
+type: value for FCTL1, which selects MASS or MAIN erase
+addr: an address within the segment to be erased
Notes:
+- The system clock has to be set to: 1.41MHz < MCLK < 2.14MHz
- SegmentA in F2xx devices is not erased
+
+This program must be linked specialy so that it's placed in the RAM.
+(see makefile).
+The first six bytes and their content is mandatory. Also must the funclet
+end with a "jmp $" instruction.
*/
#include <io.h>
Index: eraseFlashSegment.S
===================================================================
RCS file: /cvsroot/mspgcc/jtag/funclets/eraseFlashSegment.S,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- eraseFlashSegment.S 28 Dec 2005 18:20:13 -0000 1.3
+++ eraseFlashSegment.S 30 Dec 2005 03:30:50 -0000 1.4
@@ -1,15 +1,23 @@
/* Flash erase funclet to be used with MSP430mspgcc.dll/so.
+This funclet is used to erase single segemnts.
+
Three arguments must be supplied in RAM:
-srinit: initial value for SR, used to switch of DCO+
-type: value for FCTL1, which selects MASS, MAIN or single segment erase
+srinit: initial value for SR, used to switch of FLL+
+type: value for FCTL1, which selects segment erase
addr: an address within the segment to be erased
Notes:
+- The system clock has to be set to: 1.41MHz < MCLK < 2.14MHz
- SegmentA in F2xx devices is unlocked and erased if target address is within
that segment. It is locked again at the end.
- SegmentA lock code is also executed on F1xx/F4xx devices. Should be no
- problem with the currently availabe devices.
+ problem with the currently available devices.
+
+This program must be linked specialy so that it's placed in the RAM.
+(see makefile).
+The first six bytes and their content is mandatory. Also must the funclet
+end with a "jmp $" instruction.
*/
#include <io.h>
@@ -41,7 +49,7 @@
; SegmentA is unlocked
.LAgain:mov type, &FCTL1 ; Load FCTL1 value. MUST CONTAIN PASSWORD.
- mov addr, r10 ; Load (page) address to erase.
+ mov addr, r10 ; Load (segment) address to erase.
mov #0xffff, 0(r10) ; Write data into the address (to erase the FLASH).
mov #(2*4820)/3+1, r10 ; Delay for FLASH to erase (BUSY does not work on older devices).
.LWait: dec r10 ; Loop requires 3 clock cycles.
Index: progFlash.S
===================================================================
RCS file: /cvsroot/mspgcc/jtag/funclets/progFlash.S,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- progFlash.S 28 Dec 2005 18:20:13 -0000 1.4
+++ progFlash.S 30 Dec 2005 03:30:50 -0000 1.5
@@ -1,10 +1,19 @@
/* Flash programming funclet to be used with MSP430mspgcc.dll/so.
-The data to be programmed is appended to this code by the download
-library. Three arguments must be supplied in RAM:
-srinit: initial value for SR, used to switch of DCO+
-addr: starting address in flash, where the programmin begins
-length: length of the data block that is written to the flash
+The data to be programmed is appended to this code by the download library.
+
+Three arguments must be supplied in RAM:
+srinit: initial value for SR, used to switch of FLL+
+addr: starting address in flash, where the programming begins
+length: length of the data block that is written to the flash (number of words)
+
+Notes:
+- The system clock has to be set to: 1.41MHz < MCLK < 2.14MHz
+
+This program must be linked specialy so that it's placed in the RAM.
+(see makefile).
+The first six bytes and their content is mandatory. Also must the funclet
+end with a "jmp $" instruction.
*/
#include <io.h>
@@ -21,7 +30,7 @@
main: mov #WDTPW|WDTHOLD, &WDTCTL ; Disable Watchdog.
dint ; Disable interrupts.
mov srinit, r2 ; Initialize status register (Possibly disable FLL+).
- mov #0xffff, &CCR0 ; CCR is used as return value -> error
+ mov #0xffff, r15 ; R15 is used as return value -> error
mov #FWKEY|0x44, &FCTL2 ; Source = MCLK, DIV = 5.
mov #FWKEY, &FCTL3 ; Clear bits.
mov addr, r9 ; Address to program.
@@ -41,7 +50,7 @@
incd r9 ; Advance destination pointer.
dec r8 ; Decrement word counter.
jnz .LProg ; Program Length words.
- clr &CCR0 ; set return value -> OK
+ clr R15 ; set return value -> OK
stop: jmp stop ; Wait here until detected by driver.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click