Skip to content

Commit

Permalink
fix renbase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiktor Grajkowski committed May 15, 2024
1 parent 2ef9d3e commit ddd4e44
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 21 deletions.
2 changes: 1 addition & 1 deletion examples/light-switch-app/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ qpg_executable("light_switch_app") {
}
}

ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld"
ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}${qpg_flavour}/QorvoStack_${qpg_target_ic}${qpg_flavour}.ld"

inputs = [ ldscript ]

Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ qpg_executable("lighting_app") {
}
}

ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld"
ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}${qpg_flavour}/QorvoStack_${qpg_target_ic}${qpg_flavour}.ld"

inputs = [ ldscript ]

Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ qpg_executable("lock_app") {
}
}

ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld"
ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}${qpg_flavour}/QorvoStack_${qpg_target_ic}${qpg_flavour}.ld"

inputs = [ ldscript ]

Expand Down
2 changes: 1 addition & 1 deletion examples/persistent-storage/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ qpg_executable("persistent_storage_app") {

output_dir = root_out_dir

ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld"
ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}${qpg_flavour}/QorvoStack_${qpg_target_ic}${qpg_flavour}.ld"

inputs = [ ldscript ]

Expand Down
2 changes: 1 addition & 1 deletion examples/shell/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ qpg_executable("shell_app") {

defines = []

ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld"
ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}${qpg_flavour}/QorvoStack_${qpg_target_ic}${qpg_flavour}.ld"

inputs = [ ldscript ]

Expand Down
2 changes: 1 addition & 1 deletion examples/thermostat/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ qpg_executable("thermostat") {
}
}

ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld"
ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}${qpg_flavour}/QorvoStack_${qpg_target_ic}${qpg_flavour}.ld"

inputs = [ ldscript ]

Expand Down
14 changes: 13 additions & 1 deletion scripts/build/builders/qpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,37 @@ def GnArgName(self):
raise Exception('Unknown board #: %r' % self)


class QpgFlavour(Enum):
EXT_FLASH = 1

def GnFlavourName(self):
if self == QpgFlavour.EXT_FLASH:
return '_ext_flash'
else:
raise Exception('Unknown flavour #: %r' % self)


class QpgBuilder(GnBuilder):

def __init__(self,
root,
runner,
app: QpgApp = QpgApp.LIGHT,
board: QpgBoard = QpgBoard.QPG6105,
flavour: QpgFlavour = QpgFlavour.EXT_FLASH,
enable_rpcs: bool = False,
update_image: bool = False):
super(QpgBuilder, self).__init__(
root=app.BuildRoot(root),
runner=runner)
self.app = app
self.board = board
self.flavour = flavour
self.enable_rpcs = enable_rpcs
self.update_image = update_image

