Skip to content

Commit

Permalink
[OIS] CI improvments and stabilization (#25866)
Browse files Browse the repository at this point in the history
* [OIS] PlatformManagerImpl improvements

Improve CHIP stack initialization in PlatformManager - add
stack initialization flag.
Check initialization stack state in event loop functions.
Initialize the CHIP stack in timer starting and event posting.
Dispatch all events in queue.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Improve unit tests

Remove CHIP stack initialization in unit-tests application main.
Restore CHIP stack init and shutdown in unit tests context.
Skip TestEventLogging due to lack of real-time clock support.
Skip TestTLVPacketBufferBackingStore due to LwIP buffers usage
in SystemPacketBuffer.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [Fix] Fix LwIP structure initialization in unit-tests

Zero-initialization of ip6_addr_t structure in TestInetAddress.
That protects against error that may occur when the memory is aligned
to multiples of 4 and LWIP_IPV6_SCOPES is enabled. In this case,
 the ip6_addr_t contains 16 bytes array of address and 1 byte of zone
but the structure length is 20. If we don't set the initial value
for ip_addr_1 and ip_addr_2  the memcmp returns mismatch.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [Fix] Fix PlatformMgr unit test - event loop stopping

Add sleep after stopping event loop task.
In OIS platform implementations the event loop thread  is self-terminating.
We need time to process the stopping event inside event loop.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Improve build/run script

Update Matter Python builder.
Check if FVP process run properly and wait for the
connection port log. Validate if FVP starts properly.
Wait for the FVP stop.
Move Pigweed env activation to a common point.
Create supported apps list and use it.
Fixing the optimization issue for mcu-driver-hal target
in the non-debug build.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Improve internal cmake function

Use target name from function argument instead of
APP_TARGET variable in linker.cmake and sdk.cmake.
Add custom command to sign the TF-M non-secure image.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Integration test suite improvements

Common:
Improve commissioning function to return commission error.
Check if FVP process run properly and wait for the connection port log.
Set verbose for  wait_for_output() function. The default value is
false - not print waiting log.
Fix telnet connection readline function, buffering output date and
processes only entire lines (ending with "\n").
Increase wait for lock-app application run timeout.
Increase wait for setup QR code timeout.
Add "verbose" state setting in the device class.
Improve read/write ZCL attributes and send ZCL command functions.
Improve controller device - add controllerConfig fixture, the
dictionary with settings, remove persistent storage file at the end,
change fixture scope to session.

Lock test:
Apply common changes.

Shell test:
Change the shell prompt to "Enter command:\r\n". It should be
terminated by a newline character.
Add waiting for the prompt before sending the shell command.
Update file header.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Extend RAM size for TF-M app

For unit-test applications, 1MB ISRAM0 is not enough.
Extend it by adding ISRAM1, then 2MB of memory is available.
Change TF-M linker script and AN552 target configuration.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Add TF-M support to unit-tests

Adapt unit-tests project to TF-M support.
Change unit-tests debug Vscode task.
Increase application run timeout for unit-tests integration test.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Move unit-test validation to pyTest integration tests

Create unit-tests Python integration test that checks
and control time execution of OIS unit-tests.
Change run script to only run single test on FVP.
Add testing of unit-test apps to test script and Vscode
tasks and CI.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Improve LwIP configuration

Open IoT SDK version udpate.
Move LwIP opts settings to sdk.cmake. As default the
config/openiotsdk/lwip/user_lwipopts.h file is used.
You can provide your settings with define LWIP_PROJECT_OPTS_DIR
with path to custom file.
Add CONFIG_CHIP_OPEN_IOT_SDK_LWIP_DEBUG variable to
enable LwIP debug logs. It's disabled by default.
Add LwIP debug logs option to build script and VScode tasks.
Create common LwIP options for examples and unit-tests.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] TF-M settings improvements

Enable TFM fault trace support - application hangs instead of reset
in case of fault.

Force secure partition isolation to level 1 - this speed up
processing which allows slow Github runners to pass the tests.

Signed-off-by: Vincent Coubard <vincent.coubard@arm.com>

* [OIS] Rework application startup and serial output

Add startup library

This library setup the C runtime:
- Initialize stdio
- Start the kernel
- Create an run the main thread

The main thread setups TFM and the locks used by the libc before
entering main.

Additionaly, lock support has been added to malloc/free, operator
new and delete have been overriden to print errors and sbrk is
overriden to print heap segment overallocation.

The startup also rework stdio:

