Skip to content

Commit

Permalink
[nrfconnect] Fix build after nRF Connect SDK upgrade (#23379)
Browse files Browse the repository at this point in the history
* [nrfconnect] Fix build after nRF Connect SDK upgrade

Signed-off-by: Damian Krolik <[email protected]>

* Fix chef build as well

Signed-off-by: Damian Krolik <[email protected]>
  • Loading branch information
Damian-Nordic authored and pull[bot] committed Jun 29, 2023
1 parent 40c212e commit 3924600
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y

# The minimal logging mode does not work properly with the USB CDC device, so use the deferred mode
CONFIG_LOG_MODE_MINIMAL=n
CONFIG_LOG2_MODE_DEFERRED=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_BUFFER_SIZE=8192

# Reduce the code size as the dongle reserves some space for MBR and Open Bootloader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y

# The minimal logging mode does not work properly with the USB CDC device, so use the deferred mode
CONFIG_LOG_MODE_MINIMAL=n
CONFIG_LOG2_MODE_DEFERRED=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_BUFFER_SIZE=8192

# Reduce the code size as the dongle reserves some space for MBR and Open Bootloader
Expand Down
20 changes: 12 additions & 8 deletions examples/chef/nrfconnect/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace {
constexpr int kExtDiscoveryTimeoutSecs = 20;
}

CHIP_ERROR main()
int main()
{
CHIP_ERROR err = CHIP_NO_ERROR;

Expand All @@ -65,14 +65,14 @@ CHIP_ERROR main()
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "Platform::MemoryInit() failed");
return err;
return 1;
}

err = PlatformMgr().InitChipStack();
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "PlatformMgr().InitChipStack() failed");
return err;
return 1;
}

// Network connectivity
Expand All @@ -84,7 +84,7 @@ CHIP_ERROR main()
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "ThreadStackMgr().InitThreadStack() failed");
return err;
return 1;
}

#ifdef CONFIG_OPENTHREAD_MTD
Expand All @@ -95,7 +95,7 @@ CHIP_ERROR main()
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "ConnectivityMgr().SetThreadDeviceType() failed");
return err;
return 1;
}
#endif /* CHIP_ENABLE_OPENTHREAD */

Expand All @@ -108,7 +108,11 @@ CHIP_ERROR main()
// Start IM server
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams));
err = chip::Server::GetInstance().Init(initParams);
if (err != CHIP_NO_ERROR)
{
return 1;
}

chip::DeviceLayer::ConfigurationMgr().LogDeviceConfig();

Expand Down Expand Up @@ -136,7 +140,7 @@ CHIP_ERROR main()
if (rc != 0)
{
ChipLogError(AppServer, "Streamer initialization failed: %d", rc);
return CHIP_ERROR_INTERNAL;
return 1;
}

cmd_misc_init();
Expand All @@ -151,5 +155,5 @@ CHIP_ERROR main()
Engine::Root().RunMainLoop();
#endif

return err;
return 0;
}
1 change: 1 addition & 0 deletions examples/chef/nrfconnect/rpc.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ CONFIG_LOG_MODE_MINIMAL=n
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_BACKEND_RTT=n
CONFIG_LOG_OUTPUT=y

# Increase zephyr tty rx buffer
CONFIG_CONSOLE_GETCHAR_BUFSIZE=128
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y

# The minimal logging mode does not work properly with the USB CDC device, so use the deferred mode
CONFIG_LOG_MODE_MINIMAL=n
CONFIG_LOG2_MODE_DEFERRED=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_BUFFER_SIZE=8192

# Reduce the code size as the dongle reserves some space for MBR and Open Bootloader
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/nrfconnect/rpc.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ CONFIG_LOG_MODE_MINIMAL=n
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_BACKEND_RTT=n
CONFIG_LOG_OUTPUT=y

# Increase zephyr tty rx buffer
CONFIG_CONSOLE_GETCHAR_BUFSIZE=128
2 changes: 1 addition & 1 deletion examples/platform/nrfconnect/util/PigweedLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void init(const log_backend *)
pw_sys_io_Init();
}

void processMessage(const struct log_backend * const backend, union log_msg2_generic * msg)
void processMessage(const struct log_backend * const backend, union log_msg_generic * msg)
{
int ret = k_sem_take(&sLoggerLock, K_FOREVER);
assert(ret == 0);
Expand Down

0 comments on commit 3924600

Please sign in to comment.