Skip to content

Commit

Permalink
[sync] release code with gitlab commit d7b03e2056124b841033d34776def8…
Browse files Browse the repository at this point in the history
…c1e5bb8d3d
  • Loading branch information
sakumisue committed Feb 6, 2024
1 parent 4df7ecf commit be623ce
Show file tree
Hide file tree
Showing 682 changed files with 57,729 additions and 18,779 deletions.
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@
.clangd
cscope*
compile_commands.*
/components
/drivers
/bsp
examples/solutions
examples/wifi
examples/btble
examples/zigbee
tools/bflb_tools
tools/CI
chiptest
**/__pycache__
**/build
Expand All @@ -26,6 +17,5 @@ chiptest
*.pptx
*.svd
**/_build
tools/reg_parser/Peripherals/*_reg.h
tools/reg_parser/InitVals/*_register.c
**/img_create_iot
docs/zh/_static/**
33 changes: 32 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
cmake_minimum_required(VERSION 3.15)

# check VERSION file
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
# read info from VERSION file
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VERSION_FILE_CONTENT)

string(REGEX MATCH "PROJECT_SDK_VERSION[ ]+\"([^\"]+)\"" _ ${VERSION_FILE_CONTENT})
set(PROJECT_SDK_VERSION "${CMAKE_MATCH_1}")
else()
# get git tag
execute_process(
COMMAND git describe --abbrev=8 --tags --dirty --always
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)

if(GIT_TAG)
set(PROJECT_SDK_VERSION ${GIT_TAG})
else()
message(WARNING "No Valid version info found for SDK!")
set(PROJECT_SDK_VERSION "version-unknown-panic")
endif()
endif()
message(STATUS "Project SDK Version: ${PROJECT_SDK_VERSION}")

# handle __FILE__ macro issue
set(SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
sdk_add_compile_options("-fmacro-prefix-map=${SOURCE_PATH}=.")
sdk_add_compile_options("-fdebug-prefix-map=${SOURCE_PATH}=.")

add_subdirectory(bsp)
add_subdirectory(components)
add_subdirectory(drivers/lhal)
Expand All @@ -10,4 +41,4 @@ endif()
sdk_add_subdirectory_ifdef(CONFIG_RF drivers/soc/${CHIP}/phyrf)
if("${CHIP}" STREQUAL "bl616")
sdk_add_subdirectory_ifdef(CONFIG_RF drivers/rfparam)
endif()
endif()
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJECT_SDK_VERSION "2.0.0"
9 changes: 8 additions & 1 deletion bsp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/sdk_version.h.in"
"${CMAKE_BINARY_DIR}/generated/sdk_version.h"
)
target_include_directories(app PRIVATE "${CMAKE_BINARY_DIR}/generated")
target_sources(app PRIVATE sdk_version.c)

add_subdirectory(board)
add_subdirectory(common)
add_subdirectory(common)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 8 additions & 1 deletion bsp/board/bl616dk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ if(CONFIG_RF)
target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/board_rf.c)
endif()

if(CONFIG_LINK_IN_PSRAM)
message("LINK IN PSRAM")
sdk_add_compile_definitions(-DCONFIG_PSRAM_COPY_CODE)
sdk_set_linker_script(bl616_chip_psram.ld)
else()
message("LINK IN FLASH")
sdk_set_linker_script(bl616_flash.ld)
endif()

if(CONFIG_PSRAM)
sdk_add_compile_definitions(-DCONFIG_PSRAM)
Expand All @@ -18,4 +25,4 @@ endif()

sdk_add_compile_definitions_ifdef(CONFIG_PSRAM_COPY_CODE -DCONFIG_PSRAM_COPY_CODE)

sdk_add_link_options(-ufw_header)
sdk_add_link_options(-ufw_header)
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,28 @@ ENTRY(__start)

StackSize = 0x1000; /* 4KB */
HeapMinSize = 0x1000; /* 4KB */
psram_min_size = 0x1000;

