6 \ TARGET SELECTION ( = the name of \INC\target.pat file without the extension)
7 \ MSP_EXP430FR5739 MSP_EXP430FR5969 MSP_EXP430FR5994 MSP_EXP430FR6989
8 \ MSP_EXP430FR4133 CHIPSTICK_FR2433 MSP_EXP430FR2433 MSP_EXP430FR2355
11 \ from scite editor : copy your target selection in (shift+F8) parameter 1:
13 \ or, from windows explorer:
14 \ drag and drop this file onto SendSourceFileToTarget.bat
15 \ then select your TARGET when asked.
17 \ SYSRSTIV decimal/hex values for MSP430FR5994 (device specific)
18 \ ----------------------------------------------------------
19 \ #00 $00 No interrupt pending
20 \ #02 $02 Brownout (BOR)
21 \ #04 $04 RSTIFG RST/NMI (BOR)
22 \ #06 $06 PMMSWBOR software BOR (BOR)
23 \ #08 $08 LPMx.5 wake up (BOR)
24 \ #10 $0A violation memory protected areas (BOR)
26 \ #14 $0E SVSHIFG SVSH event (BOR)
29 \ #20 $14 PMMSWPOR software POR (POR)
30 \ #22 $16 WDTIFG watchdog timeout (PUC)
31 \ #24 $18 WDTPW password violation (PUC)
32 \ #26 $1A FRCTLPW password violation (PUC)
33 \ #28 $1C Uncorrectable FRAM bit error detection (PUC)
34 \ #30 $1E Peripheral area fetch (PUC)
35 \ #32 $20 PMMPW PMM password violation (PUC)
36 \ #34 $22 MPUPW MPU password violation (PUC)
37 \ #36 $24 CSPW CS password violation (PUC)
38 \ #38 $26 MPUSEGIPIFG encapsulated IP memory segment violation (PUC)
39 \ #40 $28 MPUSEGIIFG information memory segment violation (PUC)
40 \ #42 $2A MPUSEG1IFG segment 1 memory violation (PUC)
41 \ #44 $2C MPUSEG2IFG segment 2 memory violation (PUC)
42 \ #46 $2E MPUSEG3IFG segment 3 memory violation (PUC)
44 \ emulated SYSRSTIV values added by FastForth
45 \ -------------------------------------------
46 \ -n SYS : BOR + Deep Reset --> WARM display #-1
47 \ <SW1+RESET> : BOR + Deep Reset --> WARM display #-1
48 \ SYS : NO PUC --> --> --> WARM display #0
49 \ n SYS (n odd ) : NO PUC --> --> --> WARM display #n (odd)
50 \ n SYS (n even ) : BOR --> --> --> WARM display #n (even)
51 \ <RESET> : BOR --> --> --> WARM display #4
54 \ ------------------------------------------------------------------------------
55 \ When BOOT.4TH is called by the FastForth bootstrap, the SYSRSTIV (hardware or
56 \ emulated value) is on the Top Of paramater Stack -TOS- ready to test.
57 \ ------------------------------------------------------------------------------
58 \ to enable bootstrap: BOOT
59 \ to disable bootstrap: UNBOOT
60 \ ------------------------------------------------------------------------------
64 ; ------------------------------------------------------------------
65 ; first we download the set of definitions we need (from CORE_ANS.f)
66 ; ------------------------------------------------------------------
69 \ https://forth-standard.org/standard/core/DUP
70 \ DUP x -- x x duplicate top of stack
72 BW1 SUB #2,PSP \ 2 push old TOS..
73 MOV TOS,0(PSP) \ 3 ..onto stack
77 \ https://forth-standard.org/standard/core/qDUP
78 \ ?DUP x -- 0 | x x DUP if nonzero
80 CMP #0,TOS \ 2 test for TOS nonzero
87 \ https://forth-standard.org/standard/core/DROP
88 \ DROP x -- drop top of stack
96 \ https://forth-standard.org/standard/core/Equal
97 \ = x1 x2 -- flag test x1=x2
100 SUB #1,TOS \ 1 borrow (clear cy) if TOS was 0
101 SUBC TOS,TOS \ 1 TOS=-1 if borrow was set
107 \ https://forth-standard.org/standard/core/Plus
108 \ + n1/u1 n2/u2 -- n3/u3 add n1+n2
115 [UNDEFINED] EXECUTE [IF]
116 \ https://forth-standard.org/standard/core/EXECUTE
117 \ EXECUTE i*x xt -- j*x execute Forth word at 'xt'
121 MOV @RSP+,PC \ 4 xt --> PC
125 ; --------------------------
126 ; end of definitions we need
127 ; --------------------------
129 ; ------------------------------------------------------------------------------
131 ; ------------------------------------------------------------------------------
132 ; it is not recommended here to compile then execute a definition
133 ; because the risk of crushing thereafter.
134 ; Interpreting mode as below is required:
135 ; ------------------------------------------------------------------------------
137 DUP 6 = \ TOS = SYS value
138 [IF] \ if <RESET> | 6 SYS
140 RST_RET \ remove definitions above
141 LOAD" SD_TEST.4TH" \ load a file to test the SD_Card driver
143 ' SYS $0E + EXECUTE \ TOS2WARM address, does same as n SYS (n odd)