cfriedt / greybus-for-zephyr

Greybus Module for the Zephyr Real-Time Operating System
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Pin zephyr to a particular commit in west.xml #64

Closed anujdeshpande closed 3 years ago

anujdeshpande commented 3 years ago

Hey @cfriedt - I had to make changes to the patch to be able to apply it. Does this look better? I checked if it applies correctly, but still figuring out the rest of the setup - so can't verify.

anujdeshpande commented 3 years ago

Before fixing the patch, I got the following error on my git apply

base) ➜ zephyr (7162786f83) ✗ git apply --verbose ../greybus/zephyr-dynamic-pthread-stacks.patch
Checking patch include/kernel.h...
error: while searching for:
 */
#define K_INHERIT_PERMS (BIT(3))

#ifdef CONFIG_X86
/* x86 Bitmask definitions for threads user options */

error: patch failed: include/kernel.h:488
error: include/kernel.h: patch does not apply
Checking patch include/posix/pthread.h...
Checking patch lib/posix/Kconfig...
Checking patch lib/posix/pthread.c...
Checking patch tests/posix/common/prj.conf...
Checking patch tests/posix/common/src/main.c...
Checking patch tests/posix/common/src/pthread.c...
Checking patch tests/posix/common/testcase.yaml...
Hunk #1 succeeded at 37 (offset 1 line).

After the above fix, I got an error during build

(base) ➜ zephyr (7162786f83) ✗ west build -b $BOARD  ../greybus/samples/subsys/greybus/net

-- west build: generating a build system
-- Application: /home/anuj/zephyrproject/greybus/samples/subsys/greybus/net
-- Zephyr version: 2.5.99 (/home/anuj/zephyrproject/zephyr)
-- Found Python3: /home/anuj/miniconda3/bin/python3.7 (found suitable exact version "3.7.6") found components: Interpreter
-- Found west (found suitable version "0.9.0", minimum required is "0.7.1")
-- Board: cc1352r_sensortag
-- Cache files will be written to: /home/anuj/.cache/zephyr
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Using toolchain: zephyr 0.12.3 (/home/anuj/zephyr-sdk-0.12.3)
-- Found dtc: /home/anuj/zephyr-sdk-0.12.3/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/anuj/zephyrproject/zephyr/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts
-- Found devicetree overlay: /home/anuj/zephyrproject/greybus/samples/subsys/greybus/net/boards/cc1352r_sensortag.overlay
-- Generated zephyr.dts: /home/anuj/zephyrproject/zephyr/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/anuj/zephyrproject/zephyr/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/anuj/zephyrproject/zephyr/build/zephyr/include/generated/device_extern.h
Parsing /home/anuj/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/anuj/zephyrproject/zephyr/boards/arm/cc1352r_sensortag/cc1352r_sensortag_defconfig'
Merged configuration '/home/anuj/zephyrproject/greybus/samples/subsys/greybus/net/prj.conf'
Merged configuration '/home/anuj/zephyrproject/greybus/samples/subsys/greybus/net/boards/cc1352r_sensortag.conf'
Configuration saved to '/home/anuj/zephyrproject/zephyr/build/zephyr/.config'
Kconfig header saved to '/home/anuj/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/anuj/zephyr-sdk-0.12.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: /home/anuj/zephyrproject/zephyr/build
-- west build: building application
[1/234] Preparing syscall dependency handling

[101/234] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread.c.obj
FAILED: zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread.c.obj
ccache /home/anuj/zephyr-sdk-0.12.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DBUILD_VERSION=zephyr-v2.5.0-656-g7162786f83f9 -DKERNEL -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I../kernel/include -I../arch/arm/include -I../include -Izephyr/include/generated -I../soc/arm/ti_simplelink/cc13x2_cc26x2 -I../lib/libc/newlib/include -I../lib/util/fnmatch/. -I../subsys/net/lib/sockets/. -I../subsys/net/lib/conn_mgr/. -I../subsys/net/lib/dns/. -I/home/anuj/zephyrproject/greybus/include -I/home/anuj/zephyrproject/greybus/subsys/greybus/../../../include -I/home/anuj/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -I/home/anuj/zephyrproject/modules/hal/ti/simplelink/source/ti/devices/cc13x2_cc26x2/. -I/home/anuj/zephyrproject/modules/hal/ti/simplelink/. -I/home/anuj/zephyrproject/modules/hal/ti/simplelink/source -I/home/anuj/zephyrproject/greybus/samples/subsys/greybus/net/../../../../../include -Os -imacros /home/anuj/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -imacros /home/anuj/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/anuj/zephyrproject/greybus/samples/subsys/greybus/net=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/anuj/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/anuj/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -std=c99 -MD -MT zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread.c.obj -MF zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread.c.obj.d -o zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread.c.obj   -c /home/anuj/zephyrproject/zephyr/lib/posix/pthread.c
/home/anuj/zephyrproject/zephyr/lib/posix/pthread.c: In function 'pthread_exit':
/home/anuj/zephyrproject/zephyr/lib/posix/pthread.c:447:15: error: 'struct k_thread' has no member named 'fn_abort'
  447 |   self->thread.fn_abort = zephyr_pthread_stack_reclaim;
      |               ^
[110/234] Building C object zephyr/subsys/net/ip/CMakeFiles/subsys__net__ip.dir/net_if.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/anuj/zephyrproject/zephyr/build

Figuring out what I missed now. Definitely related to the pthread patch by the looks of it, so have marked this PR as WIP

cfriedt commented 3 years ago

@anujdeshpande - it looks like fn_abort was removed in Zephyr commit zephyrproject-rtos/zephyr@c0c8cb0e97617c6b35fc8f27de8c82d74ada11fc .

Likely your build / PR will work if you change master to zephyrproject-rtos/zephyr@fc1b5de4c307a97023520f27058f19db09c4face in west.yml.

This unfortunately pins greybus-for-zephyr to a specific Zephyr commit. A fix for issue #10 should eliminate the issue entirely.

anujdeshpande commented 3 years ago

@cfriedt thanks for the pointer to the commit. Pinning that in west.yml got me to building it the uart sample correctly for cc1352 sensor tag. I've updated my commit for this PR to remove the patch change, and change the west.yml instead.

cfriedt commented 3 years ago

Thanks for your PR @anujdeshpande !