Skip to content

Commit 3e0ab90

Browse files
committed
Added Lab24. USB, TCP/IP and TFTP bootloader.
1 parent 8088975 commit 3e0ab90

File tree

199 files changed

+80032
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+80032
-0
lines changed

Lab12 Animation/applications/console/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
##
1010
CP = cp
1111
RM = rm
12+
LN = ln
1213
C = arm-none-eabi-gcc
1314
CC = arm-none-eabi-gcc
1415
CPP = arm-none-eabi-gcc
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
#
2+
# Makefile for console application
3+
#
4+
#
5+
#
6+
7+
##
8+
## Commands:
9+
##
10+
CP = cp
11+
RM = rm
12+
LN = ln
13+
C = arm-none-eabi-gcc
14+
CC = arm-none-eabi-gcc
15+
CPP = arm-none-eabi-gcc
16+
AR = arm-none-eabi-ar
17+
AS = arm-none-eabi-as
18+
LINK = arm-none-eabi-ld
19+
PLINK = arm-none-eabi-objcopy
20+
21+
##
22+
## Definitions:
23+
##
24+
APPNAME = console
25+
26+
# Define the RPI hardware version: 1 is up to B+, 2 is 2, 3 is up to 3 B+
27+
# For TCP/IP debugging define -DLWIP_DEBUG
28+
EXTRAS = -DRPI=3 -ffreestanding
29+
# Begin Historic/Depricated/Older GCC
30+
#RPI 3 B+
31+
#EXTRAS = -DRPI=3 -march=armv8-a+crc -mtune=cortex-a53 -ffreestanding
32+
#RPI 2
33+
#EXTRAS = -DRPI=2 -march=armv7-a -mtune=cortex-a7 -ffreestanding
34+
#RPI B+
35+
#EXTRAS = -DRPI=1 -mcpu=arm1176jzf-s -ffreestanding
36+
# End Historic/Depricated/Older GCC
37+
38+
##Warnings about everything and optimize for size or speed (-Os or -O2)
39+
CFLAGS = -Wall -O2 $(EXTRAS)
40+
##Debugging build below, GDB and no optimizations (-O0)
41+
#CFLAGS = -Wall -ggdb -O0 $(EXTRAS)
42+
43+
ASFLAGS =
44+
##RPI 3
45+
#ASFLAGS = -mfpu=neon-fp-armv8 -mfloat-abi=hard
46+
##RPI 2
47+
#ASFLAGS = -mfpu=neon-vfpv4 -mfloat-abi=hard
48+
##RPI B+
49+
#ASFLAGS = -mcpu=arm1176jzf-s
50+
INCLUDES = -I. -I../../include -I../../boards/rpi \
51+
-I../../include/network -I../../include/network/lwip \
52+
-I../../include/network/ipv4 \
53+
-I../../boards/peripherals
54+
55+
##
56+
## Console application
57+
##
58+
59+
# Use app.o for normal application, loader.o for bootloader
60+
#APP = ../../boards/rpi/app.o \
61+
#APP = ../../boards/rpi/loader.o \
62+
63+
APP = ../../boards/rpi/app.o \
64+
../../boards/rpi/board.o \
65+
../../boards/rpi/framebuffer.o \
66+
../../boards/rpi/property.o \
67+
../../boards/peripherals/dwc/host.o \
68+
../../boards/peripherals/dwc/transfer.o \
69+
../../boards/peripherals/ethernet/lan95xx.o \
70+
../../boards/peripherals/ethernet/lan78xx.o \
71+
../../boards/peripherals/uart/16550.o \
72+
../../boards/peripherals/uart/16C650.o \
73+
../../system/character.o \
74+
../../system/console.o \
75+
../../system/os.o \
76+
../../system/malloc.o \
77+
../../system/assert.o \
78+
../../system/printf.o \
79+
../../system/rand.o \
80+
../../system/screen.o \
81+
../../system/string.o \
82+
../../system/stdio.o \
83+
../../system/shell.o \
84+
../../system/timers.o \
85+
../../system/xmodem.o \
86+
../../usb/device.o \
87+
../../usb/endpoint.o \
88+
../../usb/hub.o \
89+
../../usb/keyboard.o \
90+
../../usb/mouse.o \
91+
../../usb/request.o \
92+
../../usb/rootport.o \
93+
../../network/core/ipv4/autoip.o \
94+
../../network/core/ipv4/icmp.o \
95+
../../network/core/ipv4/igmp.o \
96+
../../network/core/ipv4/inet.o \
97+
../../network/core/ipv4/inet_chksum.o \
98+
../../network/core/ipv4/ip.o \
99+
../../network/core/ipv4/ip_addr.o \
100+
../../network/core/ipv4/ip_frag.o \
101+
../../network/core/def.o \
102+
../../network/core/dhcp.o \
103+
../../network/core/dns.o \
104+
../../network/core/init.o \
105+
../../network/core/mem.o \
106+
../../network/core/memp.o \
107+
../../network/core/netif.o \
108+
../../network/core/pbuf.o \
109+
../../network/core/raw.o \
110+
../../network/core/stats.o \
111+
../../network/core/sys.o \
112+
../../network/core/tftp_clnt.o \
113+
../../network/core/tcp.o \
114+
../../network/core/tcp_in.o \
115+
../../network/core/tcp_out.o \
116+
../../network/core/timers.o \
117+
../../network/core/udp.o \
118+
../../network/netif/etharp.o \
119+
../../network/netif/ethernetif.o \
120+
main.o
121+
122+
LIBS =
123+
124+
##
125+
## Implicit Targets
126+
##
127+
.c.o:
128+
$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
129+
130+
.s.o:
131+
$(AS) $(ASFLAGS) $(INCLUDES) -o $@ $<
132+
133+
.cpp.o:
134+
$(CPP) -c $(CFLAGS) $(INCLUDES) -o $@ $<
135+
136+
##
137+
## Targets
138+
##
139+
140+
all: app
141+
142+
app: $(APP)
143+
$(LINK) -Map kernel.map -T ../../boards/rpi/memory.map -o $(APPNAME).elf \
144+
$(APP) $(LIBS)
145+
$(PLINK) $(APPNAME).elf -O binary $(APPNAME).bin
146+
$(CP) $(APPNAME).bin kernel.img
147+
148+
clean:
149+
rm -f $(APP)
150+
rm -f $(APPNAME).bin
151+
rm -f $(APPNAME).elf
152+
rm -f kernel.img
153+
rm -f kernel.map
154+
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*...................................................................*/
2+
/* */
3+
/* Module: configure.h */
4+
/* Version: 2015.0 */
5+
/* Purpose: system configuration declarations */
6+
/* */
7+
/*...................................................................*/
8+
/* */
9+
/* Copyright 2015, Sean Lawless */
10+
/* */
11+
/* ALL RIGHTS RESERVED */
12+
/* */
13+
/* Redistribution and use in source, binary or derived forms, with */
14+
/* or without modification, are permitted provided that the */
15+
/* following conditions are met: */
16+
/* */
17+
/* 1. Redistributions in any form, including but not limited to */
18+
/* source code, binary, or derived works, must include the above */
19+
/* copyright notice, this list of conditions and the following */
20+
/* disclaimer. */
21+
/* */
22+
/* 2. Any change or addition to this copyright notice requires the */
23+
/* prior written permission of the above copyright holder. */
24+
/* */
25+
/* THIS SOFTWARE IS PROVIDED ''AS IS''. ANY EXPRESS OR IMPLIED */
26+
/* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES */
27+
/* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
28+
/* DISCLAIMED. IN NO EVENT SHALL ANY AUTHOR AND/OR COPYRIGHT HOLDER */
29+
/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */
30+
/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31+
/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
32+
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
33+
/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */
34+
/* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */
35+
/* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
36+
/* POSSIBILITY OF SUCH DAMAGE. */
37+
/*...................................................................*/
38+
#ifndef _CONFIGURE_H
39+
#define _CONFIGURE_H
40+
41+
/*...................................................................*/
42+
/* Configuration */
43+
/*...................................................................*/
44+
#define ENABLE_OS TRUE
45+
#define MAX_TASKS (10 + ENABLE_UART0 + ENABLE_UART1 + \
46+
ENABLE_VIDEO)
47+
#define ENABLE_SHELL TRUE
48+
#define ENABLE_UART0 TRUE /* enable primary UART */
49+
#define ENABLE_UART1 FALSE /* enable secondary UART */
50+
#define ENABLE_JTAG TRUE /* enable JTAG debugging */
51+
#define ENABLE_VIDEO TRUE /* enable video console */
52+
#define PIXEL_WIDTH 0 /* zero to auto-detect */
53+
#define PIXEL_HEIGHT 0 /* zero to auto-detect */
54+
#define COLOR_DEPTH_BITS 16 /* color depth in bits, 32 or 16 */
55+
#define CONSOLE_X_DIVISOR 1 /* fractional screen, 1 is full */
56+
#define CONSOLE_Y_DIVISOR 1 /* fractional screen, 1 is full */
57+
#define CONSOLE_X_ORIENTATION 0 /* in number of characters */
58+
#define CONSOLE_Y_ORIENTATION 0 /* in number of lines */
59+
#define ENABLE_USB TRUE /* enable Universtal Serial Bus Host */
60+
#define ENABLE_XMODEM TRUE /* enable xmodem receiver */
61+
#define ENABLE_BOOTLOADER FALSE /* enable boot loader */
62+
#define MAX_BOOT_LENGTH (1024 * 1024 * 16) /* 16 MB boot image max */
63+
#define ENABLE_MALLOC TRUE /* enable malloc/free */
64+
#define ENABLE_PRINTF TRUE /* printf arguments */
65+
#define ENABLE_ASSERT (TRUE && ENABLE_PRINTF)/*enable assertions */
66+
#define ENABLE_AUTO_START FALSE /* Auto start enabled devices */
67+
68+
/* USB Specific configuration */
69+
#define ENABLE_USB_HID (TRUE && ENABLE_USB) /* for keyboard/mouse*/
70+
#define ENABLE_USB_ETHER (TRUE && ENABLE_USB) /* enable Ethernet */
71+
#define ENABLE_USB_TASK (FALSE && ENABLE_USB) /* USB intr task */
72+
73+
/* Network configuration */
74+
#define ENABLE_IP4 (TRUE && \ /* Inet Protocol v4 */
75+
ENABLE_MALLOC && ENABLE_ETHER)
76+
#define ENABLE_IP6 (FALSE && \ /* Inet Protocol v6 */
77+
ENABLE_MALLOC && ENABLE_ETHER)
78+
#define ENABLE_UDP (TRUE && (ENABLE_IP4 || ENABLE_IP4))/* UDP */
79+
#define ENABLE_TCP (FALSE && (ENABLE_IP4 || ENABLE_IP4))/* TCP*/
80+
#define ENABLE_DHCP (TRUE && ENABLE_UDP)/* Dynamic IP Discovery*/
81+
#define ENABLE_ICMP (TRUE && ENABLE_IP4)/* Internet Control */
82+
83+
/* DO NOT EDIT BELOW : Derived configurations */
84+
#define ENABLE_ETHER ENABLE_USB_ETHER /* enable Ethernet */
85+
#define ENABLE_NETWORK (ENABLE_ETHER && (ENABLE_IP4 || ENABLE_IP6))
86+
#define MAX_TASKS (10 + ENABLE_UART0 + ENABLE_UART1 + \
87+
ENABLE_VIDEO + ENABLE_USB_TASK + \
88+
ENABLE_ETHER)
89+
90+
#endif /* _CONFIGURE_H */
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[editor]
2+
line_wrapping=false
3+
line_break_column=72
4+
auto_continue_multiline=true
5+
6+
[file_prefs]
7+
final_new_line=true
8+
ensure_convert_new_lines=true
9+
strip_trailing_spaces=true
10+
replace_tabs=true
11+
12+
[indentation]
13+
indent_width=2
14+
indent_type=0
15+
indent_hard_tab_width=8
16+
detect_indent=false
17+
detect_indent_width=false
18+
indent_mode=2
19+
20+
[project]
21+
name=console
22+
base_path=/home/pi/develop/Lab24 TFTP/applications/console
23+
description=
24+
file_patterns=
25+
26+
[long line marker]
27+
long_line_behaviour=1
28+
long_line_column=72
29+
30+
[files]
31+
current_page=0
32+
33+
[build-menu]
34+
NF_00_LB=_Make
35+
NF_00_CM=make -j4
36+
NF_00_WD=/home/pi/develop/Lab24 TFTP/applications/console
37+
NF_01_LB=Make Custom _Target...
38+
NF_01_CM=make -j4
39+
NF_01_WD=
40+
NF_03_LB=Make Clean
41+
NF_03_CM=make clean
42+
NF_03_WD=/home/pi/develop/Lab24 TFTP/applications/console
43+
CFT_00_LB=_Compile
44+
CFT_00_CM=arm-none-eabi-gcc -Wall -c -O0 -ggdb -DRPI=3 -ffreestanding -I"." -I"../../include" -I"../../boards/rpi" "%f"
45+
CFT_00_WD=
46+
CFT_01_LB=_Build
47+
CFT_01_CM=make
48+
CFT_01_WD=/home/pi/develop/Lab24 TFTP/applications/console
49+
CFT_02_LB=_Clean
50+
CFT_02_CM=make clean
51+
CFT_02_WD=/home/pi/develop/Lab24 TFTP/applications/console
52+
filetypes=C;C++;
53+
NF_02_LB=Make _Object
54+
NF_02_CM=make %e.o
55+
NF_02_WD=
56+
EX_00_LB=_Execute
57+
EX_00_CM=arm-none-eabi-gdb -tui console.elf
58+
EX_00_WD=/home/pi/develop/Lab24 TFTP/applications/console
59+
C++FT_01_LB=_Build
60+
C++FT_01_CM=make -j4
61+
C++FT_01_WD=/home/pi/develop/Lab24 TFTP/applications/console
62+
63+
[VTE]
64+
last_dir=/home/pi

0 commit comments

Comments
 (0)