def GnBuildArgs(self):
args = ['qpg_target_ic=\"%s\"' % self.board.GnArgName()]
args = ['qpg_target_ic=\"%s\" qpg_flavour=\"%s\"' % (self.board.GnArgName(), self.flavour.GnFlavourName())]
if self.enable_rpcs:
args.append('import("//with_pw_rpc.gni")')
if self.update_image:
Expand Down
26 changes: 15 additions & 11 deletions third_party/qpg_sdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ static_library("qpg_mbedtls_alt_lib") {

qpg_make_build("qpg_stack") {
make_sources = [ "${qpg_sdk_root}/Components/Qorvo" ]
make_output = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/QorvoStack/libQorvoStack_${qpg_target_ic}.a" ]
make_output = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/QorvoStack/libQorvoStack_${qpg_target_ic}${qpg_flavour}.a" ]
make_args = [
"-f",
rebase_path(qpg_sdk_root, root_build_dir) +
"/Libraries/Qorvo/QorvoStack/Makefile.QorvoStack_${qpg_target_ic}",
"/Libraries/Qorvo/QorvoStack/Makefile.QorvoStack_${qpg_target_ic}${qpg_flavour}",
"FREERTOS_REPO_DIR=" + rebase_path(chip_root, root_build_dir) +
"/third_party/freertos/repo",
"WORKDIR=" + rebase_path(target_gen_dir, root_build_dir) +
Expand All @@ -116,15 +116,15 @@ qpg_make_build("qpg_stack") {

static_library("qpg_stack_lib") {
deps = [ "${chip_root}/third_party/qpg_sdk:qpg_stack" ]
libs = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/QorvoStack/libQorvoStack_${qpg_target_ic}.a" ]
libs = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/QorvoStack/libQorvoStack_${qpg_target_ic}${qpg_flavour}.a" ]
}

qpg_make_build("qpg_glue") {
make_sources = [ "${qpg_sdk_root}/Components/Qorvo/Matter" ]
make_output = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/MatterQorvoGlue/libMatterQorvoGlue_${qpg_target_ic}_libbuild.a" ]
make_output = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/MatterQorvoGlue/libMatterQorvoGlue_${qpg_target_ic}${qpg_flavour}_libbuild.a" ]
make_args = [
"-f",
rebase_path(qpg_sdk_root, root_build_dir) + "/Libraries/Qorvo/MatterQorvoGlue/Makefile.MatterQorvoGlue_${qpg_target_ic}_libbuild",
rebase_path(qpg_sdk_root, root_build_dir) + "/Libraries/Qorvo/MatterQorvoGlue/Makefile.MatterQorvoGlue_${qpg_target_ic}${qpg_flavour}_libbuild",
"FREERTOS_REPO_DIR=" + rebase_path(chip_root, root_build_dir) +
"/third_party/freertos/repo",
"WORKDIR=" + rebase_path(target_gen_dir, root_build_dir) +
Expand All @@ -133,24 +133,28 @@ qpg_make_build("qpg_glue") {
}
static_library("qpg_glue_lib") {
deps = [ "${chip_root}/third_party/qpg_sdk:qpg_glue" ]
libs = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/MatterQorvoGlue/libMatterQorvoGlue_${qpg_target_ic}_libbuild.a" ]
if (qpg_target_ic == "qpg6105") {
libs = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/MatterQorvoGlue/libMatterQorvoGlue_${qpg_target_ic}${qpg_flavour}_libbuild.a" ]
} else {
assert(false, "QPG target not specified")
}
}

# openthread toevoegen
# bootloader build
#
qpg_make_build("qpg_bootloader") {
make_sources = [ "${qpg_sdk_root}/Libraries/Qorvo/Bootloader" ]
make_output = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/Bootloader_${qpg_target_ic}_compr_secure/libBootloader_${qpg_target_ic}_compr_secure.a" ]
make_output = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/BootloaderSections_${qpg_target_ic}_compr_secure/libBootloaderSections_${qpg_target_ic}_compr_secure.a" ]
make_args = [
"-f",
rebase_path(qpg_sdk_root, root_build_dir) + "/Libraries/Qorvo/Bootloader/Makefile.Bootloader_${qpg_target_ic}_compr_secure",
rebase_path(qpg_sdk_root, root_build_dir) + "/Libraries/Qorvo/Bootloader/Makefile.BootloaderSections_${qpg_target_ic}_compr_secure",
"FREERTOS_REPO_DIR=" + rebase_path(chip_root, root_build_dir) +
"/third_party/freertos/repo",
"WORKDIR=" + rebase_path(target_gen_dir, root_build_dir) +
"/${qpg_sdk_lib_dir}/Bootloader_${qpg_target_ic}_compr_secure",
"/${qpg_sdk_lib_dir}/BootloaderSections_${qpg_target_ic}_compr_secure",
"UMB_WORKDIR=" + rebase_path(target_gen_dir, root_build_dir) +
"/${qpg_sdk_lib_dir}/UMB_${qpg_target_board}_nrt_flash_compr_secure",
"/${qpg_sdk_lib_dir}/Bootloader_QPG6105DK_B01_nrt_flash_compr_secure",
]
}
config("qpg_retain_bootloader") {
Expand All @@ -163,7 +167,7 @@ config("qpg_retain_bootloader") {

static_library("qpg_bootloader_lib") {
deps = [ "${chip_root}/third_party/qpg_sdk:qpg_bootloader" ]
libs = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/Bootloader_${qpg_target_ic}_compr_secure/libBootloader_${qpg_target_ic}_compr_secure.a" ]
libs = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/BootloaderSections_${qpg_target_ic}_compr_secure/libBootloaderSections_${qpg_target_ic}_compr_secure.a" ]
public_configs = [ ":qpg_retain_bootloader" ]
}

Expand Down
30 changes: 30 additions & 0 deletions third_party/qpg_sdk/qpg_platform.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2020 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/chip.gni")
import("${chip_root}/src/crypto/crypto.gni")

declare_args() {
# QPG chip
qpg_target_ic = "unset"
qpg_flavour = ""
}

if (qpg_target_ic == "qpg6105") {
mbedtls_alt_enabled = true
arm_float_abi = "soft"
arm_arch = "armv7e-m"
} else {
assert(qpg_target_ic != "", "qpg_target_ic must be specified")
}
4 changes: 1 addition & 3 deletions third_party/qpg_sdk/qpg_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import("//build_overrides/chip.gni")
import("//build_overrides/jlink.gni")
import("//build_overrides/openthread.gni")
import("//build_overrides/qpg_sdk.gni")
import("qpg_platform.gni")

declare_args() {
# Location of the QPG SDK.
Expand All @@ -36,9 +37,6 @@ declare_args() {
# Enable Sleepy end device
enable_sleepy_device = false

# Enable mbedtls HW acceleration
mbedtls_alt_enabled = true

# OTA parameters
matter_device_vid = ""
matter_device_pid = ""
Expand Down

0 comments on commit ddd4e44

Please sign in to comment.