Skip to content

Commit

Permalink
Merge pull request #59 from adamfowleruk/feature-42
Browse files Browse the repository at this point in the history
Ready for final v1.3 beta
Signed-off-by: Adam Fowler <[email protected]>
  • Loading branch information
adamfowleruk authored Apr 12, 2021
2 parents b8bf70a + ef647ef commit 8542a3a
Show file tree
Hide file tree
Showing 118 changed files with 7,198 additions and 4,684 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Output
*.exe
*.so
*.a
**/.DS_Store
**/.DS_Store
**/build-*
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
}
}
]
}
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"filesystem": "cpp",
"strstream": "cpp",
"resumable": "cpp",
"codecvt": "cpp"
"codecvt": "cpp",
"*.rh": "cpp"
}
}
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12)

project(herald VERSION 1.2.0 LANGUAGES CXX)
project(herald VERSION 1.3.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -18,4 +18,5 @@ add_subdirectory(heraldns-cli)
add_subdirectory(herald)
add_subdirectory(herald-tests)
add_subdirectory(herald-programmer)
add_subdirectory(herald-mesh-proxy)
add_subdirectory(herald-mesh-proxy)
add_subdirectory(doxygen)
2 changes: 1 addition & 1 deletion config/zephyr/debug.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CONFIG_GPIO=y
CONFIG_UART_CONSOLE=n

# Debug log settings
CONFIG_LOG_STRDUP_BUF_COUNT=500
CONFIG_LOG_STRDUP_BUF_COUNT=50
CONFIG_LOG_STRDUP_MAX_STRING=160

CONFIG_LOG_DEFAULT_LEVEL=3
Expand Down
19 changes: 11 additions & 8 deletions config/zephyr/nRF52832.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ CONFIG_ENTROPY_GENERATOR=y

# Simple Payload support BEGINS
# Option 1: MBEDTLS
CONFIG_MBEDTLS_VANILLA_BACKEND=y
CONFIG_MBEDTLS_MAC_SHA256_ENABLED=y
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=y
CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h"
#CONFIG_MBEDTLS_VANILLA_BACKEND=y
#CONFIG_MBEDTLS_MAC_SHA256_ENABLED=y
#CONFIG_MBEDTLS=y
#CONFIG_MBEDTLS_BUILTIN=y
#CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h"

# Option 2: TINYCRYPT
# CONFIG_TINYCRYPT_SHA256=y
CONFIG_TINYCRYPT_SHA256=y
# Simple Payload Support ENDS

CONFIG_BT_MAX_CONN=128
# VERIFY above for this machine
#CONFIG_BT_MAX_CONN=20
CONFIG_BT_MAX_CONN=3

# Fix for use of heap in gatt_gm erroring with undefined reference to k_aligned_alloc
CONFIG_HEAP_MEM_POOL_SIZE=8192
21 changes: 21 additions & 0 deletions config/zephyr/nRF52833.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

CONFIG_NRF_SECURITY_RNG=y
CONFIG_ENTROPY_GENERATOR=y

# Simple Payload support BEGINS
# Option 1: MBEDTLS
#CONFIG_MBEDTLS_VANILLA_BACKEND=y
#CONFIG_MBEDTLS_MAC_SHA256_ENABLED=y
#CONFIG_MBEDTLS=y
#CONFIG_MBEDTLS_BUILTIN=y
#CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h"

# Option 2: TINYCRYPT
CONFIG_TINYCRYPT_SHA256=y
# Simple Payload Support ENDS

#CONFIG_BT_MAX_CONN=20
CONFIG_BT_MAX_CONN=10

# Fix for use of heap in gatt_gm erroring with undefined reference to k_aligned_alloc
CONFIG_HEAP_MEM_POOL_SIZE=16384
19 changes: 11 additions & 8 deletions config/zephyr/nRF52840.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ CONFIG_ENTROPY_GENERATOR=y

# Simple Payload support BEGINS
# Option 1: MBEDTLS
CONFIG_MBEDTLS_VANILLA_BACKEND=y
CONFIG_MBEDTLS_MAC_SHA256_ENABLED=y
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=y
CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h"
#CONFIG_MBEDTLS_VANILLA_BACKEND=y
#CONFIG_MBEDTLS_MAC_SHA256_ENABLED=y
#CONFIG_MBEDTLS=y
#CONFIG_MBEDTLS_BUILTIN=y
#CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h"

# Option 2: TINYCRYPT
# CONFIG_TINYCRYPT_SHA256=y
CONFIG_TINYCRYPT_SHA256=y
# Simple Payload Support ENDS

CONFIG_BT_MAX_CONN=128
# VERIFY above for this machine
#CONFIG_BT_MAX_CONN=20
CONFIG_BT_MAX_CONN=10

# Fix for use of heap in gatt_gm erroring with undefined reference to k_aligned_alloc
CONFIG_HEAP_MEM_POOL_SIZE=16384
21 changes: 14 additions & 7 deletions config/zephyr/nRF5340.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ CONFIG_ENTROPY_GENERATOR=y

# Simple Payload support BEGINS
# Option 1: MBEDTLS
CONFIG_MBEDTLS_VANILLA_BACKEND=y
CONFIG_MBEDTLS_MAC_SHA256_ENABLED=y
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=y
CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h"
#CONFIG_MBEDTLS_VANILLA_BACKEND=y
#CONFIG_MBEDTLS_MAC_SHA256_ENABLED=y
#CONFIG_MBEDTLS=y
#CONFIG_MBEDTLS_BUILTIN=y
#CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h"

# Option 2: TINYCRYPT
# CONFIG_TINYCRYPT_SHA256=y
CONFIG_TINYCRYPT_SHA256=y
# Simple Payload Support ENDS

CONFIG_BT_MAX_CONN=64
#CONFIG_BT_MAX_CONN=64
CONFIG_BT_MAX_CONN=10

# Requirement of ncs/v1.5.0/zephyr/drivers/bluetooth/hci/rpmsg_nrf53.c

# Fix for use of heap in gatt_gm erroring with undefined reference to k_aligned_alloc
CONFIG_HEAP_MEM_POOL_SIZE=16384
# 5340 has lots of RAM, so use it
5 changes: 4 additions & 1 deletion config/zephyr/receiver.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_DM=y

# Scanning
CONFIG_BT_SCAN=y
CONFIG_BT_SCAN=y

# Issue #50 to prevent stack overflow in CPU
CONFIG_BT_RX_STACK_SIZE=8192
11 changes: 11 additions & 0 deletions doxygen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.12)