- Override iotsdk-serial-retarget
- Lock stream at the libc level
- Buffer bytes on the RX path

Add option to set serial baud rate from Cmake level.
Decrease serial baudrate for shell examples to 9600.
Create ois_logging_init() function and move setting log filter
for non-debug mode to it.

Co-authored-by: ATmobica <artur.tynecki@arm.com>
Signed-off-by: Vincent Coubard <vincent.coubard@arm.com>

* [OIS] Fix TDB key-value store string writing

Add correct condition for nullptr string argument.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Restore testing steps in the CI workflow

Adjust timeouts for job and steps.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

---------

Signed-off-by: ATmobica <artur.tynecki@arm.com>
Signed-off-by: Vincent Coubard <vincent.coubard@arm.com>
Co-authored-by: Vincent Coubard <vincent.coubard@arm.com>
  • Loading branch information
2 people authored and pull[bot] committed Nov 6, 2023
1 parent c5d30f3 commit 1122680
Show file tree
Hide file tree
Showing 48 changed files with 1,369 additions and 597 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/examples-openiotsdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
jobs:
openiotsdk:
name: Open IoT SDK examples building
timeout-minutes: 140
timeout-minutes: 90

env:
TEST_NETWORK_NAME: OIStest
Expand Down Expand Up @@ -107,25 +107,22 @@ jobs:
run: |
scripts/examples/openiotsdk_example.sh unit-tests
- name: Test shell example
# Temporarily disable test due to performance issue with FVP
if: false #steps.build_shell.outcome == 'success'
- name: "Test: shell example"
if: steps.build_shell.outcome == 'success'
timeout-minutes: 5
run: |
scripts/examples/openiotsdk_example.sh -C test shell
- name: Test lock-app example
# Temporarily disable test due to performance issue with FVP
if: false #steps.build_lock_app.outcome == 'success'
- name: "Test: lock-app example"
if: steps.build_lock_app.outcome == 'success'
timeout-minutes: 5
run: |
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh -C test -n ${TEST_NETWORK_NAME}tap lock-app
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
- name: Run unit tests
# Temporarily disable test due to performance issue with FVP
if: false #steps.build_unit_tests.outcome == 'success' && github.event_name == 'pull_request'
timeout-minutes: 90
- name: "Test: unit-tests"
if: steps.build_unit_tests.outcome == 'success'
timeout-minutes: 40
run: |
scripts/examples/openiotsdk_example.sh -C run unit-tests
scripts/examples/openiotsdk_example.sh -C test unit-tests
8 changes: 7 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,13 @@
"armToolchainPath": "${env:PW_ENVIRONMENT_ROOT}/cipd/packages/arm/bin/",
"servertype": "external",
"gdbTarget": ":31627", //GDBserver port on FVP
"overrideLaunchCommands": ["-enable-pretty-printing"],
"overrideLaunchCommands": [
"-enable-pretty-printing",
"add-symbol-file ./build/bl2.elf 0x10000000",
"add-symbol-file ./build/tfm_s.elf 0x38000400",
"add-symbol-file ./build/${input:openiotsdkUnittest}_ns.elf 0x28060400",
"break main_ns.cpp:main"
],
"runToEntryPoint": "main",
"preLaunchTask": "Debug Open IoT SDK unit-tests",
"showDevDebugOutput": "parsed"
Expand Down
33 changes: 30 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
"args": [
"-Cbuild",
"-d${input:openiotsdkDebugMode}",
"-l${input:openiotsdkLwipDebug}",
"${input:openiotsdkExample}"
],
"group": "build",
Expand All @@ -266,7 +267,12 @@
"label": "Build Open IoT SDK unit-tests",
"type": "shell",
"command": "scripts/examples/openiotsdk_example.sh",
"args": ["-Cbuild", "-d${input:openiotsdkDebugMode}", "unit-tests"],
"args": [
"-Cbuild",
"-d${input:openiotsdkDebugMode}",
"-l${input:openiotsdkLwipDebug}",
"unit-tests"
],
"group": "build",
"problemMatcher": {
"pattern": {
Expand Down Expand Up @@ -334,6 +340,21 @@
}
}
},
{
"label": "Test Open IoT SDK unit-tests",
"type": "shell",
"command": "scripts/examples/openiotsdk_example.sh",
"args": ["-Ctest", "unit-tests", "${input:openiotsdkUnitTest}"],
"group": "test",
"problemMatcher": {
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"message": 5
}
}
},
{
"label": "Debug Open IoT SDK example",
"type": "shell",
Expand Down Expand Up @@ -439,6 +460,13 @@
"options": ["false", "true"],
"default": "false"
},
{
"type": "pickString",
"id": "openiotsdkLwipDebug",
"description": "Do you want to use LwIP debug logs?",
"options": ["false", "true"],
"default": "false"
},
{
"type": "pickString",
"id": "openiotsdkExample",
Expand All @@ -451,7 +479,6 @@
"id": "openiotsdkUnitTest",
"description": "What unit test do you want to use?",
"options": [
"all",
"accesstest",
"AppTests",
"ASN1Tests",
Expand All @@ -478,7 +505,7 @@
"TransportLayerTests",
"UserDirectedCommissioningTests"
],
"default": "all"
"default": "accesstest"
},
{
"type": "promptString",
Expand Down
6 changes: 3 additions & 3 deletions config/openiotsdk/cmake/linker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ function(set_target_link target)
if (NOT LINKER_SCRIPT)
set(LINKER_SCRIPT ${OPEN_IOT_SDK_CONFIG}/ld/cs300_gcc.ld)
endif()
target_link_options(${APP_TARGET} PRIVATE -T ${LINKER_SCRIPT})
set_target_properties(${APP_TARGET} PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT})
target_link_options(${target} PRIVATE -T ${LINKER_SCRIPT})
set_target_properties(${target} PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT})

