Skip to content

Commit

Permalink
Merge pull request #39 from jaenrig-ifx/ports/psoc6_socket_lwip_mbedt…
Browse files Browse the repository at this point in the history
…ls_conf

Ports/psoc6 socket lwip mbedtls conf
  • Loading branch information
jaenrig-ifx authored Apr 13, 2023
2 parents e402360 + 9c24f82 commit 25222f6
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 906 deletions.
13 changes: 9 additions & 4 deletions ports/psoc6/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ INC += -I$(TOP)
INC += -I$(BUILD)

ifeq ($(MICROPY_PSOC6_LWIP),1)
INC += -Ilwip_inc
INC += -Ilwip_inc
endif

### for testing purposes only
Expand All @@ -68,6 +68,7 @@ CFLAGS += $(INC) -Wall -Werror -std=c11 $(CFLAGS_CORTEX_M4) $(COPT) -D_XOPEN_SO
CFLAGS += -Wno-error=double-promotion -Wno-error=overflow -Wno-error=analyzer-null-dereference -Wno-error=unused-local-typedefs -Wno-error=unused-function -Wno-error=maybe-uninitialized

ifeq ($(MICROPY_PSOC6_SSL_MBEDTLS),1)
INC += -I$(TOP)/extmod/mbedtls
CFLAGS += -DMBEDTLS_CONFIG_FILE=\"mbedtls/mbedtls_config.h\"
CFLAGS += -DMICROPY_SSL_MBEDTLS=1
endif
Expand Down Expand Up @@ -176,7 +177,7 @@ ifeq ($(MP_LOGGER_DEBUG), 1)
endif


$(MPY_MAIN_BUILD_DIR)/firmware.elf: mpy_define_mtb_vars $(OBJ) $(MPY_MTB_LIBRARIES) $(LIBS)
$(MPY_MAIN_BUILD_DIR)/firmware.elf: $(OBJ) $(MPY_MTB_LIBRARIES) $(LIBS)
$(info )
$(info Linking $@ $^ $(LIBS) ...)
$(Q) $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
Expand All @@ -195,7 +196,10 @@ include $(BOARD_DIR)/makefile_mtb.mk
# include py core make definitions
include $(TOP)/py/mkrules.mk

all: $(MPY_MAIN_BUILD_DIR)/firmware.hex $(MPY_PATH_TO_MAIN_MAKEFILE)

build: mpy_define_mtb_vars $(MPY_PATH_TO_MAIN_MAKEFILE) $(MPY_MAIN_BUILD_DIR)/firmware.hex

all: build

rebuild: clean mpy_mtb_clean all

Expand All @@ -204,5 +208,6 @@ test:
$(info Running PSoC6 tests)
$(Q) cd ../../tests ; ./run-tests.py --target psoc6 --device /dev/ttyACM0 -d psoc6

program: mpy_program_unix

.PHONY: test
.PHONY: test build
27 changes: 27 additions & 0 deletions ports/psoc6/boards/CY8CPROTO-062-4343W/.cyignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,30 @@ images
.settings
.vscode

docs

# LwIP
$(SEARCH_lwip)/contrib/addons
$(SEARCH_lwip)/contrib/apps
$(SEARCH_lwip)/contrib/Coverity
$(SEARCH_lwip)/contrib/examples
$(SEARCH_lwip)/contrib/ports/unix
$(SEARCH_lwip)/contrib/ports/win32
$(SEARCH_lwip)/test
$(SEARCH_lwip)/doc
$(SEARCH_lwip)/src/apps
$(SEARCH_lwip)/src/netif/ppp
$(SEARCH_lwip)/src/netif/slipif.c

# mbedTLS
$(SEARCH_mbedtls)/3rdparty
$(SEARCH_mbedtls)/configs
$(SEARCH_mbedtls)/programs
$(SEARCH_mbedtls)/scripts
$(SEARCH_mbedtls)/tests
$(SEARCH_mbedtls)/doxygen
$(SEARCH_mbedtls)/library/net_sockets.c

$(SEARCH_wifi-host-driver)/docs

