-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Gen 4] change coexistence behavior in wifi connecting or wifi connected states with background BLE low prio activity #2764
Conversation
56caa4a
to
068a1db
Compare
fd27eaf
to
8114b41
Compare
dd3bc63
to
06d41b5
Compare
hal/src/rtl872x/rtl_sdk_support.cpp
Outdated
volatile bool s_wifiConnectionState = false; | ||
volatile bool s_tdmaSkip = false; | ||
|
||
uint32_t s_coexTable[3] = {0x55555555, 0xaaaa5555, 0xf0ffffff}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0x55555555 == BT > WLAN, 0xaaaa5555 == WLAN high-Priority > BT > WLAN low-Priority
62f327c
to
dc777df
Compare
00120e1
to
a4015f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some general questions. Still need to try to understand the actual coexistence changes and their implications
#define OS_THREAD_PRIORITY_NETWORK (7) | ||
#define OS_THREAD_PRIORITY_NETWORK_HIGH (8) | ||
#define OS_THREAD_PRIORITY_NETWORK (6) | ||
#define OS_THREAD_PRIORITY_NETWORK_HIGH (7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these changes have any effect? Do we know what priority the SDK threads run at? Do we need to take into account their priorities perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just fixing the general problem: MAC network threads should be below LwIP TCP/IP thread.
info.end = (uint32_t)&link_prebootloader_wifi_fw_ram_end; | ||
DCache_CleanInvalidate((uint32_t)&info, sizeof(info)); | ||
rtl_wifi_fw_resp resp = {}; | ||
int r = km0_km4_ipc_send_request(KM0_KM4_IPC_CHANNEL_GENERIC, KM0_KM4_IPC_MSG_WIFI_FW_INIT, &info, sizeof(info), [](km0_km4_ipc_msg_t* msg, void* context) -> void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the "wifi firmware" actually do? Why does it need to run on KM0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It manages low power wifi modes and mainly for our use-case prioritization between wifi and bt slots. Pretty much the main thing it does in simple terms is set up an interrupt at TBTT interval (100ms generally, depends on AP settings) and depending on the coexistence configuration may switch the RF frontend between WiFi and BLE peripheral. Of course it's a bit more complex than simply that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thanks for the general overview. I'm guessing wifi fw is running on KM0 for performance and hardware reasons? wifi fw is loaded into KM0 ROM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷 That's how it's implemented by Realtek. Wifi fw is in ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/lib/application/lib_wifi_fw.a
, it does use some of the ROM functions, but in general it just runs on KM0 through a set of threads / interrupt handlers. It can run XIP, but XIP is seriously broken as usual, so we run it out of KM4 SRAM (as we are out of KM0 SRAM).
…nd wifi connected states along with ble scans
8076d96
to
cbdf67a
Compare
TODO