target_link_options(${target}
PRIVATE
"-Wl,-Map=${APP_TARGET}.map"
"-Wl,-Map=${target}.map"
)
endfunction()

Expand Down
111 changes: 74 additions & 37 deletions config/openiotsdk/cmake/sdk.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2022 Project CHIP Authors
# Copyright (c) 2022-2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,6 +30,12 @@ list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS)
# Additional Open IoT SDK build configuration
set(TFM_SUPPORT NO CACHE BOOL "Add Trusted Firmware-M (TF-M) support to application")
set(TFM_NS_APP_VERSION "0.0.0" CACHE STRING "TF-M non-secure application version (in the x.x.x format)")
set(CONFIG_CHIP_OPEN_IOT_SDK_LWIP_DEBUG NO CACHE BOOL "Enable LwIP debug logs")

# Default LwIP options directory (should contain user_lwipopts.h file)
if (NOT LWIP_PROJECT_OPTS_DIR)
set(LWIP_PROJECT_OPTS_DIR ${OPEN_IOT_SDK_CONFIG}/lwip)
endif()

# Overwrite versions of Open IoT SDK components

Expand Down Expand Up @@ -76,11 +82,11 @@ if(TFM_SUPPORT)
set(TFM_PLATFORM ${OPEN_IOT_SDK_EXAMPLE_COMMON}/tf-m/targets/an552)
set(TFM_PSA_FIRMWARE_UPDATE ON)
set(MCUBOOT_IMAGE_VERSION_NS ${TFM_NS_APP_VERSION})
set(TFM_CMAKE_ARGS "-DCONFIG_TFM_ENABLE_FP=ON;-DTFM_PROFILE=profile_medium")
set(TFM_CMAKE_ARGS "-DCONFIG_TFM_ENABLE_FP=ON;-DTFM_PROFILE=profile_medium;-DTFM_EXCEPTION_INFO_DUMP=ON;-DCONFIG_TFM_HALT_ON_CORE_PANIC=ON;-DTFM_ISOLATION_LEVEL=1")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(TFM_CMAKE_ARGS "${TFM_CMAKE_ARGS};-DMCUBOOT_LOG_LEVEL=INFO;-DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_INFO;-DTFM_PARTITION_LOG_LEVEL=TFM_PARTITION_LOG_LEVEL_INFO")
set(TFM_CMAKE_ARGS "${TFM_CMAKE_ARGS};-DMCUBOOT_LOG_LEVEL=INFO;-DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_DEBUG;-DTFM_PARTITION_LOG_LEVEL=TFM_PARTITION_LOG_LEVEL_INFO")
else()
set(TFM_CMAKE_ARGS "${TFM_CMAKE_ARGS};-DMCUBOOT_LOG_LEVEL=ERROR;-DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_ERROR;-DTFM_PARTITION_LOG_LEVEL=TFM_PARTITION_LOG_LEVEL_ERROR")
set(TFM_CMAKE_ARGS "${TFM_CMAKE_ARGS};-DMCUBOOT_LOG_LEVEL=ERROR;-DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_DEBUG;-DTFM_PARTITION_LOG_LEVEL=TFM_PARTITION_LOG_LEVEL_ERROR")
endif()
if(TFM_PROJECT_CONFIG_HEADER_FILE)
set(TFM_CMAKE_ARGS "${TFM_CMAKE_ARGS};-DPROJECT_CONFIG_HEADER_FILE=${TFM_PROJECT_CONFIG_HEADER_FILE}")
Expand Down Expand Up @@ -135,7 +141,6 @@ if(TARGET cmsis-rtos-api)
target_link_libraries(cmsis-rtos-api
PUBLIC
freertos-cmsis-rtos
freertos-kernel-heap-3
)

