Skip to content
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

[Telink] Update to latest Zephyr (Update Telink image to 0.7.11) #26675

Merged
merged 6 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build-telink:0.7.3
image: connectedhomeip/chip-build-telink:0.7.11
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"

Expand Down
4 changes: 2 additions & 2 deletions config/telink/app/enable-gnu-std.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
#

add_library(gnu17 INTERFACE)
target_compile_options(gnu17 INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17> -D_SYS__PTHREADTYPES_H_)
target_link_libraries(app PRIVATE gnu17)
target_compile_options(gnu17 INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17> -Wno-register -D_DEFAULT_SOURCE)
target_link_libraries(app PRIVATE gnu17)
17 changes: 17 additions & 0 deletions config/telink/app/zephyr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,20 @@ CONFIG_SHELL=n

# BLE MAC address
CONFIG_B91_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000

# getopt version
CONFIG_GETOPT_LONG=y

# flash stream functionality
CONFIG_STREAM_FLASH=y

# In current config/zephyr/Kconfig
# next deprecated values are selected
# warning: Deprecated symbol CPLUSPLUS is enabled.
# warning: Deprecated symbol LIB_CPLUSPLUS is enabled.
# new one are:
# CONFIG_CPP
# CONFIG_LIBCPP_IMPLEMENTATION
# See https://docs.zephyrproject.org/latest/releases/release-notes-3.3.html
# Since not only Telink is using Zephyr just suppress warnings
CONFIG_WARN_DEPRECATED=n
2 changes: 1 addition & 1 deletion config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn.cmake)
# Prepare compiler flags

if (CONFIG_POSIX_API)
matter_add_flags(-D_SYS__PTHREADTYPES_H_)
matter_add_flags(-D_DEFAULT_SOURCE)
matter_add_flags(-isystem${ZEPHYR_BASE}/include/zephyr/posix)
endif()

Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ CONFIG_PM=n

# Custom RF power values
CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y
CONFIG_CHIP_OPENTHREAD_TX_POWER=9
CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9
2 changes: 1 addition & 1 deletion examples/lighting-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ CONFIG_PM=n

# Custom RF power values
CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y
CONFIG_CHIP_OPENTHREAD_TX_POWER=9
CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9
2 changes: 2 additions & 0 deletions examples/platform/telink/common/src/AppTaskCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ static int cmd_telink_reboot(const struct shell * shell, size_t argc, char ** ar

shell_print(shell, "Performing board reboot...");
sys_reboot();

return 0;
}

SHELL_STATIC_SUBCMD_SET_CREATE(sub_telink, SHELL_CMD(reboot, NULL, "Reboot board command", cmd_telink_reboot),
Expand Down
2 changes: 1 addition & 1 deletion examples/temperature-measurement-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ CONFIG_PM=y

# Custom RF power values
CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y
CONFIG_CHIP_OPENTHREAD_TX_POWER=9
CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9
2 changes: 1 addition & 1 deletion examples/window-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ CONFIG_PM=y

# Custom RF power values
CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y
CONFIG_CHIP_OPENTHREAD_TX_POWER=9
CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9
5 changes: 4 additions & 1 deletion src/lib/shell/MainLoopZephyr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ static int cmd_matter(const struct shell * shell, size_t argc, char ** argv)
chip::Shell::streamer_set_shell(shell);
return (Engine::Root().ExecCommand(argc - 1, argv + 1) == CHIP_NO_ERROR) ? 0 : -ENOEXEC;
}

#ifdef BOARD_TLSR9518ADK80D
static int RegisterCommands(void)
s07641069 marked this conversation as resolved.
Show resolved Hide resolved
#else
static int RegisterCommands(const struct device * dev)
#endif /* BOARD_TLSR9518ADK80D */
{
Engine::Root().RegisterDefaultCommands();
return 0;
Expand Down
1 change: 1 addition & 0 deletions src/lib/support/CHIPArgParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <stdint.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>

#include <lib/support/CHIPMem.h>
#include <lib/support/CHIPMemString.h>
Expand Down
7 changes: 0 additions & 7 deletions src/platform/telink/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ CHIP_ERROR ThreadStackManagerImpl::_InitThreadStack()
otInstance * const instance = openthread_get_default_instance();

ReturnErrorOnFailure(GenericThreadStackManagerImpl_OpenThread<ThreadStackManagerImpl>::DoInit(instance));
#ifdef CONFIG_CHIP_OPENTHREAD_TX_POWER
/* On Zephyr platform otPlatRadioSetTransmitPower does not touch radio HW */
if (otPlatRadioSetTransmitPower(OTInstance(), CONFIG_CHIP_OPENTHREAD_TX_POWER) != OT_ERROR_NONE)
{
ChipLogError(DeviceLayer, "Can't set OpenThread TX power");
}
#endif /* CONFIG_CHIP_OPENTHREAD_TX_POWER */

UDPEndPointImplSockets::SetJoinMulticastGroupHandler([](InterfaceId, const IPAddress & address) {
const otIp6Address otAddress = ToOpenThreadIP6Address(address);
Expand Down