-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
153 lines (120 loc) · 3.26 KB
/
README
File metadata and controls
153 lines (120 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
1. building the project
a. add environment variable in ~/.bashrc
export RTT_ROOT=/home/bright/smart-lock/RT-Thread
export RTT_EXEC_PATH=/usr/local/gcc-arm-none-eabi-4_7-2013q1/bin
export RTT_CC=gcc
export RTT_BUILD=debug
b. modify rtconfig.py for compile command and other variable
PROJECT = 'smart_lock'
ARCH='arm'
CPU='cortex-m3'
EXEC_PATH = '/usr/local/gcc-arm-none-eabi-4_7-2013q1/bin'
c. copy bsp/stm32f10x/* to your project root directory
.
├── README
├── RT-Thread
├── Libraries
├── SConscript
├── SConstruct
├── rtconfig.h
├── rtconfig.py
├── yuettak_smart_lock_jlink.cfg
├── yuettak_smart_lock_openjtag.cfg
├── stm32_rom.ld
├── gdb.init
├── stm32f10x_conf.h
├── stm32f10x_it.c
├── stm32f10x_it.h
├── startup.c
├── application.c
├── board.c
├── board.h
├── calibration.c
├── dm9000a.c
├── dm9000a.h
├── enc28j60.c
├── enc28j60.h
├── ili_lcd_general.c
├── ili_lcd_general.h
├── led.c
├── led.h
├── msd.c
├── msd.h
├── rtc.c
├── rtc.h
├── sdcard.c
├── sdcard.h
├── serial.c
├── serial.h
├── ssd1289.c
├── ssd1289.h
├── stm3210c_eval_lcd.c
├── stm3210c_eval_lcd.h
├── stm3210e_eval_lcd.c
├── stm3210e_eval_lcd.h
├── touch.c
├── touch.h
├── usart.c
└── usart.h
d. compile the project for debug and release
for debug:
cd the project root directory
run "scons" and "scons -j 4"
for release:
set environment variable RTT_BUILD=release
cd the project root directory
run "scons" and "scons -j 4"
e. clean the project
run "scons -c"
2. debug and program
a. for program(jlink):
install openocd for debug and enable jlink
link jlink to the board
cd the project root directory
run "
sudo /usr/local/bin/openocd -f yuettak_smart_lock_jlink.cfg
telnet localhost 4444
{
halt
flash write_image erase $PROJECT.elf
reset
}
"
b. for program(openjtag):
install openocd for debug and enable openjtag
link openjtag to the board
cd the project root directory
run "
sudo /usr/local/bin/openocd -f yuettak_smart_lock_openjtag.cfg
telnet localhost 4444
{
newboot
}
"
b. for debug
install openocd for debug and enable openjtag
link openjtag to the board
cd the project root directory
run "
sudo /usr/local/bin/openocd -f yuettak_smart_lock_openjtag.cfg
telnet localhost 4444
{
newboot
}
open emacs and M-x gdb
/home/bright/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin/arm-none-eabi-gdb -i=mi smart_lock.elf -x gdb.init
gdb.init:
{
target remote localhost:3333
monitor init
monitor reset init
monitor sleep 200
monitor flash probe 0
monitor sleep 200
load
monitor reset halt
monitor poll
thbreak main
continue
}
"