target_compile_definitions(cmsis-rtos-api
Expand All @@ -162,12 +167,17 @@ if(TARGET lwip-cmsis-port)
target_compile_definitions(lwipopts
INTERFACE
DEBUG_PRINT=printf
$<$<BOOL:${CONFIG_CHIP_OPEN_IOT_SDK_LWIP_DEBUG}>:LWIP_DEBUG>
$<$<BOOL:${CONFIG_CHIP_LIB_TESTS}>:CHIP_LIB_TESTS>
)

if(TARGET lwip-cmsis-port)
# Link the emac factory to LwIP port
target_link_libraries(lwip-cmsis-port PUBLIC iotsdk-emac-factory)
endif()
target_include_directories(lwipopts
INTERFACE
${LWIP_PROJECT_OPTS_DIR}
)

# Link the emac factory to LwIP port
target_link_libraries(lwip-cmsis-port PUBLIC iotsdk-emac-factory)
endif()

# MDH configuration
Expand All @@ -183,6 +193,15 @@ if(TARGET mcu-driver-hal)
INTERFACE
DOMAIN_NS=$<IF:$<BOOL:${TFM_SUPPORT}>,1,0>
)

# Fixing the optimization issue for mcu-driver-hal target in the no-debug build.
# The default -Og optimization causes performance issues for the application.
# We need to replace it with -O2 which is suitable for performance.
# This fix can be removed in the future when the issue will be fixed in SDK directly.
if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
target_compile_options(mcu-driver-hal INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-O2>)
target_compile_options(mcu-driver-hal INTERFACE $<$<COMPILE_LANGUAGE:C>:-O2>)
endif()
endif()

# Mbedtls config
Expand Down Expand Up @@ -279,66 +298,84 @@ list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS
)