$(SEARCH_mbedtls)/library/psa_crypto_driver_wrappers.c
12 changes: 10 additions & 2 deletions ports/psoc6/boards/CY8CPROTO-062-4343W/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ DISABLE_COMPONENTS=
SOURCES=

# Custom configuration of mbedtls library.
MBEDTLSFLAGS = MBEDTLS_USER_CONFIG_FILE='"mbedtls_user_config.h"'
MBEDTLSFLAGS = MBEDTLS_USER_CONFIG_FILE='"mbedtls_config.h"'
DEFINES=$(MBEDTLSFLAGS) CYBSP_WIFI_CAPABLE CY_RETARGET_IO_CONVERT_LF_TO_CRLF CY_RTOS_AWARE

# CY8CPROTO-062-4343W board shares the same GPIO for the user button (USER BTN1)
Expand All @@ -109,9 +109,17 @@ DEFINES=$(MBEDTLSFLAGS) CYBSP_WIFI_CAPABLE CY_RETARGET_IO_CONVERT_LF_TO_CRLF CY_
# disabled by setting CY_WIFI_HOST_WAKE_SW_FORCE to '0'.
DEFINES+=CY_WIFI_HOST_WAKE_SW_FORCE=0

# Logging options, but not yet working
# DEFINES += LWIP_DEBUG=1 ENABLE_CONNECTIVITY_MIDDLEWARE_LOGS ENABLE_WCM_LOGS ENABLE_SECURE_SOCKETS_LOGS

# Like SOURCES, but for include directories. Value should be paths to
# directories (without a leading -I).
INCLUDES=
MPY_PSOC6_PORT_DIR = ../..
MPY_TOP_DIR = $(MPY_PSOC6_PORT_DIR)/../..
LWIP_OPTS_DIR = $(MPY_PSOC6_PORT_DIR)/lwip_inc
MBEDTLS_CONF_DIR = $(MPY_PSOC6_PORT_DIR)/mbedtls
MBEDTLS_MPY_CONF_DIR = $(MPY_TOP_DIR)/extmod/mbedtls
INCLUDES= $(LWIP_OPTS_DIR) $(MBEDTLS_CONF_DIR) $(MBEDTLS_MPY_CONF_DIR)
#../mtb_shared/wifi-host-driver/release-v2.5.0/External/rtos ../mtb_shared/lwip/STABLE-2_1_2_RELEASE/src/include ../../lwip_inc

# Add additional defines to the build process (without a leading -D).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/cypresssemiconductorco/abstraction-rtos#release-v1.7.1#$$ASSET_REPO$$/abstraction-rtos/release-v1.7.1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/cypresssemiconductorco/clib-support#release-v1.3.0#$$ASSET_REPO$$/clib-support/release-v1.3.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/cypresssemiconductorco/connectivity-utilities#release-v4.1.0#$$ASSET_REPO$$/connectivity-utilities/release-v4.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/cypresssemiconductorco/cy-mbedtls-acceleration#release-v1.4.1#$$ASSET_REPO$$/cy-mbedtls-acceleration/release-v1.4.1
1 change: 1 addition & 0 deletions ports/psoc6/boards/CY8CPROTO-062-4343W/deps/freertos.mtb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/cypresssemiconductorco/freertos#release-v10.4.305#$$ASSET_REPO$$/freertos/release-v10.4.305
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/Infineon/lwip-freertos-integration#release-v1.0.0#$$ASSET_REPO$$/lwip-freertos-integration/release-v1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/Infineon/lwip-network-interface-integration#release-v1.1.1#$$ASSET_REPO$$/lwip-network-interface-integration/release-v1.1.1
1 change: 1 addition & 0 deletions ports/psoc6/boards/CY8CPROTO-062-4343W/deps/mbedtls.mtb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/ARMmbed/mbedtls#mbedtls-2.25.0#$$ASSET_REPO$$/mbedtls/mbedtls-2.25.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/cypresssemiconductorco/secure-sockets#release-v3.2.0#$$ASSET_REPO$$/secure-sockets/release-v3.2.0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/Infineon/wpa3-external-supplicant#release-v1.1.0#$$ASSET_REPO$$/wpa3-external-supplicant/release-v1.1.0
Loading

0 comments on commit 25222f6

Please sign in to comment.