From 0cfa5d5e3cd2c85e1cb5e04733c3b6e37b39e1f9 Mon Sep 17 00:00:00 2001 From: Florian Sylvestre Date: Fri, 22 Sep 2023 11:36:04 +0200 Subject: [PATCH] spider: update ethernet example to use 'lwip' Trampoline library --- .../cortex-a-r/armv8/spider/ethernet/eth.oil | 30 ++++++++++--------- .../cortex-a-r/armv8/spider/ethernet/main.c | 6 ++-- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/examples/cortex-a-r/armv8/spider/ethernet/eth.oil b/examples/cortex-a-r/armv8/spider/ethernet/eth.oil index 78f48bee6..59bb6e7a7 100644 --- a/examples/cortex-a-r/armv8/spider/ethernet/eth.oil +++ b/examples/cortex-a-r/armv8/spider/ethernet/eth.oil @@ -17,16 +17,9 @@ CPU eth { BUILD = TRUE { TRAMPOLINE_BASE_PATH = "../../../../.."; APP_SRC = "main.c"; - APP_SRC = "utils.c"; - APP_SRC = "eth_serdes.c"; - APP_SRC = "rswitch.c"; - APP_SRC = "eth_gptp.c"; - APP_SRC = "printf.c"; - APP_SRC = "lwip-port/sys_arch.c"; - APP_SRC = "lwip-port/ethif.c"; APP_NAME = "eth_exe.elf"; - CFLAGS = "-O0 -g -DHSCIF_1843200BPS -I. -Ilwip/src/include -Ilwip-port"; - LDFLAGS = "-Map=eth_exe.map -L. -llwipcore -llwipallapps"; + CFLAGS = "-O0 -g -DHSCIF_1843200BPS -DNO_SYS"; + LDFLAGS = "-Map=eth_exe.map"; COMPILER = "arm-none-eabi-gcc"; CPPCOMPILER = "arm-none-eabi-g++"; ASSEMBLER = "arm-none-eabi-as"; @@ -34,6 +27,7 @@ CPU eth { COPIER = "arm-none-eabi-objcopy"; SYSTEM = PYTHON; LIBRARY = serial; + LIBRARY = lwip; }; SYSTEM_CALL = TRUE; MEMMAP = TRUE { @@ -60,33 +54,41 @@ CPU eth { SCHEDULE = FULL; }; + /* ethernet driver needs */ + TASK gwca1_rx_tx_task { + PRIORITY = 2; + AUTOSTART = FALSE; + ACTIVATION = 1; + SCHEDULE = FULL; + }; + ISR gwca1_rx_tx_int { CATEGORY = 2; - PRIORITY = 1; + PRIORITY = 2; SOURCE = GWCA1_RX_TX_INT; }; ISR gwca1_rx_ts_int { CATEGORY = 2; - PRIORITY = 2; + PRIORITY = 3; SOURCE = GWCA1_RX_TS_INT; }; ISR coma_err_int { CATEGORY = 2; - PRIORITY = 3; + PRIORITY = 4; SOURCE = COMA_ERR_INT; }; ISR gwca1_err_int { CATEGORY = 2; - PRIORITY = 4; + PRIORITY = 5; SOURCE = GWCA1_ERR_INT; }; ISR etha0_err_int { CATEGORY = 2; - PRIORITY = 5; + PRIORITY = 6; SOURCE = ETHA0_ERR_INT; }; }; diff --git a/examples/cortex-a-r/armv8/spider/ethernet/main.c b/examples/cortex-a-r/armv8/spider/ethernet/main.c index afb727ed6..ef475c145 100644 --- a/examples/cortex-a-r/armv8/spider/ethernet/main.c +++ b/examples/cortex-a-r/armv8/spider/ethernet/main.c @@ -1,11 +1,11 @@ #include "tpl_os.h" #include "utils.h" -#include "serial.h" +#include "spider_serial.h" #include "string.h" #include "lwip/netif.h" #include "lwip/ip4_addr.h" #include "lwip/timeouts.h" -#include "lwip-port/ethif.h" +#include "ethif.h" #define APP_Task_sample_init_START_SEC_CODE #include "tpl_memmap.h" @@ -55,4 +55,4 @@ TASK(monitor) { } #define APP_Task_sample_init_STOP_SEC_CODE -#include "tpl_memmap.h" \ No newline at end of file +#include "tpl_memmap.h"