Skip to content
Permalink
Browse files

sync: from 3f38ad5a

WiFi:
1. add set wpa2 enterprise identity API;
2. add an example for wpa2 enterprise;

System:
1. add flash erase protect feature;
  • Loading branch information...
wujiangang committed Jun 15, 2017
1 parent cba173c commit 10138bdc0e37e4c364401de70e9ac402a1c3de55
Showing with 1,472 additions and 0 deletions.
  1. +6 −0 VERSION
  2. +122 −0 examples/wpa2_enterprise/Makefile
  3. +147 −0 examples/wpa2_enterprise/gen_misc.bat
  4. +165 −0 examples/wpa2_enterprise/gen_misc.sh
  5. +29 −0 examples/wpa2_enterprise/include/user_config.h
  6. +89 −0 examples/wpa2_enterprise/include/wpa2_pki/ca.h
  7. BIN examples/wpa2_enterprise/include/wpa2_pki/certs/ca.der
  8. +16 −0 examples/wpa2_enterprise/include/wpa2_pki/certs/ca.key
  9. +23 −0 examples/wpa2_enterprise/include/wpa2_pki/certs/ca.pem
  10. +70 −0 examples/wpa2_enterprise/include/wpa2_pki/certs/client.crt
  11. +27 −0 examples/wpa2_enterprise/include/wpa2_pki/certs/client.key
  12. BIN examples/wpa2_enterprise/include/wpa2_pki/certs/client.p12
  13. +57 −0 examples/wpa2_enterprise/include/wpa2_pki/certs/client.pem
  14. +5 −0 examples/wpa2_enterprise/include/wpa2_pki/certs/dh
  15. +70 −0 examples/wpa2_enterprise/include/wpa2_pki/certs/server.crt
  16. +27 −0 examples/wpa2_enterprise/include/wpa2_pki/certs/server.key
  17. BIN examples/wpa2_enterprise/include/wpa2_pki/certs/server.p12
  18. +57 −0 examples/wpa2_enterprise/include/wpa2_pki/certs/server.pem
  19. +237 −0 examples/wpa2_enterprise/include/wpa2_pki/client_crt.h
  20. +106 −0 examples/wpa2_enterprise/include/wpa2_pki/client_key.h
  21. +23 −0 examples/wpa2_enterprise/include/wpa2_pki/import_ca_crt_key.sh
  22. BIN examples/wpa2_enterprise/include/wpa2_pki/str2hex
  23. +45 −0 examples/wpa2_enterprise/user/Makefile
  24. +145 −0 examples/wpa2_enterprise/user/user_main.c
  25. +3 −0 include/spi_flash.h
  26. +3 −0 include/wpa2_enterprise.h
  27. BIN lib/libmain.a
  28. BIN lib/libwpa2.a
@@ -0,0 +1,6 @@
gwen:
main: 4a953ba
wpa2: 4a953ba

gitlab:
driver: 68fc7b06
@@ -0,0 +1,122 @@
#############################################################
# Required variables for each makefile
# Discard this section from all parent makefiles
# Expected variables (with automatic defaults):
# CSRCS (all "C" files in the dir)
# SUBDIRS (all subdirs with a Makefile)
# GEN_LIBS - list of libs to be generated ()
# GEN_IMAGES - list of object file images to be generated ()
# GEN_BINS - list of binaries to be generated ()
# COMPONENTS_xxx - a list of libs/objs in the form
# subdir/lib to be extracted and rolled up into
# a generated lib/image xxx.a ()
#
TARGET = eagle
#FLAVOR = release
FLAVOR = debug

#EXTRA_CCFLAGS += -u

ifndef PDIR # {
GEN_IMAGES= eagle.app.v6.out
GEN_BINS= eagle.app.v6.bin
SPECIAL_MKTARGETS=$(APP_MKTARGETS)
SUBDIRS= \
user \

endif # } PDIR

APPDIR = .
LDDIR = ../ld

CCFLAGS += -Os

TARGET_LDFLAGS = \
-nostdlib \
-Wl,-EL \
--longcalls \
--text-section-literals

ifeq ($(FLAVOR),debug)
TARGET_LDFLAGS += -g -O2
endif

ifeq ($(FLAVOR),release)
TARGET_LDFLAGS += -g -O0
endif

COMPONENTS_eagle.app.v6 = \
user/libuser.a \

LINKFLAGS_eagle.app.v6 = \
-L../lib \
-nostdlib \
-T$(LD_FILE) \
-Wl,--no-check-sections \
-Wl,--gc-sections \
-u call_user_start \
-Wl,-static \
-Wl,--start-group \
-lc \
-lgcc \
-lhal \
-lphy \
-lpp \
-lnet80211 \
-llwip \
-lwpa \
-lmain \
-lwps \
-lwpa2 \
-lcrypto \
$(DEP_LIBS_eagle.app.v6) \
-Wl,--end-group

