Skip to content

Commit

Permalink
Merge pull request #16 from sakura-internet/feat/port_sdk1.7.1
Browse files Browse the repository at this point in the history
β4対応版
  • Loading branch information
f-okuhara authored Feb 28, 2022
2 parents 9fa4999 + 4f62f9b commit 34262ca
Show file tree
Hide file tree
Showing 57 changed files with 3,369 additions and 1,814 deletions.
10 changes: 5 additions & 5 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
Language: Cpp
BasedOnStyle: LLVM
BasedOnStyle: LLVM
SortIncludes: false
TabWidth: 2
IndentWidth: 2
TabWidth: 4
IndentWidth: 4
AllowAllParametersOfDeclarationOnNextLine: false
ColumnLimit: 1000

Expand All @@ -19,7 +19,7 @@ BreakBeforeBraces: Mozilla
# AllowAllParametersOfDeclarationOnNextLine: true
# AllowShortBlocksOnASingleLine: false
# AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: All
AllowShortFunctionsOnASingleLine: None
# AllowShortIfStatementsOnASingleLine: false
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None
Expand Down Expand Up @@ -99,4 +99,4 @@ BreakBeforeBraces: Mozilla
# Standard: Cpp11
# TabWidth: 8
# UseTab: Never
#
#
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
cmake_minimum_required(VERSION 3.13.1)