find_package(Doxygen
OPTIONAL_COMPONENTS dot mscgen dia)

doxygen_add_docs(herald-docs
../herald/include
ALL
)

# Output placed in herald-for-cpp/build/doxygen/html
6 changes: 6 additions & 0 deletions herald-tests-zephyr/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@
"xstddef": "cpp",
"xtr1common": "cpp",
"xutility": "cpp"
},
"cmake.configureEnvironment": {
//"BOARD": "nrf52dk_nrf52832"
// "BOARD": "nrf52833dk_nrf52833"
// "BOARD": "nrf52840dk_nrf52840"
"BOARD": "nrf5340dk_nrf5340_cpuapp"
}
}
42 changes: 27 additions & 15 deletions herald-tests-zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,36 +100,48 @@ target_sources(app PRIVATE
${HERALD_SOURCES_ZEPHYR}
# Simple Payload - Choose ONE
# Option 1: MBED TLS
${HERALD_SOURCES_MBEDTLS}
#${HERALD_SOURCES_MBEDTLS}
# Option 2: TinyCrypt
# ${HERALD_SOURCES_TINYCRYPT}
${HERALD_SOURCES_TINYCRYPT}

# Now tests source
# root with main
../herald-tests/datatypes-tests.cpp
#../herald-tests/datatypes-tests.cpp # Passes when split out on 21 Mar 2021
#../herald-tests/datetime-tests.cpp # Passes when split out on 21 Mar 2021
#../herald-tests/randomuuid-tests.cpp # FAILS silently 21 Mar 2021

# Low level
# ../herald-tests/sensorlogger-tests.cpp # Don't run this on Zephyr
../herald-tests/errorcontactlog-tests.cpp
../herald-tests/data-tests.cpp
../herald-tests/blemacaddress-tests.cpp
../herald-tests/targetidentifier-tests.cpp
#../herald-tests/sensorlogger-tests.cpp # Passes on its own 21 Mar 2021
#../herald-tests/data-tests.cpp # Passes on its own 21 Mar 2021
#../herald-tests/datatypesdataderived-tests.cpp # Passes on its own 21 Mar 2021
# These three passed together on 21 Mar 2021
#../herald-tests/errorcontactlog-tests.cpp
#../herald-tests/blemacaddress-tests.cpp
#../herald-tests/targetidentifier-tests.cpp

# mid level
../herald-tests/beaconpayload-tests.cpp
../herald-tests/extendeddata-tests.cpp
../herald-tests/fixedpayload-tests.cpp
../herald-tests/simplepayload-tests.cpp
../herald-tests/bledevice-tests.cpp
../herald-tests/sample-tests.cpp
../herald-tests/ranges-tests.cpp
#../herald-tests/analysisrunner-tests.cpp # Passes on its own 21 Mar 2021
#../herald-tests/analysissensor-tests.cpp # Passes on its own 21 Mar 2021
# These three passed together on 21 Mar 2021
#../herald-tests/beaconpayload-tests.cpp
#../herald-tests/extendeddata-tests.cpp
#../herald-tests/fixedpayload-tests.cpp
#../herald-tests/simplepayload-tests.cpp # Passes on its own 21 Mar 2021
#../herald-tests/bledevice-tests.cpp # SILENTLY FAILS on its own 21 Mar 2021
#../herald-tests/sample-tests.cpp # Passes on its own 21 Mar 2021 (May require hci reflash too)
#../herald-tests/ranges-tests.cpp # FAILS on its own 21 Mar 2021 - Breaks the programmer! Also hard faults.

# high level
# These four passed together on 21 Mar 2021
../herald-tests/advertparser-tests.cpp
../herald-tests/bledatabase-tests.cpp
../herald-tests/blecoordinator-tests.cpp
../herald-tests/coordinator-tests.cpp

# NOTE: All tests that passed individually on 21 Mar 2021 also passed all together in 15 seconds
# This means that the issue is the individual tests, not catch or zephyr specifically, and not RAM issues.
# All together they used 707KB on Flash for the merged.hex file on a nRF5340dk build done on Windows 10.

# now main func
src/main.cpp
)
2 changes: 1 addition & 1 deletion herald-tests-zephyr/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void main(void)
LOG_DBG("Initialising catch");
k_sleep(K_SECONDS(2));

