Skip to content

Commit ff77314

Browse files
committed
Implement enough of socketpool to do ntp and non-https requests
1 parent a7a1bd7 commit ff77314

File tree

9 files changed

+937
-63
lines changed

9 files changed

+937
-63
lines changed

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,3 +310,9 @@
310310
[submodule "ports/espressif/esp32-camera"]
311311
path = ports/espressif/esp32-camera
312312
url = https://github.com/adafruit/esp32-camera/
313+
[submodule "ports/raspberrypi/lib/cyw43-driver"]
314+
path = ports/raspberrypi/lib/cyw43-driver
315+
url = https://github.com/georgerobotics/cyw43-driver.git
316+
[submodule "ports/raspberrypi/lib/lwip"]
317+
path = ports/raspberrypi/lib/lwip
318+
url = https://github.com/lwip-tcpip/lwip.git

ports/raspberrypi/Makefile

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,14 @@ HAL_DIR=hal/$(MCU_SERIES)
5959

6060
ifeq ($(CIRCUITPY_CYW43),1)
6161
INC_CYW43 := \
62-
-isystem sdk/lib/cyw43-driver/firmware \
63-
-isystem sdk/lib/cyw43-driver/src \
64-
-isystem sdk/lib/lwip/src/include \
62+
-isystem lib/cyw43-driver/firmware \
63+
-isystem lib/cyw43-driver/src \
64+
-isystem lib/lwip/src/include \
6565
-isystem sdk/src/rp2_common/pico_cyw43_arch/include/ \
6666
-isystem sdk/src/rp2_common/pico_lwip/include/ \
6767

68-
CFLAGS_CYW43 := -DCYW43_LWIP=1 -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_USE_SPI -DIGNORE_GPIO25
68+
CFLAGS_CYW43 := -DCYW43_LWIP=1 -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_USE_SPI -DIGNORE_GPIO25 -DCYW43_LOGIC_DEBUG=0
6969
SRC_SDK_CYW43 := \
70-
lib/cyw43-driver/src/cyw43_ctrl.c \
71-
lib/cyw43-driver/src/cyw43_ll.c \
72-
lib/cyw43-driver/src/cyw43_lwip.c \
73-
lib/cyw43-driver/src/cyw43_stats.c \
7470
src/common/pico_sync/sem.c \
7571
src/rp2_common/cyw43_driver/cyw43_bus_pio_spi.c \
7672
src/rp2_common/pico_cyw43_arch/cyw43_arch.c \
@@ -80,33 +76,38 @@ SRC_SDK_CYW43 := \
8076

8177
SRC_LWIP := \
8278
shared/netutils/netutils.c \
83-
$(wildcard sdk/lib/lwip/src/core/*.c) \
84-
$(wildcard sdk/lib/lwip/src/core/ipv4/*.c) \
85-
sdk/lib/lwip/src/netif/ethernet.c \
79+
$(wildcard lib/lwip/src/core/*.c) \
80+
$(wildcard lib/lwip/src/core/ipv4/*.c) \
81+
lib/lwip/src/netif/ethernet.c \
8682
$(wildcard lwip_src/*.c) \
8783

88-
SRC_CYW43 := $(wildcard bindings/cyw43/*.c)
84+
SRC_CYW43 := \
85+
$(wildcard bindings/cyw43/*.c) \
86+
lib/cyw43-driver/src/cyw43_stats.c \
87+
lib/cyw43-driver/src/cyw43_ctrl.c \
88+
lib/cyw43-driver/src/cyw43_ll.c \
89+
lib/cyw43-driver/src/cyw43_lwip.c \
8990

90-
PIOASM = $(BUILD)/sdk/pioasm/pioasm
91+
PIOASM = $(BUILD)/pioasm/pioasm/pioasm
9192
.PHONY: PioasmBuild
9293
PioasmBuild: $(PIOASM)
9394
$(PIOASM):
94-
$(Q)cmake -S sdk -B $(BUILD)/sdk
95-
$(Q)make -C $(BUILD)/sdk PioasmBuild
95+
$(Q)cmake -S pioasm -B $(BUILD)/pioasm
96+
$(Q)$(MAKE) -C $(BUILD)/pioasm PioasmBuild
9697

9798
$(BUILD)/cyw43_bus_pio_spi.pio.h: sdk/src/rp2_common/cyw43_driver/cyw43_bus_pio_spi.pio $(PIOASM)
9899
$(Q)$(PIOASM) -o c-sdk $< $@
99100
$(BUILD)/sdk/src/rp2_common/cyw43_driver/cyw43_bus_pio_spi.o: $(BUILD)/cyw43_bus_pio_spi.pio.h
100101

101102
CYW43_FIRMWARE_BIN = 43439A0-7.95.49.00.combined
102103

103-
$(BUILD)/cyw43_resource.o: sdk/lib/cyw43-driver/firmware/$(CYW43_FIRMWARE_BIN)
104+
$(BUILD)/cyw43_resource.o: lib/cyw43-driver/firmware/$(CYW43_FIRMWARE_BIN)
104105
$(Q)$(OBJCOPY) -I binary -O elf32-littlearm -B arm \
105106
--readonly-text \
106107
--rename-section .data=.big_const,contents,alloc,load,readonly,data \
107-
--redefine-sym _binary_sdk_lib_cyw43_driver_firmware_43439A0_7_95_49_00_combined_start=fw_43439A0_7_95_49_00_start \
108-
--redefine-sym _binary_sdk_lib_cyw43_driver_firmware_43439A0_7_95_49_00_combined_size=fw_43439A0_7_95_49_00_size \
109-
--redefine-sym _binary_sdk_lib_cyw43_driver_firmware_43439A0_7_95_49_00_combined_end=fw_43439A0_7_95_49_00_end \
108+
--redefine-sym _binary_lib_cyw43_driver_firmware_43439A0_7_95_49_00_combined_start=fw_43439A0_7_95_49_00_start \
109+
--redefine-sym _binary_lib_cyw43_driver_firmware_43439A0_7_95_49_00_combined_size=fw_43439A0_7_95_49_00_size \
110+
--redefine-sym _binary_lib_cyw43_driver_firmware_43439A0_7_95_49_00_combined_end=fw_43439A0_7_95_49_00_end \
110111
$< $@
111112
OBJ_CYW43 := $(BUILD)/cyw43_resource.o
112113
# need to do the equivalent of this in cmake
@@ -270,7 +271,7 @@ SRC_SDK := \
270271
$(SRC_SDK_CYW43) \
271272

272273
SRC_SDK := $(addprefix sdk/, $(SRC_SDK))
273-
$(patsubst %.c,$(BUILD)/%.o,$(SRC_SDK)): CFLAGS += -Wno-missing-prototypes -Wno-undef
274+
$(patsubst %.c,$(BUILD)/%.o,$(SRC_SDK) $(SRC_CYW43)): CFLAGS += -Wno-missing-prototypes -Wno-undef
274275

275276
SRC_C += \
276277
boards/$(BOARD)/board.c \

0 commit comments

Comments
 (0)