set(BOARD_ROOT ${CMAKE_SOURCE_DIR})
set(DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/dts.overlay")
set(ZEPHYR_EXTRA_MODULES
${CMAKE_SOURCE_DIR}/lib/sipf
)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(sipf-nrf91-std)
Expand All @@ -18,8 +20,7 @@ target_sources(app PRIVATE
src/cmd_ascii.c
src/registers.c
src/uart_broker.c
src/sipf/sipf_client_http.c
src/sipf/sipf_object.c
src/xmodem.c
src/fota/fota_http.c
src/gnss/gnss.c
)
Expand Down
45 changes: 12 additions & 33 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@

menu "SIPF standard client"

config SIPF_AUTH_HOST
string "SIPF AUTH host name."
config SIPF_AUTH_PATH
string "SIPF AUTH endpoint."
config SIPF_APP_TYPE
int "Application type"

config SIPF_APP_VER_MAJOR
int "Application Major version"

config SIPF_APP_VER_MINOR
int "Application Minor version"

config SIPF_CONNECTOR_HTTP_HOST
string "SIPF CONNECTOR HTTP host name."
config SIPF_CONNECTOR_PATH
string "SIPF CONNECTOR HTTP endpoint."
config SIPF_APP_VER_RELEASE
int "Application Release version"

config SIPF_FOTA_HOST
string "Application update host name"
Expand All @@ -30,38 +32,15 @@ config SIPF_FOTA_PATH
if the file is stored in http://foo.bar/update.bin the value
of this configuration should be 'update.bin'

config SIPF_APP_TYPE
int "Application type"

config SIPF_APP_VER_MAJOR
int "Application Major version"

config SIPF_APP_VER_MINOR
int "Application Minor version"

config SIPF_APP_VER_RELEASE
int "Application Release version"

#config APPLICATION_VERSION
# int "Application version"
# default 1
#
#config USE_HTTPS
# bool
# prompt "Use HTTPS for download"

config SIPF_FOTA_TLS
bool "Enable SSL for FOTA client."

endmenu

menu "Zephyr Kernel"
source "Kconfig.zephyr"
endmenu

module = SIPF
module-str = SIPF
source "subsys/logging/Kconfig.template.log_config"


module = FOTA
module-str = Firmware over the Air
source "subsys/logging/Kconfig.template.log_config"
Expand Down
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Target divice are SCO-M5SNRF9160 and SCM-LTEM1NRF.
See [nRF Connect SDK Getting started](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/getting_started.html).
If you want to install the development environment quickly, see [Installing the nRF Connect SDK through nRF Connect for Desktop](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_assistant.html#gs-assistant).

Using nRF Connect SDK v1.5.1 .
Using nRF Connect SDK v1.7.1 .

### Clone this repository

Expand All @@ -29,16 +29,40 @@ rm -rf build

### Build

For develop
Use `build.sh` for build.

```
./build.sh [target] [board]
```

target

- develop (default)
- staging
- production
- local

board

- scm-ltem1nrf_nrf9160ns (default)
- nrf9160dk_nrf9160_ns
- thingy91_nrf9160_ns

For develop / SCM-LTEM1NRF and SCO-M5SNRF9160
```
./build.sh
```

For production
For production / SCM-LTEM1NRF and SCO-M5SNRF9160
```
./build.sh production
```

For production / nRF9160DK
```
./build.sh production nrf9160dk_nrf9160_ns
```

For local only
```
cp -n prj.conf.develop prj.conf.local
Expand Down
14 changes: 0 additions & 14 deletions boards/arm/m5stack_nrf9160/Kconfig.board

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nRF9160 M5Stack board configuration
# SCM-LTEM1NRF/SCO-M5SNRF9160 board configuration

# Copyright (c) 2018 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
14 changes: 14 additions & 0 deletions boards/arm/scm-ltem1nrf_nrf9160/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SCM-LTEM1NRF/SCO-M5SNRF9160 board configuration

# Copyright (c) 2018-2020 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

if SOC_NRF9160_SICA

config BOARD_SCM_LTEM1NRF_NRF9160
bool "SCM-LTEM1NRF/SCO-M5SNRF9160"

config BOARD_SCM_LTEM1NRF_NRF9160NS
bool "SCM-LTEM1NRF/SCO-M5SNRF9160 non-secure"

endif # SOC_NRF9160_SICA
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# nRF9160 M5Stack NRF9160 board configuration
# SCM-LTEM1NRF/SCO-M5SNRF9160 board configuration

# Copyright (c) 2018-2020 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

if BOARD_M5STACK_NRF9160 || BOARD_M5STACK_NRF9160NS
if BOARD_SCM_LTEM1NRF_NRF9160 || BOARD_SCM_LTEM1NRF_NRF9160NS

config BOARD
default "m5stack_nrf9160"
default "scm-ltem1nrf_nrf9160"

# For the secure version of the board the firmware is linked at the beginning
# of the flash, or into the code-partition defined in DT if it is intended to
Expand All @@ -25,14 +25,14 @@ config FLASH_LOAD_SIZE
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
depends on BOARD_M5STACK_NRF9160 && TRUSTED_EXECUTION_SECURE

if BOARD_M5STACK_NRF9160NS
if BOARD_SCM_LTEM1NRF_NRF9160NS

config FLASH_LOAD_OFFSET
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))

config FLASH_LOAD_SIZE
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))

endif # BOARD_M5STACK_NRF9160NS
endif # BOARD_SCM_LTEM1NRF_NRF9160NS

endif # BOARD_M5STACK_NRF9160 || BOARD_M5STACK_NRF9160NS
endif # BOARD_SCM_LTEM1NRF_NRF9160 || BOARD_SCM_LTEM1NRF_NRF9160NS
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/dts-v1/;
#include <nordic/nrf9160_sica.dtsi>
#include "m5stack_nrf9160_common.dts"
#include "scm-ltem1nrf_nrf9160_common.dts"

/ {
chosen {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
identifier: m5stack_nrf9160
name: M5Stack-NRF9160
identifier: scm-ltem1nrf_nrf9160
name: SCM-LTEM1NRF-NRF9160
type: mcu
arch: arm
toolchain:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/ {
model = "Nordic nRF9160 M5Stack NRF9160";
model = "SCM-LTEM1NRF/SCO-M5SNRF9160";
compatible = "nordic,nrf9160-dk-nrf9160";

chosen {
Expand Down Expand Up @@ -188,4 +188,4 @@
};

/* Include partition configuration file */
#include "m5stack_nrf9160_partition_conf.dts"
#include "scm-ltem1nrf_nrf9160_partition_conf.dts"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

CONFIG_SOC_SERIES_NRF91X=y
CONFIG_SOC_NRF9160_SICA=y
CONFIG_BOARD_M5STACK_NRF9160=y
CONFIG_BOARD_SCM_LTEM1NRF_NRF9160=y

# Enable MPU
CONFIG_ARM_MPU=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/dts-v1/;
#include <nordic/nrf9160ns_sica.dtsi>
#include "m5stack_nrf9160_common.dts"
#include "scm-ltem1nrf_nrf9160_common.dts"

/ {
chosen {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
identifier: m5stack_nrf9160ns
name: M5Stack-NRF9160-Non-Secure
identifier: scm-ltem1nrf_nrf9160ns
name: SCM-LTEM1NRF-NRF9160-Non-Secure
type: mcu
arch: arm
toolchain:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

CONFIG_SOC_SERIES_NRF91X=y
CONFIG_SOC_NRF9160_SICA=y
CONFIG_BOARD_M5STACK_NRF9160NS=y
CONFIG_BOARD_SCM_LTEM1NRF_NRF9160NS=y

# Enable MPU
CONFIG_ARM_MPU=y
Expand Down
7 changes: 7 additions & 0 deletions boards/thingy91_nrf9160_ns.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/ {
aliases {
led1 = &sense_red_led;
led2 = &sense_green_led;
led3 = &sense_blue_led;
};
};
8 changes: 6 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
#!/bin/bash -xe

TARGET_BOARD=m5stack_nrf9160ns
TARGET_BOARD=scm-ltem1nrf_nrf9160ns
TARGET_ENV=develop

if [ -n "$1" ]; then
TARGET_ENV="$1"
fi

if [ -n "$2" ]; then
TARGET_BOARD="$2"
fi


PRJ_BASE_FILE="prj.conf.base"
PRJ_FILE="prj.conf.$TARGET_ENV"
BUILD_DIR=build/$TARGET_ENV/
BUILD_DIR=build/$TARGET_BOARD/$TARGET_ENV/

if [ ! -e "$PRJ_FILE" ]; then
echo "Invalid environment $TARGET_ENV"
Expand Down
10 changes: 0 additions & 10 deletions dts.overlay

This file was deleted.

8 changes: 6 additions & 2 deletions flash.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
#!/bin/bash -xe

TARGET_BOARD=m5stack_nrf9160ns
TARGET_BOARD=scm-ltem1nrf_nrf9160ns
TARGET_ENV=develop

if [ -n "$1" ]; then
TARGET_ENV="$1"
fi

if [ -n "$2" ]; then
TARGET_BOARD="$2"
fi


PRJ_BASE_FILE="prj.conf.base"
PRJ_FILE="prj.conf.$TARGET_ENV"
BUILD_DIR=build/$TARGET_ENV/
BUILD_DIR=build/$TARGET_BOARD/$TARGET_ENV/

if [ ! -e "$PRJ_FILE" ]; then
echo "Invalid environment $TARGET_ENV"
Expand Down
2 changes: 1 addition & 1 deletion format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function format() {
clang-format -i -style=file "${filename}"
}

TARGETS="./src ./include"
TARGETS="./src ./include ./lib"
BLACK_LIST=("debug.h" "usbh_conf.h")

for directory in ${TARGETS}; do
Expand Down
4 changes: 2 additions & 2 deletions include/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ typedef enum { CMD_STATE_WAIT = 0, CMD_STATE_BUFFERING_ASCII, CMD_STATE_BUFFERIN

typedef struct
{
uint8_t *response;
uint16_t response_len;
uint8_t *response;
uint16_t response_len;
} CmdResponse;

CmdResponse *CmdParse(uint8_t b);
Loading

0 comments on commit 34262ca

Please sign in to comment.