function(sdk_post_build target)
string(REPLACE "_ns" "" APP_NAME ${APP_TARGET})
string(REPLACE "_ns" "" APP_NAME ${target})
if(TFM_SUPPORT)
include(ConvertElfToBin)
include(SignTfmImage)
target_elf_to_bin(${APP_TARGET})
iotsdk_tf_m_sign_image(${APP_TARGET})
iotsdk_tf_m_merge_images(${APP_TARGET} 0x10000000 0x38000000 0x28060000)
ExternalProject_Get_Property(trusted-firmware-m-build BINARY_DIR)
target_elf_to_bin(${target})
add_custom_command(
TARGET
${target}
POST_BUILD
DEPENDS
$<TARGET_FILE_DIR:${target}>/${target}.bin
COMMAND
# Sign the non-secure (application) image for TF-M bootloader (BL2)"
python3 ${BINARY_DIR}/install/image_signing/scripts/wrapper/wrapper.py
--layout ${BINARY_DIR}/install/image_signing/layout_files/signing_layout_ns.o
-v ${MCUBOOT_IMAGE_VERSION_NS}
-k ${BINARY_DIR}/install/image_signing/keys/root-RSA-3072_1.pem
--public-key-format full
--align 1 --pad --pad-header -H 0x400 -s auto -d "(0, 0.0.0+0)"
$<TARGET_FILE_DIR:${target}>/${target}.bin
--overwrite-only
--measured-boot-record
$<TARGET_FILE_DIR:${target}>/${target}_signed.bin
VERBATIM
)
iotsdk_tf_m_merge_images(${target} 0x10000000 0x38000000 0x28060000)
# Cleanup
add_custom_command(
TARGET
${APP_TARGET}
${target}
POST_BUILD
DEPENDS
$<TARGET_FILE_DIR:${APP_TARGET}>/tfm_s_signed.bin
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}.bin
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}_signed.bin
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}_merged.hex
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}_merged.elf
$<TARGET_FILE_DIR:${target}>/${target}.bin
$<TARGET_FILE_DIR:${target}>/${target}_signed.bin
$<TARGET_FILE_DIR:${target}>/${target}_merged.hex
$<TARGET_FILE_DIR:${target}>/${target}_merged.elf
COMMAND
# Copy the TF-M secure elf image
# Copy the bootloader and TF-M secure image for debugging purposes
${CMAKE_COMMAND} -E copy
${BINARY_DIR}/install/outputs/bl2.elf
${BINARY_DIR}/install/outputs/tfm_s.elf
$<TARGET_FILE_DIR:${APP_TARGET}>/
$<TARGET_FILE_DIR:${target}>/
COMMAND
# Rename output file
${CMAKE_COMMAND} -E copy
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}_merged.elf
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_NAME}.elf
$<TARGET_FILE_DIR:${target}>/${target}_merged.elf
$<TARGET_FILE_DIR:${target}>/${APP_NAME}.elf
COMMAND rm
ARGS -Rf
$<TARGET_FILE_DIR:${APP_TARGET}>/tfm_s_signed.bin
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}.bin
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}_signed.bin
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}_merged.hex
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}_merged.elf
$<TARGET_FILE_DIR:${target}>/${target}.bin
$<TARGET_FILE_DIR:${target}>/${target}_signed.bin
$<TARGET_FILE_DIR:${target}>/${target}_merged.hex
$<TARGET_FILE_DIR:${target}>/${target}_merged.elf
VERBATIM
)
else()
add_custom_command(
TARGET
${APP_TARGET}
${target}
POST_BUILD
DEPENDS
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}.elf
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}.map
$<TARGET_FILE_DIR:${target}>/${target}.elf
$<TARGET_FILE_DIR:${target}>/${target}.map
COMMAND
# Rename output elf file
${CMAKE_COMMAND} -E copy
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}.elf
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_NAME}.elf
$<TARGET_FILE_DIR:${target}>/${target}.elf
$<TARGET_FILE_DIR:${target}>/${APP_NAME}.elf
COMMAND
# Rename output map file
${CMAKE_COMMAND} -E copy
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}.map
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_NAME}.map
$<TARGET_FILE_DIR:${target}>/${target}.map
$<TARGET_FILE_DIR:${target}>/${APP_NAME}.map
COMMAND rm
ARGS -Rf
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}.elf
$<TARGET_FILE_DIR:${APP_TARGET}>/${APP_TARGET}.map
$<TARGET_FILE_DIR:${target}>/${target}.elf
$<TARGET_FILE_DIR:${target}>/${target}.map
VERBATIM
)
endif() #TFM_SUPPORT
Expand Down
2 changes: 1 addition & 1 deletion config/openiotsdk/ld/cs300_gcc_tfm.ld
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
MEMORY
{
FLASH (rx) : ORIGIN = ((0x28000000) + (0x60000) + (0x400)), LENGTH = ((0x200000) - (0x400) - (0x800))
RAM (rwx) : ORIGIN = 0x21000000, LENGTH = 0x100000
RAM (rwx) : ORIGIN = 0x21000000, LENGTH = 0x200000
}

__stack_size__ = 0x1000;
Expand Down
33 changes: 28 additions & 5 deletions config/openiotsdk/lwip/user_lwipopts.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2022 Project CHIP Authors
* Copyright (c) 2022-2023 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -19,12 +19,35 @@
#ifndef USER_LWIPOPTS_H
#define USER_LWIPOPTS_H

/**
* MEM_LIBC_MALLOC: use malloc/free/realloc provided by your C-library
* instead of the lwip internal allocator.
*/
#define MEM_LIBC_MALLOC (1)

/**
* MEMP_NUM_NETBUF: the number of struct netbufs.
*/
#define MEMP_NUM_NETBUF 16

/**
* PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
*
* Some unit tests required more pbuf buffers.
*/
#ifdef CHIP_LIB_TESTS
#define PBUF_POOL_SIZE (1001)
#endif // CHIP_LIB_TESTS

/**
* LWIP_STATS : Turn off statistics gathering
*/
#define LWIP_STATS (0)
#define LWIP_IGMP (1)
#define LWIP_RAW (1)

#define MEM_LIBC_MALLOC (1)
#define MEM_USE_POOLS (0)
/**
* LWIP_RAW: Enable application layer to hook into the IP layer itself.
*/
#define LWIP_RAW (1)

#ifdef LWIP_DEBUG

Expand Down
Loading

0 comments on commit 1122680

Please sign in to comment.