Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
* Moved MINIMAL_LIBC config to mcuboot defaults
* Brought back setting lock feature map, but changed the value
from 0x101 to 0x181 (added COTA support)

Additionally fixed Zephyr unit tests:
* Changed main return type from void to main for Zephyr unit tests
runner.
* Added decreasing pool size conditionally to not affect tests
* Fixed exiting the tests to prevent abort.
  • Loading branch information
kkasperczyk-no committed Nov 2, 2023
1 parent 9df56c0 commit ed91a79
Show file tree
Hide file tree
Showing 20 changed files with 14 additions and 50 deletions.
4 changes: 4 additions & 0 deletions config/nrfconnect/chip-module/Kconfig.mcuboot.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ config FLASH
config FPROTECT
default y

choice LIBC_IMPLEMENTATION
default MINIMAL_LIBC
endchoice

# nRF7002DK uses SPI NOR external flash
if BOARD_NRF7002DK_NRF5340_CPUAPP

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_GPIO=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_GPIO=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
3 changes: 0 additions & 3 deletions examples/lighting-app/nrfconnect/child_image/mcuboot/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_GPIO=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_GPIO=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
3 changes: 0 additions & 3 deletions examples/lock-app/nrfconnect/child_image/mcuboot/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_GPIO=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_GPIO=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
4 changes: 4 additions & 0 deletions examples/lock-app/nrfconnect/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,9 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
logOnFailure(DoorLock::Attributes::NumberOfCredentialsSupportedPerUser::Set(endpoint, CONFIG_LOCK_NUM_CREDENTIALS_PER_USER),
"number of credentials per user");

// Set FeatureMap to (kUser|kPinCredential), default is:
// (kUser|kAccessSchedules|kRfidCredential|kPinCredential) 0x113
logOnFailure(DoorLock::Attributes::FeatureMap::Set(endpoint, 0x181), "feature map");

AppTask::Instance().UpdateClusterState(BoltLockMgr().GetState(), BoltLockManager::OperationSource::kUnspecified);
}
3 changes: 0 additions & 3 deletions examples/pump-app/nrfconnect/child_image/mcuboot/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
3 changes: 0 additions & 3 deletions examples/window-app/nrfconnect/child_image/mcuboot/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y
2 changes: 2 additions & 0 deletions src/platform/nrfconnect/SystemPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ struct ChipDeviceEvent;
#define CHIP_SYSTEM_CONFIG_USE_LWIP 0
#define CHIP_SYSTEM_CONFIG_USE_SOCKETS 1

#ifndef CONFIG_ARCH_POSIX
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8
#endif

// ========== Platform-specific Configuration Overrides =========
6 changes: 4 additions & 2 deletions src/test_driver/nrfconnect/main/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <lib/support/UnitTestRegistration.h>
#include <platform/CHIPDeviceLayer.h>

#include <unistd.h>

#include <zephyr/logging/log.h>
#include <zephyr/settings/settings.h>

Expand All @@ -27,13 +29,13 @@ using namespace ::chip::DeviceLayer;

LOG_MODULE_REGISTER(runner, CONFIG_MATTER_LOG_LEVEL);

extern "C" void main(void)
extern "C" int main(void)
{
VerifyOrDie(settings_subsys_init() == 0);

LOG_INF("Starting CHIP tests!");
int status = RunRegisteredUnitTests();
LOG_INF("CHIP test status: %d", status);

exit(status);
_exit(status);
}

0 comments on commit ed91a79

Please sign in to comment.