k_tid_t herald_pid = k_thread_create(&herald_thread, herald_stack, 8192,
k_tid_t herald_pid = k_thread_create(&herald_thread, herald_stack, 16384,
(k_thread_entry_t)herald_entry, NULL, NULL, NULL,
-1, K_USER,
K_SECONDS(4));
Expand Down
21 changes: 17 additions & 4 deletions herald-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
cmake_minimum_required(VERSION 3.12)

add_executable(herald-tests
# root with main
# Test templates
test-templates.h

# base data types
datatypes-tests.cpp
datetime-tests.cpp
randomuuid-tests.cpp

# Low level
sensorlogger-tests.cpp
errorcontactlog-tests.cpp
data-tests.cpp
datatypesdataderived-tests.cpp
blemacaddress-tests.cpp
targetidentifier-tests.cpp

Expand All @@ -19,6 +25,8 @@ add_executable(herald-tests
bledevice-tests.cpp
sample-tests.cpp
ranges-tests.cpp
analysisrunner-tests.cpp
analysissensor-tests.cpp

# high level
advertparser-tests.cpp
Expand All @@ -32,9 +40,14 @@ add_executable(herald-tests

include_directories(${herald_SOURCE_DIR})

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# set(THREADS_PREFER_PTHREAD_FLAG ON)
# find_package(Threads REQUIRED)

target_link_libraries(herald-tests PRIVATE herald Threads::Threads)
target_link_libraries(herald-tests PRIVATE herald) # Threads::Threads

#add_compile_options(-Wl,--stack,100000000)
#set_target_properties(herald-tests PROPERTIES LINK_FLAGS -Wl,--stack,10000000)
#set_target_properties(herald-tests PROPERTIES LINK_FLAGS /STACK:10000000)
add_compile_options(/STACK:1000000000000)
set_target_properties(herald-tests PROPERTIES LINK_FLAGS /STACK:1000000000000)
target_compile_features(herald-tests PRIVATE cxx_std_17)
Loading

0 comments on commit 8542a3a

Please sign in to comment.