Skip to content

Commit

Permalink
Build against Zephyr v2.7.0 (#40)
Browse files Browse the repository at this point in the history
- Build against Zephyr v2.7.0
- Restrict build to PLT Demo V1 (`ly10demo`) board
- rename artifacts
  • Loading branch information
IvoBCD authored Nov 6, 2021
1 parent 31b6222 commit f09334f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 193 deletions.
6 changes: 4 additions & 2 deletions .github/actions/action-zephyr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#
# Copyright (c) 2019 Blue Clover Devices
# Copyright (c) 2019-2021 Blue Clover Devices
#
# SPDX-License-Identifier: Apache-2.0
#

FROM bcdevices/zephyr-west:zephyr-2.6.0-0
FROM ghcr.io/bcdevices/zephyr:2.7.0-1

WORKDIR /usr/src/

ADD entrypoint.sh /entrypoint.sh

Expand Down
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#
# Copyright (c) 2019 Blue Clover Devices
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2020-2021 Blue Clover Devices

FROM bcdevices/zephyr-west:zephyr-2.6.0-0
FROM ghcr.io/bcdevices/zephyr:2.7.0-1

WORKDIR /usr/src/
## Copy everything (use .dockerignore to exclude)
Expand Down
157 changes: 5 additions & 152 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,129 +28,10 @@ DOCKER_BUILD_ARGS += --network=host
DOCKER_RUN_ARGS :=
DOCKER_RUN_ARGS += --network=none

BOARDS_COMMON :=
BOARDS_COMMON += nrf52dk_nrf52832
BOARDS_COMMON += nrf9160dk_nrf9160
BOARDS_COMMON += stm32f4_disco
BOARDS_COMMON += nucleo_f207zg
BOARDS_COMMON += nucleo_f401re
BOARDS_COMMON += nucleo_l432kc
BOARDS_COMMON += disco_l475_iot1

BLINKY_TARGETS := $(patsubst %,build.%/blinky/zephyr/zephyr.hex,$(BOARDS_COMMON))

BOARDS_BUTTON :=
BOARDS_BUTTON += nrf52dk_nrf52832
BOARDS_BUTTON += nrf9160dk_nrf9160
BOARDS_BUTTON += stm32f4_disco
BOARDS_BUTTON += nucleo_f207zg
BOARDS_BUTTON += nucleo_f401re
BOARDS_BUTTON += disco_l475_iot1

BUTTON_TARGETS := $(patsubst %,build.%/button/zephyr/zephyr.hex,$(BOARDS_BUTTON))

BOARDS_CAN :=
BOARDS_CAN += stm32f4_disco
BOARDS_CAN += nucleo_l432kc

CAN_TARGETS := $(patsubst %,build.%/can/zephyr/zephyr.hex,$(BOARDS_CAN))

BOARDS_GSM_MODEM :=
BOARDS_GSM_MODEM += nrf52dk_nrf52832
#BOARDS_GSM_MODEM += stm32f4_disco # undefined references to `sys_rand32_get'
#BOARDS_GSM_MODEM += nucleo_l432kc # undefined references to `sys_rand32_get'
BOARDS_GSM_MODEM += disco_l475_iot1

GSM_MODEM_TARGETS := $(patsubst %,build.%/gsm_modem/zephyr/zephyr.hex,$(BOARDS_GSM_MODEM))

BOARDS_SERVO_MOTOR :=
#BOARDS_SERVO_MOTOR += nrf52dk_nrf52832 # Unsupported board
#BOARDS_SERVO_MOTOR += nrf9160dk_nrf9160 # Unsupported board

SERVO_MOTOR_TARGETS := $(patsubst %,build.%/servo_motor/zephyr/zephyr.hex,$(BOARDS_SERVO_MOTOR))

SHELL_TARGETS := $(patsubst %,build.%/shell/zephyr/zephyr.hex,$(BOARDS_COMMON))

ZEPHYR_TAG := 2.6.0
ZEPHYR_TAG := 2.7.0
ZEPHYR_SYSROOT := /usr/src/zephyr-$(ZEPHYR_TAG)/zephyr
ZEPHYR_USRROOT := $(HOME)/src/zephyr-$(ZEPHYR_TAG)/zephyr

build.%/blinky/zephyr/zephyr.hex:
mkdir -p build.$*/blinky
if [ -d $(ZEPHYR_USRROOT) ]; then source $(ZEPHYR_USRROOT)/zephyr-env.sh ; \
elif [ -d $(ZEPHYR_SYSROOT) ]; then source $(ZEPHYR_SYSROOT)/zephyr-env.sh ; \
else echo "No Zephyr"; fi && \
west build --build-dir build.$*/blinky \
--board $* --pristine auto \
$$ZEPHYR_BASE/samples/basic/blinky

build.%/button/zephyr/zephyr.hex:
mkdir -p build.$*/button
if [ -d $(ZEPHYR_USRROOT) ]; then source $(ZEPHYR_USRROOT)/zephyr-env.sh ; \
elif [ -d $(ZEPHYR_SYSROOT) ]; then source $(ZEPHYR_SYSROOT)/zephyr-env.sh ; \
else echo "No Zephyr"; fi && \
west build --build-dir build.$*/button \
--board $* --pristine auto \
$$ZEPHYR_BASE/samples/basic/button

build.%/gsm_modem/zephyr/zephyr.hex:
mkdir -p build.$*/gsm_modem
if [ -d $(ZEPHYR_USRROOT) ]; then source $(ZEPHYR_USRROOT)/zephyr-env.sh ; \
elif [ -d $(ZEPHYR_SYSROOT) ]; then source $(ZEPHYR_SYSROOT)/zephyr-env.sh ; \
else echo "No Zephyr"; fi && \
west build --build-dir build.$*/gsm_modem \
--board $* --pristine auto \
$$ZEPHYR_BASE/samples/net/gsm_modem

build.%/servo_motor/zephyr/zephyr.hex:
mkdir -p build.$*/servo_motor
if [ -d $(ZEPHYR_USRROOT) ]; then source $(ZEPHYR_USRROOT)/zephyr-env.sh ; \
elif [ -d $(ZEPHYR_SYSROOT) ]; then source $(ZEPHYR_SYSROOT)/zephyr-env.sh ; \
else echo "No Zephyr"; fi && \
west build --build-dir build.$*/servo_motor \
--board $* --pristine auto \
$$ZEPHYR_BASE/samples/basic/servo_motor

build.%/shell/zephyr/zephyr.hex:
mkdir -p build.$*/shell
if [ -d $(ZEPHYR_USRROOT) ]; then source $(ZEPHYR_USRROOT)/zephyr-env.sh ; \
elif [ -d $(ZEPHYR_SYSROOT) ]; then source $(ZEPHYR_SYSROOT)/zephyr-env.sh ; \
else echo "No Zephyr"; fi && \
west build --build-dir build.$*/shell \
--board $* --pristine auto \
$$ZEPHYR_BASE/samples/subsys/shell/shell_module

build.%/can/zephyr/zephyr.hex:
mkdir -p build.$*/can
if [ -d $(ZEPHYR_USRROOT) ]; then source $(ZEPHYR_USRROOT)/zephyr-env.sh ; \
elif [ -d $(ZEPHYR_SYSROOT) ]; then source $(ZEPHYR_SYSROOT)/zephyr-env.sh ; \
else echo "No Zephyr"; fi && \
west build --build-dir build.$*/can \
--board $* --pristine auto \
$$ZEPHYR_BASE/samples/drivers/can

.PHONY: build-blinky
build-blinky: $(BLINKY_TARGETS)

.PHONY: build-button
build-button: $(BUTTON_TARGETS)

.PHONY: build-gsm_modem
build-gsm_modem: $(GSM_MODEM_TARGETS)

.PHONY: build-servo_motor
build-servo_motor: $(SERVO_MOTOR_TARGETS)

.PHONY: build-shell
build-shell: $(SHELL_TARGETS)

.PHONY: build-CAN
build-CAN: $(CAN_TARGETS)

.PHONY: build-zephyr-samples
#build-zephyr-samples: build-blinky build-button build-shell build-CAN build-gsm_modem build-servo_motor
build-zephyr-samples: build-blinky build-button build-shell build-CAN build-gsm_modem

ZEPHYR_BOARD_ROOT := $(BASE_PATH)

BOARDS_APP :=
Expand All @@ -172,7 +53,7 @@ versions:
@echo "VERSION_TAG: $(VERSION_TAG)"

.PHONY: build
build: build-zephyr-samples $(APP_TARGETS)
build: $(APP_TARGETS)

.PHONY: clean
clean:
Expand All @@ -196,37 +77,9 @@ dist-clean:

.PHONY: dist
dist: dist-clean dist-prep build
install -m 666 build.disco_l475_iot1/blinky/zephyr/zephyr.hex dist/zephyr-disco_l475_iot1-sample-blinky-$(VERSION_TAG).hex
install -m 666 build.disco_l475_iot1/button/zephyr/zephyr.hex dist/zephyr-disco_l475_iot1-sample-button-$(VERSION_TAG).hex
install -m 666 build.disco_l475_iot1/gsm_modem/zephyr/zephyr.hex dist/zephyr-disco_l475_iot1-sample-gsm_modem-$(VERSION_TAG).hex
install -m 666 build.disco_l475_iot1/shell/zephyr/zephyr.hex dist/zephyr-disco_l475_iot1-sample-shell-$(VERSION_TAG).hex
install -m 666 build.ly10demo/app/zephyr/zephyr.hex dist/demo-board-zephyr-fw-$(VERSION_TAG).hex
install -m 666 build.ly10demo/app/zephyr/zephyr.elf dist/demo-board-zephyr-fw-$(VERSION_TAG).elf
install -m 666 build.ly10demo/app/zephyr/zephyr.map dist/demo-board-zephyr-fw-$(VERSION_TAG).map
#install -m 666 build.nrf52dk_nrf52832/servo_motor/zephyr/zephyr.hex dist/zephyr-nrf52dk_nrf528320-sample-servo_motor-$(VERSION_TAG).hex
install -m 666 build.nrf52dk_nrf52832/blinky/zephyr/zephyr.hex dist/zephyr-nrf52dk_nrf52832-sample-blinky-$(VERSION_TAG).hex
install -m 666 build.nrf52dk_nrf52832/button/zephyr/zephyr.hex dist/zephyr-nrf52dk_nrf52832-sample-button-$(VERSION_TAG).hex
install -m 666 build.nrf52dk_nrf52832/gsm_modem/zephyr/zephyr.hex dist/zephyr-nrf52dk_nrf52832-sample-gsm_modem-$(VERSION_TAG).hex
install -m 666 build.nrf52dk_nrf52832/shell/zephyr/zephyr.hex dist/zephyr-nrf52dk_nrf52832-sample-shell-$(VERSION_TAG).hex
install -m 666 build.nrf9160dk_nrf9160/blinky/zephyr/zephyr.hex dist/zephyr-nrf9160dk_nrf9160-sample-blinky-$(VERSION_TAG).hex
install -m 666 build.nrf9160dk_nrf9160/button/zephyr/zephyr.hex dist/zephyr-nrf9160dk_nrf9160-sample-button-$(VERSION_TAG).hex
#install -m 666 build.nrf9160dk_nrf9160/servo_motor/zephyr/zephyr.hex dist/zephyr-nrf9160dk_nrf9160-sample-servo_motor-$(VERSION_TAG).hex
install -m 666 build.nrf9160dk_nrf9160/shell/zephyr/zephyr.hex dist/zephyr-nrf9160dk_nrf9160-sample-shell-$(VERSION_TAG).hex
install -m 666 build.nucleo_f207zg/blinky/zephyr/zephyr.hex dist/zephyr-nucleo_f207zg-sample-blinky-$(VERSION_TAG).hex
install -m 666 build.nucleo_f207zg/button/zephyr/zephyr.hex dist/zephyr-nucleo_f207zg-sample-button-$(VERSION_TAG).hex
install -m 666 build.nucleo_f207zg/shell/zephyr/zephyr.hex dist/zephyr-nucleo_f207zg-sample-shell-$(VERSION_TAG).hex
install -m 666 build.nucleo_f401re/blinky/zephyr/zephyr.hex dist/zephyr-nucleo_f401re-sample-blinky-$(VERSION_TAG).hex
install -m 666 build.nucleo_f401re/button/zephyr/zephyr.hex dist/zephyr-nucleo_f401re-sample-button-$(VERSION_TAG).hex
install -m 666 build.nucleo_f401re/shell/zephyr/zephyr.hex dist/zephyr-nucleo_f401re-sample-shell-$(VERSION_TAG).hex
install -m 666 build.nucleo_l432kc/blinky/zephyr/zephyr.hex dist/zephyr-nucleo_l432kc-sample-blinky-$(VERSION_TAG).hex
install -m 666 build.nucleo_l432kc/can/zephyr/zephyr.hex dist/zephyr-nucleo_l432kc-sample-can-$(VERSION_TAG).hex
#install -m 666 build.nucleo_l432kc/gsm_modem/zephyr/zephyr.hex dist/zephyr-nucleo_l432kc-sample-gsm_modem-$(VERSION_TAG).hex
install -m 666 build.nucleo_l432kc/shell/zephyr/zephyr.hex dist/zephyr-nucleo_l432kc-sample-shell-$(VERSION_TAG).hex
install -m 666 build.stm32f4_disco/blinky/zephyr/zephyr.hex dist/zephyr-stm32f4_disco-sample-blinky-$(VERSION_TAG).hex
install -m 666 build.stm32f4_disco/button/zephyr/zephyr.hex dist/zephyr-stm32f4_disco-sample-button-$(VERSION_TAG).hex
install -m 666 build.stm32f4_disco/can/zephyr/zephyr.hex dist/zephyr-stm32f4_disco-sample-can-$(VERSION_TAG).hex
#install -m 666 build.stm32f4_disco/gsm_modem/zephyr/zephyr.hex dist/zephyr-stm32f4_disco-sample-gsm_modem-$(VERSION_TAG).hex
install -m 666 build.stm32f4_disco/shell/zephyr/zephyr.hex dist/zephyr-stm32f4_disco-sample-shell-$(VERSION_TAG).hex
install -m 666 build.ly10demo/app/zephyr/zephyr.hex dist/app-pltdemov1-$(VERSION_TAG).hex
install -m 666 build.ly10demo/app/zephyr/zephyr.elf dist/app-pltdemov1-$(VERSION_TAG).elf
install -m 666 build.ly10demo/app/zephyr/zephyr.map dist/app-pltdemov1-$(VERSION_TAG).map
sed 's/{{VERSION}}/$(VERSION_TAG)/g' test-suites/suite-demo-board-zephyr.yaml.template > dist/suite-demo-board-zephyr-$(VERSION_TAG).yaml

.PHONY: deploy
Expand Down
2 changes: 1 addition & 1 deletion app/src/app_ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int app_ble(void)
// Get MAC Address
// '1' as first parameter indicates we are seeking the 'random'
// BD address
uint8_t *bd_addr = (uint8_t *) ll_addr_get(1, NULL);
uint8_t *bd_addr = (uint8_t *) ll_addr_get(1);

printk("Random BD Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
bd_addr[5], bd_addr[4], bd_addr[3],
Expand Down
9 changes: 0 additions & 9 deletions boards/arm/ly10demo/ly10demo.dts
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ arduino_serial: &uart0 {
ch0-inverted;
};

&sw_pwm {
timer-instance = <1>;
channel-count = <3>;
clock-prescaler = <0>;
ppi-base = <7>;
gpiote-base = <0>;
status = "disabled";
};

&spi0 {
compatible = "nordic,nrf-spi";
/* status = "okay"; */
Expand Down
50 changes: 25 additions & 25 deletions test-suites/suite-demo-board-zephyr.yaml.template
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
title: "Zephyr v{{VERSION}}"
title: "Demo v{{VERSION}}"
suite:
- ident: ICT-T0
title: Power on
steps:
- command: power SWD on
- ident: ICT-T1
title: Identify DUT
steps:
- command: identify nRF52
- ident: ICT-T2
title: Erase nRF52
steps:
- command: erase nRF52
- ident: ICT-T3
title: Program LY10-DEMO-BOARD FW
steps:
- command: program nRF52 none,demo-board-zephyr-fw-{{VERSION}}.hex,none
- ident: ICT-T4
title: BLE discovery
steps:
- command: bledis %BLEMAC% 5
- ident: ICT-T5
title: Power off
steps:
- command: power off
- ident: ICT-T0
title: Power on
steps:
- command: power SWD on
- ident: ICT-T1
title: Identify DUT
steps:
- command: identify nRF52
- ident: ICT-T2
title: Erase nRF52
steps:
- command: erase nRF52
- ident: ICT-T3
title: Program PLTDemoV1 board FW
steps:
- command: program nRF52 app-pltdemov1-{{VERSION}}.hex
- ident: ICT-T4
title: BLE discovery
steps:
- command: bledis %BLEMAC% 5
- ident: ICT-T5
title: Power off
steps:
- command: power off

0 comments on commit f09334f

Please sign in to comment.