psram_heap_min_size = 0x1000;
nocache_max_size = 20K;
__EM_SIZE = DEFINED(btble_controller_init) ? 32K : 0K;
wifi_ram_max_size = DEFINED(wifi_main) ? (160K - __EM_SIZE): 32K;

remain_wifi_ram = 160K - wifi_ram_max_size - __EM_SIZE;

__RFTLV_SIZE_OFFSET = 1K;
__RFTLV_SIZE_HOLE = 2K;
__RFTLV_HEAD1_H = (0x46524C42); /* BLRF */
__RFTLV_HEAD1_H = (0x46524C42); /* */
__RFTLV_HEAD1_L = (0x41524150); /* PAPA */

MEMORY
{
fw_header_memory (rx) : ORIGIN = 0xA0000000 - 0x1000, LENGTH = 4K
xip_memory (rx) : ORIGIN = 0xA0000000, LENGTH = 4M
ram_psram (wxa) : ORIGIN = 0xA8000000, LENGTH = 4M
itcm_memory (rx) : ORIGIN = 0x62FC0000, LENGTH = 12K
ram_psram (wxa) : ORIGIN = 0xA8000000 + __RFTLV_SIZE_OFFSET, LENGTH = 4M - __RFTLV_SIZE_OFFSET
itcm_memory (rx) : ORIGIN = 0x62FC0400, LENGTH = 11K /* first 1K is for security */
dtcm_memory (rx) : ORIGIN = 0x62FC3000, LENGTH = 4K
nocache_ram_memory (!rx) : ORIGIN = 0x22FC4000, LENGTH = 64K
ram_memory (!rx) : ORIGIN = 0x62FD4000, LENGTH = 320K-12K-4K-64K
ram_wifi (wxa) : ORIGIN = 0x23010000, LENGTH = 160K - __EM_SIZE
nocache_ram_memory (!rx) : ORIGIN = 0x22FC4000, LENGTH = nocache_max_size
ram_memory (!rx) : ORIGIN = 0x62FC4000 + nocache_max_size, LENGTH = 320K - 12K - 4K - nocache_max_size + remain_wifi_ram
ram_wifi (wxa) : ORIGIN = 0x23038000 - wifi_ram_max_size - __EM_SIZE, LENGTH = wifi_ram_max_size
}

SECTIONS
Expand All @@ -50,19 +54,29 @@ SECTIONS
{
KEEP (*(SORT_NONE(.init)))
KEEP (*(SORT_NONE(.vector)))

*system_bl616*.o*(.rodata*)
*system_bl616*.o*(.text*)
*start_load*.o*(.rodata*)
*start_load*.o*(.text*)
} > xip_memory

.rftlv.tool :
. = ALIGN(4);
. = ORIGIN(xip_memory) + __RFTLV_SIZE_OFFSET;
__psram_load_addr = .;
.rftlv.tool : AT (__psram_load_addr)
{
. = ORIGIN(xip_memory) + __RFTLV_SIZE_OFFSET;
. = ALIGN(4);
__psram_data_start__ = .;
PROVIDE( _ld_symbol_rftlv_address = . );
LONG(__RFTLV_HEAD1_H);
LONG(__RFTLV_HEAD1_L);
. = ORIGIN(xip_memory) + __RFTLV_SIZE_OFFSET + __RFTLV_SIZE_HOLE;
} > xip_memory
. = __psram_data_start__ + __RFTLV_SIZE_HOLE;
} > ram_psram
. = ORIGIN(xip_memory) + __RFTLV_SIZE_OFFSET + __RFTLV_SIZE_HOLE;

__rftlv_load_addr = (__psram_load_addr + SIZEOF (.rftlv.tool));

