ports/stm32: Switch to the open-source cyw43 driver.

This commit is contained in:
iabdalkader 2023-05-06 16:35:03 +02:00
parent ccfb5b2135
commit 4f0e3d4ac9
8 changed files with 14 additions and 26 deletions

View File

@ -0,0 +1,3 @@
#define CYW43_WIFI_FW_LEN (383110) // 7.45.98.50
#define CYW43_CLM_LEN (7222)
const uintptr_t fw_data = (uintptr_t) CYW43_FIRMWARE_ADDRESS;

View File

@ -143,8 +143,6 @@
#define OMV_JPEG_MEMORY SRAM3 // JPEG buffer memory buffer.
#define OMV_VOSPI_MEMORY SRAM4 // VoSPI frame buffer memory.
#define OMV_VOSPI_MEMORY_OFFSET (20K) // SRAM4 reserves 16K for CM4 + 4K D3 DMA buffers.
#define OMV_CYW43_MEMORY FLASH_EXT // CYW43 firmware in external flash mmap'd flash.
#define OMV_CYW43_MEMORY_OFFSET (0x90F00000)// Last Mbyte.
#define OMV_FB_SIZE (400K) // FB memory: header + VGA/GS image
#define OMV_FB_ALLOC_SIZE (100K) // minimum fb alloc size

View File

@ -12,7 +12,9 @@ M4_VECT_TAB_OFFSET=0x20000
M4_APP_ADDR=0x08020000
OMV_HSE_VALUE=25000000
DFU_DEVICE=0x2341:0x035b
OMV_BOARD_EXTRA_CFLAGS = -DCORE_CM7 -DUSE_USB_HS
OMV_BOARD_EXTRA_CFLAGS = -DCORE_CM7 -DUSE_USB_HS \
-DCYW43_FIRMWARE_ADDRESS=0x90F00000 \
-DCYW43_CHIPSET_FIRMWARE_INCLUDE_FILE="\"$(TOP_DIR)/drivers/cyw4343/firmware/cyw4343_ext_fw.h\""
OMV_ENABLE_BL = 0
OMV_ENABLE_UVC = 1
OMV_ENABLE_CM4 = 0

View File

@ -155,8 +155,6 @@
#define OMV_JPEG_MEMORY_OFFSET (7M) // JPEG buffer is placed after FB/fballoc memory.
#define OMV_VOSPI_MEMORY SRAM4 // VoSPI buffer memory.
#define OMV_FB_OVERLAY_MEMORY AXI_SRAM // Fast fb_alloc memory.
#define OMV_CYW43_MEMORY FLASH_EXT // CYW43 firmware in external flash mmap'd flash.
#define OMV_CYW43_MEMORY_OFFSET (0x90F00000)// Last Mbyte.
#define OMV_FB_SIZE (4M) // FB memory: header + VGA/GS image
#define OMV_FB_ALLOC_SIZE (3M) // minimum fb alloc size

View File

@ -12,7 +12,9 @@ M4_VECT_TAB_OFFSET=0x20000
M4_APP_ADDR=0x08020000
OMV_HSE_VALUE=25000000
DFU_DEVICE=0x2341:0x035b
OMV_BOARD_EXTRA_CFLAGS = -DCORE_CM7 -DUSE_USB_HS
OMV_BOARD_EXTRA_CFLAGS = -DCORE_CM7 -DUSE_USB_HS \
-DCYW43_FIRMWARE_ADDRESS=0x90F00000 \
-DCYW43_CHIPSET_FIRMWARE_INCLUDE_FILE="\"$(TOP_DIR)/drivers/cyw4343/firmware/cyw4343_ext_fw.h\""
OMV_ENABLE_BL=0
OMV_ENABLE_UVC=1
OMV_ENABLE_CM4=0

View File

@ -83,7 +83,7 @@
#if MICROPY_PY_LWIP
#include "lwip/init.h"
#include "lwip/apps/mdns.h"
#include "drivers/cyw43/cyw43.h"
#include "lib/cyw43-driver/src/cyw43.h"
#endif
#if MICROPY_PY_BLUETOOTH

View File

@ -467,10 +467,10 @@ endif
ifeq ($(MICROPY_PY_NETWORK_CYW43), 1)
FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/,\
drivers/cyw43/*.o \
extmod/network_cyw43.o \
lib/cyw43-driver/src/*.o \
extmod/network_cyw43.o \
extmod/network_lwip.o \
)
LIBS += $(MICROPY_DIR)/drivers/cyw43/libcyw43.a
endif
ifeq ($(MICROPY_BLUETOOTH_NIMBLE),1)
@ -665,7 +665,7 @@ endif
$(FIRMWARE): FIRMWARE_OBJS
$(CPP) -P -E -I$(OMV_BOARD_CONFIG_DIR) $(OMV_DIR)/ports/$(PORT)/$(LDSCRIPT).ld.S > $(BUILD)/$(LDSCRIPT).lds
$(CC) $(LDFLAGS) $(FIRM_OBJ) -o $(FW_DIR)/$(FIRMWARE).elf $(LIBS) -lgcc
$(OBJCOPY) -Obinary -R .big_const* $(FW_DIR)/$(FIRMWARE).elf $(FW_DIR)/$(FIRMWARE).bin
$(OBJCOPY) -Obinary $(FW_DIR)/$(FIRMWARE).elf $(FW_DIR)/$(FIRMWARE).bin
$(PYTHON) $(MKDFU) -D $(DFU_DEVICE) -b $(MAIN_APP_ADDR):$(FW_DIR)/$(FIRMWARE).bin $(FW_DIR)/$(FIRMWARE).dfu
ifeq ($(OMV_ENABLE_BL), 1)

View File

@ -99,25 +99,10 @@ SECTIONS
*(.rodata) // .rodata sections (constants, strings, etc.)
. = ALIGN(4);
*(.rodata*) // .rodata* sections (constants, strings, etc.)
#if !defined(OMV_CYW43_MEMORY)
. = ALIGN(512);
*(.big_const*)
#endif
. = ALIGN(4);
_etext = .; // define a global symbols at end of code
} >FLASH_TEXT
#if defined(OMV_CYW43_MEMORY)
// This makes sure the symbol .big_const is at the same offset.
.big_const OMV_CYW43_MEMORY_OFFSET :
{
. = ALIGN(512);
*(.big_const*)
. = ALIGN(4);
_ebig_const = .;
} > OMV_CYW43_MEMORY
#endif
.ARM.exidx :
{
*(.ARM.exidx*)