DEPENDS_eagle.app.v6 = \
$(LD_FILE) \
$(LDDIR)/eagle.rom.addr.v6.ld

#############################################################
# Configuration i.e. compile options etc.
# Target specific stuff (defines etc.) goes in here!
# Generally values applying to a tree are captured in the
# makefile at its root level - these are then overridden
# for a subtree within the makefile rooted therein
#

#UNIVERSAL_TARGET_DEFINES = \
# Other potential configuration flags include:
# -DTXRX_TXBUF_DEBUG
# -DTXRX_RXBUF_DEBUG
# -DWLAN_CONFIG_CCX
CONFIGURATION_DEFINES = -DICACHE_FLASH

DEFINES += \
$(UNIVERSAL_TARGET_DEFINES) \
$(CONFIGURATION_DEFINES)

DDEFINES += \
$(UNIVERSAL_TARGET_DEFINES) \
$(CONFIGURATION_DEFINES)


#############################################################
# Recursion Magic - Don't touch this!!
#
# Each subtree potentially has an include directory
# corresponding to the common APIs applicable to modules
# rooted at that subtree. Accordingly, the INCLUDE PATH
# of a module can only contain the include directories up
# its parent path, and not its siblings
#
# Required for each makefile to inherit from the parent
#

INCLUDES := $(INCLUDES) -I $(PDIR)include
PDIR := ../$(PDIR)
sinclude $(PDIR)Makefile

.PHONY: FORCE
FORCE:

@@ -0,0 +1,147 @@
@echo off

echo gen_misc.bat version 20150511
echo .

echo Please follow below steps(1-5) to generate specific bin(s):
echo STEP 1: choose boot version(0=boot_v1.1, 1=boot_v1.2+, 2=none)
set input=default
set /p input=enter(0/1/2, default 2):

if %input% equ 0 (
set boot=old
) else (
if %input% equ 1 (
set boot=new
) else (
set boot=none
)
)

echo boot mode: %boot%
echo.

echo STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
set input=default
set /p input=enter (0/1/2, default 0):

if %input% equ 1 (
if %boot% equ none (
set app=0
echo choose no boot before
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
) else (
set app=1
echo generate bin: user1.bin
)
) else (
if %input% equ 2 (
if %boot% equ none (
set app=0
echo choose no boot before
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
) else (
set app=2
echo generate bin: user2.bin
)
) else (
if %boot% neq none (
set boot=none
echo ignore boot
)
set app=0
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
))

echo.

echo STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)
set input=default
set /p input=enter (0/1/2/3, default 2):

if %input% equ 0 (
set spi_speed=20
) else (
if %input% equ 1 (
set spi_speed=26.7
) else (
if %input% equ 3 (
set spi_speed=80
) else (
set spi_speed=40
)))

echo spi speed: %spi_speed% MHz
echo.

echo STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
set input=default
set /p input=enter (0/1/2/3, default 0):

if %input% equ 1 (
set spi_mode=QOUT
) else (
if %input% equ 2 (
set spi_mode=DIO
) else (
if %input% equ 3 (
set spi_mode=DOUT
) else (
set spi_mode=QIO
)))

echo spi mode: %spi_mode%
echo.

echo STEP 5: choose flash size and map
echo 0= 512KB( 256KB+ 256KB)
echo 2=1024KB( 512KB+ 512KB)
echo 3=2048KB( 512KB+ 512KB)
echo 4=4096KB( 512KB+ 512KB)
echo 5=2048KB(1024KB+1024KB)
echo 6=4096KB(1024KB+1024KB)
set input=default
set /p input=enter (0/1/2/3/4/5/6, default 0):

if %input% equ 2 (
set spi_size_map=2
echo spi size: 1024KB
echo spi ota map: 512KB + 512KB
) else (
if %input% equ 3 (
set spi_size_map=3
echo spi size: 2048KB
echo spi ota map: 512KB + 512KB
) else (
if %input% equ 4 (
set spi_size_map=4
echo spi size: 4096KB
echo spi ota map: 512KB + 512KB
) else (
if %input% equ 5 (
set spi_size_map=5
echo spi size: 2048KB
echo spi ota map: 1024KB + 1024KB
) else (
if %input% equ 6 (
set spi_size_map=6
echo spi size: 4096KB
echo spi ota map: 1024KB + 1024KB
) else (
set spi_size_map=0
echo spi size: 512KB
echo spi ota map: 256KB + 256KB
)
)
)
)
)

touch user/user_main.c

echo.
echo start...
echo.

make BOOT=%boot% APP=%app% SPI_SPEED=%spi_speed% SPI_MODE=%spi_mode% SPI_SIZE=%spi_size_map%

0 comments on commit 10138bd

Please sign in to comment.
You can’t perform that action at this time.