Skip to content

Commit

Permalink
correct ld file for bl702l and enable ipv6 for bl616
Browse files Browse the repository at this point in the history
  • Loading branch information
wy-hh committed Jan 2, 2025
1 parent d9f3302 commit 7fe55bb
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 154 deletions.
2 changes: 0 additions & 2 deletions examples/contact-sensor-app/bouffalolab/bl702l/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ declare_args() {
module_type = "BL704L"
baudrate = 2000000

config_cache_size = 16384
enable_psram = true
}

Expand Down Expand Up @@ -246,7 +245,6 @@ bouffalolab_executable("contact_sensor_app") {
if (chip_print_memory_usage) {
ldflags += [
"-Wl,--print-memory-usage",
"-Wl,--defsym=__CACHE_SIZE=${config_cache_size}",
"-fstack-usage",
]
}
Expand Down
278 changes: 133 additions & 145 deletions examples/lighting-app/bouffalolab/README.md

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions examples/lighting-app/bouffalolab/bl702/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ declare_args() {
baudrate = 2000000

enable_cdc_module = false
config_cache_size = 16384
enable_psram = true
}

Expand Down Expand Up @@ -310,7 +309,6 @@ bouffalolab_executable("lighting_app") {
if (chip_print_memory_usage) {
ldflags += [
"-Wl,--print-memory-usage",
"-Wl,--defsym=__CACHE_SIZE=${config_cache_size}",
"-fstack-usage",
]
}
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/bouffalolab/bl702l/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ declare_args() {
module_type = "BL704L"
baudrate = 2000000

config_cache_size = 16384
enable_psram = true
}

Expand Down Expand Up @@ -272,7 +271,6 @@ bouffalolab_executable("lighting_app") {
if (chip_print_memory_usage) {
ldflags += [
"-Wl,--print-memory-usage",
"-Wl,--defsym=__CACHE_SIZE=${config_cache_size}",
"-fstack-usage",
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ OUTPUT_ARCH( "riscv" )
ENTRY( bl702_start )

__EM_SIZE = DEFINED(ble_controller_init) ? (DEFINED(em_16k_init) ? 16K : 8K) : 0K;
__CACHE_SIZE = DEFINED(__CACHE_SIZE) ? __CACHE_SIZE : 16K;
__CACHE_SIZE = 16K;
__stack_size = DEFINED(__stack_size) ? __stack_size : 2K;
__sha_ocram_size = DEFINED(__sha_ocram_size) ? __sha_ocram_size : 128;

Expand Down
4 changes: 2 additions & 2 deletions examples/platform/bouffalolab/bl702l/ldscripts/psram_flash.ld
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ OUTPUT_ARCH( "riscv" )

ENTRY( bl702_start )

__EM_SIZE = DEFINED(__EM_SIZE) ? 8K : 0K;
__CACHE_SIZE = DEFINED(__CACHE_SIZE) ? __CACHE_SIZE : 16K;
__EM_SIZE = DEFINED(btble_controller_init) ? 8K : 0K;
__CACHE_SIZE = 16K;
__stack_size = DEFINED(__stack_size) ? __stack_size : 2K;

MEMORY
Expand Down
15 changes: 15 additions & 0 deletions src/platform/bouffalolab/BL616/NetworkCommissioningDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg)
case kWiFiOnScanDone:
BLWiFiDriver::GetInstance().OnScanWiFiNetworkDone();
break;
case kWiFiOnConnecting:
ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting);
ConnectivityMgrImpl().OnConnectivityChanged(deviceInterface_getNetif());
break;
case kWiFiOnConnected:
BLWiFiDriver::GetInstance().OnNetworkStatusChange();
break;
Expand Down Expand Up @@ -387,6 +391,10 @@ extern "C" void wifi_event_handler(uint32_t code)
event.Type = kWiFiOnScanDone;
PlatformMgr().PostEventOrDie(&event);
break;
case CODE_WIFI_ON_CONNECTING:
event.Type = kWiFiOnConnecting;
PlatformMgr().PostEventOrDie(&event);
break;
case CODE_WIFI_ON_CONNECTED:
event.Type = kWiFiOnConnected;
PlatformMgr().PostEventOrDie(&event);
Expand Down Expand Up @@ -424,6 +432,13 @@ extern "C" void network_netif_ext_callback(struct netif* nif, netif_nsc_reason_t
PlatformMgr().PostEventOrDie(&event);
}
}

if ((LWIP_NSC_IPV4_SETTINGS_CHANGED & reason) && args) {
if (!ip4_addr_isany(netif_ip4_addr(nif)) && !ip4_addr_isany(netif_ip4_gw(nif))) {
event.Type = kGotIpAddress;
PlatformMgr().PostEventOrDie(&event);
}
}
}

} // namespace NetworkCommissioning
Expand Down
1 change: 1 addition & 0 deletions third_party/bouffalolab/bl616/bouffalo_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,7 @@ template("bouffalo_sdk") {

source_set("${sdk_target_name}_wifi") {

defines = [ "CFG_IPV6" ]
libs = [
"${bouffalo_sdk_root}/components/wireless/wifi6/lib/libwifi6.a",
]
Expand Down

0 comments on commit 7fe55bb

Please sign in to comment.