.text :
.psram_data_region : AT (__rftlv_load_addr)
{
. = ALIGN(4);
__text_code_start__ = .;
Expand All @@ -76,6 +90,12 @@ SECTIONS
KEEP(*(FSymTab))
__fsymtab_end = .;

/* section information for components's version */
. = ALIGN(4);
_version_info_section_start = .;
KEEP(*(.version.*))
_version_info_section_end = .;

. = ALIGN(4);
__vsymtab_start = .;
KEEP(*(VSymTab))
Expand All @@ -102,18 +122,47 @@ SECTIONS
*(.srodata)
*(.srodata.*)

/* _dump_sections for bflb_coredump.c*/
. = ALIGN(4);
PROVIDE( _dump_sections = ABSOLUTE(.));
LONG(ORIGIN(itcm_memory));
LONG(LENGTH(itcm_memory));
LONG(ORIGIN(dtcm_memory));
LONG(LENGTH(dtcm_memory));
LONG(ORIGIN(ram_memory));
LONG(LENGTH(ram_memory));
LONG(ORIGIN(nocache_ram_memory));
LONG(LENGTH(nocache_ram_memory));
LONG(ORIGIN(ram_wifi));
LONG(LENGTH(ram_wifi));
/*
LONG(ORIGIN(ram_psram));
LONG(LENGTH(ram_psram));
*/
LONG(0x28010000); /* bt memory */
LONG(__EM_SIZE);
LONG(0xffffffff);
LONG(0xffffffff);
/* _dump_sections for bl_coredump.c*/

. = ALIGN(4);
__text_code_end__ = .;
} > xip_memory

. = ALIGN(4);
__itcm_load_addr = .;
KEEP(*(.psram_data*))

. = ALIGN(4);
__psram_data_end__ = .;
} > ram_psram

__etext_final = (__rftlv_load_addr + SIZEOF (.psram_data_region));
ASSERT(__etext_final <= ORIGIN(xip_memory) + LENGTH(xip_memory), "code memory overflow")

__itcm_load_addr = (__rftlv_load_addr + SIZEOF (.psram_data_region));

.itcm_region : AT (__itcm_load_addr)
{
. = ALIGN(4);
__tcm_code_start__ = .;

*(.tcm_code.*)
*(.tcm_const.*)
*(.sclock_rlt_code.*)
Expand Down Expand Up @@ -162,6 +211,8 @@ SECTIONS
* size of stack_dummy section */
__StackTop = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory);
PROVIDE( __freertos_irq_stack_top = __StackTop);
PROVIDE( _sp_main = __StackTop);
PROVIDE( _sp_base = __StackTop - StackSize);
__StackLimit = __StackTop - SIZEOF(.stack_dummy);

/* Check if data + heap + stack exceeds RAM limit */
Expand Down Expand Up @@ -208,22 +259,6 @@ SECTIONS
} > ram_memory


__psram_load_addr = (__ram_load_addr + SIZEOF (RAM_DATA));

.psram_data_region : AT (__psram_load_addr)
{
. = ALIGN(4);
__psram_data_start__ = .;

KEEP(*(.psram_data*))

. = ALIGN(4);
__psram_data_end__ = .;
} > ram_psram

__etext_final = (__psram_load_addr + SIZEOF (.psram_data_region));
ASSERT(__etext_final <= ORIGIN(xip_memory) + LENGTH(xip_memory), "code memory overflow")

.bss (NOLOAD) :
{
. = ALIGN(4);
Expand Down Expand Up @@ -296,8 +331,8 @@ SECTIONS
} > ram_psram

__psram_limit = ORIGIN(ram_psram) + LENGTH(ram_psram);
ASSERT(__psram_limit - __psram_heap_base >= psram_min_size, "psram heap region overflow")
ASSERT(__psram_limit - __psram_heap_base >= psram_heap_min_size, "psram heap region overflow")

.wifibss (NOLOAD) :
{
PROVIDE( __wifi_bss_start = ADDR(.wifibss) );
Expand All @@ -322,6 +357,6 @@ SECTIONS
PROVIDE( _heap_wifi_start = . );
PROVIDE( _heap_wifi_size = ORIGIN(ram_wifi) + LENGTH(ram_wifi) - _heap_wifi_start );
PROVIDE(__LD_CONFIG_EM_SEL = __EM_SIZE);

ASSERT((wifi_ram_max_size + __EM_SIZE) <= 160K,"wifi ram overflow")
}

Loading

0 comments on commit be623ce

Please sign in to comment.