This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use puncover to estimate the maximum stack size of a thread

I am trying to use puncover to estimate the maximum stack size for the created thread.

We also tried the thread analyzer, but gave up on it because it did not seem to be able to analyze thread size without running the program.

However, I believe puncover can estimate the maximum stack size after the build.

I want to run puncover, but I get an error and cannot proceed.

https://docs.zephyrproject.org/latest/develop/optimizations/tools.html

I entered the command by referring to this site.

The build result of the sample project is as follows
den-sekkei10-npc@DESKTOP-DHR8QT9 MINGW64 ~/ncs/v1.6.1/zephyr/samples/hello_world ((v2.6.0-rc1-ncs1))
$ west build -b DKLock2_nrf52832
-- west build: generating a build system
Including boilerplate (Zephyr base): C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world
-- Using NCS Toolchain 1.6.0 for building. (C:/Users/den-sekkei10-npc/ncs/v1.6.0/toolchain/cmake)
-- Zephyr version: 2.6.0-rc1 (C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr), build: v2.6.0-rc1-ncs1
-- Found Python3: C:/Users/den-sekkei10-npc/ncs/v1.6.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
-- Found west (found suitable version "0.11.0", minimum required is "0.7.1")
-- Board: DKLock2_nrf52832
-- Cache files will be written to: C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/.cache
-- Found dtc: C:/Users/den-sekkei10-npc/ncs/v1.6.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (C:/Users/den-sekkei10-npc/ncs/v1.6.0/toolchain/opt)
-- Found BOARD.dts: C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/boards/arm/DKLock2_nrf52832/DKLock2_nrf52832.dts
-- Generated zephyr.dts: C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build/zephyr/include/generated/device_extern.h
Parsing C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/Kconfig
Loaded configuration 'C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/boards/arm/DKLock2_nrf52832/DKLock2_nrf52832_defconfig'
Merged configuration 'C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/prj.conf'
Configuration saved to 'C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build/zephyr/.config'
Kconfig header saved to 'C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/den-sekkei10-npc/ncs/v1.6.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build
-- west build: building application
[1/144] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
[2/144] Generating include/generated/driver-validation.h
[3/144] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
[4/144] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
[5/144] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
[6/144] Generating include/generated/offsets.h
[7/144] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
[8/144] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
[9/144] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/vector_table.S.obj
[10/144] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault_s.S.obj
[11/144] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
[12/144] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/reset.S.obj
[13/144] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/exc_exit.S.obj
[14/144] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
[15/144] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
[16/144] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
[17/144] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/thread_abort.c.obj
[18/144] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
[19/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strstr.c.obj
[20/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strspn.c.obj
[21/144] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/irq_init.c.obj
[22/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/stdout_console.c.obj
[23/144] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
[24/144] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fpu.c.obj
[25/144] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/scb.c.obj
[26/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/string.c.obj
[27/144] Linking C static library zephyr\arch\common\libisr_tables.a
[28/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/atoi.c.obj
[29/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/sprintf.c.obj
[30/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/abort.c.obj
[31/144] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_core_mpu.c.obj
[32/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/strtol.c.obj
[33/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/strtoul.c.obj
[34/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/bsearch.c.obj
[35/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strncasecmp.c.obj
[36/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/malloc.c.obj
[37/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/fprintf.c.obj
[38/144] Linking C static library zephyr\arch\common\libarch__common.a
[39/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/time/gmtime.c.obj
[40/144] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/exit.c.obj
[41/144] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
[42/144] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_mpu.c.obj
[43/144] Building C object zephyr/soc/arm/common/cortex_m/CMakeFiles/soc__arm__common__cortex_m.dir/arm_mpu_regions.c.obj
[44/144] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/nanosleep.c.obj
[45/144] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread_common.c.obj
[46/144] Building C object modules/nrf/lib/fatal_error/CMakeFiles/..__nrf__lib__fatal_error.dir/fatal_error.c.obj
[47/144] Linking C static library zephyr\arch\arch\arm\core\aarch32\mpu\libarch__arm__core__aarch32__mpu.a
[48/144] Building C object zephyr/soc/arm/nordic_nrf/nrf52/CMakeFiles/soc__arm__nordic_nrf__nrf52.dir/soc.c.obj
[49/144] Linking C static library zephyr\arch\arch\arm\core\aarch32\cortex_m\libarch__arm__core__aarch32__cortex_m.a
[50/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/banner.c.obj
[51/144] Linking C static library zephyr\lib\libc\minimal\liblib__libc__minimal.a
[52/144] Linking C static library zephyr\soc\arm\common\cortex_m\libsoc__arm__common__cortex_m.a
[53/144] Building C object zephyr/soc/arm/nordic_nrf/nrf52/CMakeFiles/soc__arm__nordic_nrf__nrf52.dir/power.c.obj
[54/144] Linking C static library zephyr\lib\posix\liblib__posix.a
[55/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/fatal.c.obj
[56/144] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
[57/144] Building C object zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj
[58/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/device.c.obj
[59/144] Linking C static library modules\nrf\lib\fatal_error\lib..__nrf__lib__fatal_error.a
[60/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/errno.c.obj
[61/144] Linking C static library zephyr\soc\arm\nordic_nrf\nrf52\libsoc__arm__nordic_nrf__nrf52.a
[62/144] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/nrfx_glue.c.obj
[63/144] Building C object modules/segger/CMakeFiles/modules__segger.dir/SEGGER_RTT_zephyr.c.obj
[64/144] Linking C static library zephyr\drivers\serial\libdrivers__serial.a
[65/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/version.c.obj
[66/144] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/Users/den-sekkei10-npc/ncs/v1.6.1/modules/hal/nordic/nrfx/mdk/system_nrf52.c.obj
[67/144] Linking C static library zephyr\drivers\gpio\libdrivers__gpio.a
[68/144] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/Users/den-sekkei10-npc/ncs/v1.6.1/modules/hal/nordic/nrfx/drivers/src/nrfx_clock.c.obj
[69/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/idle.c.obj
[70/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/kheap.c.obj
[71/144] Building C object modules/segger/CMakeFiles/modules__segger.dir/C_/Users/den-sekkei10-npc/ncs/v1.6.1/modules/debug/segger/SEGGER/SEGGER_RTT.c.obj
[72/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/thread.c.obj
[73/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mem_slab.c.obj
[74/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/init.c.obj
[75/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/msg_q.c.obj
[76/144] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/Users/den-sekkei10-npc/ncs/v1.6.1/modules/hal/nordic/nrfx/drivers/src/nrfx_ppi.c.obj
[77/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mailbox.c.obj
[78/144] Linking C static library modules\segger\libmodules__segger.a
[79/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/queue.c.obj
[80/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/pipes.c.obj
[81/144] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/Users/den-sekkei10-npc/ncs/v1.6.1/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
[82/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/system_work_q.c.obj
[83/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mutex.c.obj
[84/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sem.c.obj
[85/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/stack.c.obj
[86/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/xip.c.obj
[87/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/condvar.c.obj
[88/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
[89/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mempool.c.obj
[90/144] Linking C static library modules\hal_nordic\nrfx\libmodules__hal_nordic__nrfx.a
[91/144] Building C object CMakeFiles/app.dir/src/main.c.obj
[92/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/work.c.obj
[93/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
[94/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
[95/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/timeout.c.obj
[96/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/timer.c.obj
[97/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
[98/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
[99/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
[100/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
[101/144] Linking C static library app\libapp.a
[102/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
[103/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
[104/144] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
[105/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
[106/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
[107/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
[108/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
[109/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
[110/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
[111/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
[112/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
[113/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
[114/144] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
[115/144] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
[116/144] Linking C static library zephyr\kernel\libkernel.a
[117/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj
[118/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
[119/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
[120/144] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj
[121/144] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj
[122/144] Generating linker_zephyr_prebuilt.cmd
[123/144] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/pm_ctrl.c.obj
[124/144] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/power.c.obj
[125/144] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
[126/144] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/timer/sys_clock_init.c.obj
[127/144] Building C object zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj
[128/144] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/console/uart_console.c.obj
[129/144] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/policy/policy_residency.c.obj
[130/144] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
[131/144] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
[132/144] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
[133/144] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/clock_control/clock_control_nrf.c.obj
[134/144] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/timer/nrf_rtc_timer.c.obj
[135/144] Linking C static library zephyr\arch\arch\arm\core\aarch32\libarch__arm__core__aarch32.a
[136/144] Linking C static library zephyr\libzephyr.a
[137/144] Linking C executable zephyr\zephyr_prebuilt.elf

[138/144] Generating linker.cmd
[139/144] Generating isr_tables.c, isrList.bin
[140/144] Generating dev_handles.c
[141/144] Building C object zephyr/CMakeFiles/zephyr_final.dir/misc/empty_file.c.obj
[142/144] Building C object zephyr/CMakeFiles/zephyr_final.dir/isr_tables.c.obj
[143/144] Building C object zephyr/CMakeFiles/zephyr_final.dir/dev_handles.c.obj
[144/144] Linking C executable zephyr\zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       16832 B       512 KB      3.21%
            SRAM:        5472 B        64 KB      8.35%
        IDT_LIST:          0 GB         2 KB      0.00%

den-sekkei10-npc@DESKTOP-DHR8QT9 MINGW64 ~/ncs/v1.6.1/zephyr/samples/hello_world ((v2.6.0-rc1-ncs1))
$



After building the sample project, the following error message appears when puncover is run.
den-sekkei10-npc@DESKTOP-DHR8QT9 MINGW64 ~/ncs/v1.6.1/zephyr/samples/hello_world ((v2.6.0-rc1-ncs1))
$ west build -t puncover
-- west build: running target puncover
ninja: error: unknown target 'puncover'
FATAL ERROR: command exited with status 1: 'C:\Users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\cmake.EXE' --build 'C:\Users\den-sekkei10-npc\ncs\v1.6.1\zephyr\samples\hello_world\build' --target puncover


I have searched for a solution with the error code to resolve the issue, but have not found one, and have tried reinstalling puncover, etc., but have not resolved the issue.

Sorry, please tell me how to use puncover


Thank you for your cooperation.

Parents
  • Hi Mitsuaki,

    Here is a short description what this could be:

    It is likely that you receive this error when puncover is not installed and available on the PATH. You will then need to regenerate the build system.

    Please let me know if you need details regarding the path. When the path is OK, you should be able to call puncover.py from any folder.

    Best regards,

    HĂĄkon

Reply
  • Hi Mitsuaki,

    Here is a short description what this could be:

    It is likely that you receive this error when puncover is not installed and available on the PATH. You will then need to regenerate the build system.

    Please let me know if you need details regarding the path. When the path is OK, you should be able to call puncover.py from any folder.

    Best regards,

    HĂĄkon

Children
  • Thank you for your response.

    "It is likely that you receive this error when puncover is not installed and available on the PATH"

    I uninstalled puncover once and tried installing it again.

    The installation commands are as follows

    "pip3 install git+github.com/.../puncover --user"

    After running the installation, the following text was displayed

    den-sekkei10-npc@DESKTOP-DHR8QT9 MINGW64 ~/ncs/v1.6.1
    $ pip3 install git+https://github.com/HBehrens/puncover --user
    Collecting git+https://github.com/HBehrens/puncover
      Cloning https://github.com/HBehrens/puncover to c:\users\den-sekkei10-npc\appdata\local\temp\pip-req-build-tmpvdqgu
      Running command git clone --filter=blob:none --quiet https://github.com/HBehrens/puncover 'C:\Users\den-sekkei10-npc\AppData\Local\Temp\pip-req-build-tmpvdqgu'
      Resolved https://github.com/HBehrens/puncover to commit 706dcc5e4a7177817b8cf0830b6894ba2d4320e3
      Preparing metadata (setup.py): started
      Preparing metadata (setup.py): finished with status 'done'
    Requirement already satisfied: Flask==0.10.1 in c:\users\den-sekkei10-npc\appdata\roaming\python\python38\site-packages (from puncover==0.0.1) (0.10.1)
    Requirement already satisfied: mock==1.3.0 in c:\users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\lib\site-packages (from puncover==0.0.1) (1.3.0)
    Requirement already satisfied: codecov==2.0.5 in c:\users\den-sekkei10-npc\appdata\roaming\python\python38\site-packages (from puncover==0.0.1) (2.0.5)
    Requirement already satisfied: nose-cov==1.6 in c:\users\den-sekkei10-npc\appdata\roaming\python\python38\site-packages (from puncover==0.0.1) (1.6)
    Requirement already satisfied: requests>=2.0.0 in c:\users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\lib\site-packages (from codecov==2.0.5->puncover==0.0.1) (2.25.1)
    Collecting argparse
      Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
    Requirement already satisfied: coverage in c:\users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\lib\site-packages (from codecov==2.0.5->puncover==0.0.1) (5.4)
    Requirement already satisfied: Jinja2>=2.4 in c:\users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\lib\site-packages (from Flask==0.10.1->puncover==0.0.1) (2.11.3)
    Requirement already satisfied: Werkzeug>=0.7 in c:\users\den-sekkei10-npc\appdata\roaming\python\python38\site-packages (from Flask==0.10.1->puncover==0.0.1) (2.1.2)
    Requirement already satisfied: itsdangerous>=0.21 in c:\users\den-sekkei10-npc\appdata\roaming\python\python38\site-packages (from Flask==0.10.1->puncover==0.0.1) (2.1.2)
    Requirement already satisfied: six>=1.7 in c:\users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\lib\site-packages (from mock==1.3.0->puncover==0.0.1) (1.15.0)
    Requirement already satisfied: pbr>=0.11 in c:\users\den-sekkei10-npc\appdata\roaming\python\python38\site-packages (from mock==1.3.0->puncover==0.0.1) (5.9.0)
    Requirement already satisfied: cov-core>=1.6 in c:\users\den-sekkei10-npc\appdata\roaming\python\python38\site-packages (from nose-cov==1.6->puncover==0.0.1) (1.15.0)
    Requirement already satisfied: nose>=0.11.4 in c:\users\den-sekkei10-npc\appdata\roaming\python\python38\site-packages (from nose-cov==1.6->puncover==0.0.1) (1.3.7)
    Requirement already satisfied: MarkupSafe>=0.23 in c:\users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\lib\site-packages (from Jinja2>=2.4->Flask==0.10.1->puncover==0.0.1) (1.1.1)
    Requirement already satisfied: idna<3,>=2.5 in c:\users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\lib\site-packages (from requests>=2.0.0->codecov==2.0.5->puncover==0.0.1) (2.10)
    Requirement already satisfied: chardet<5,>=3.0.2 in c:\users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\lib\site-packages (from requests>=2.0.0->codecov==2.0.5->puncover==0.0.1) (4.0.0)
    Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\lib\site-packages (from requests>=2.0.0->codecov==2.0.5->puncover==0.0.1) (1.26.4)
    Requirement already satisfied: certifi>=2017.4.17 in c:\users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\lib\site-packages (from requests>=2.0.0->codecov==2.0.5->puncover==0.0.1) (2020.12.5)
    Building wheels for collected packages: puncover
      Building wheel for puncover (setup.py): started
      Building wheel for puncover (setup.py): finished with status 'done'
      Created wheel for puncover: filename=puncover-0.0.1-py3-none-any.whl size=168447 sha256=b7220fd999e0a985d1194b6c24944e96849fcaae359e7aff0ba77808de3dfd4f
      Stored in directory: C:\Users\den-sekkei10-npc\AppData\Local\Temp\pip-ephem-wheel-cache-wvrgqcxg\wheels\84\4a\ea\2ff6408a80cc2863665909e7e682daa0eea6fca88dac53fe73
    Successfully built puncover
    Installing collected packages: argparse, puncover
      WARNING: The script puncover.exe is installed in 'C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\Scripts' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Successfully installed argparse-1.4.0 puncover-0.0.1
    

    "Not registered in PATH. Please add this directory to your PATH."
    The notification was displayed.

    I set the windows PATH setting to the PATH where puncover is installed, and puncover seems to be running, but I get the error message again.

    den-sekkei10-npc@DESKTOP-DHR8QT9 MINGW64 ~/ncs/v1.6.1/zephyr/samples/hello_world ((v2.6.0-rc1-ncs1))
    $ west build -t puncover
    -- west build: running target puncover
    [0/1] cmd.exe /C "cd /D C:\Users\den-sekkei10-npc\ncs\v1.6.1\zephyr\samples\hello_world\build\zephyr\cmake\reports && C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\Scripts\puncover.exe --elf_file C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build/zephyr/zephyr.elf --gcc_tools_base C:/Users/den-sekkei10-npc/ncs/v1.6.0/toolchain/opt/bin/arm-none-eabi- --src_root C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr --build_dir C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build"
    Traceback (most recent call last):
      File "runpy.py", line 193, in _run_module_as_main
      File "runpy.py", line 86, in _run_code
      File "C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\Scripts\puncover.exe\__main__.py", line 7, in <module>
      File "C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\site-packages\puncover\puncover.py", line 58, in main
        builder.build_if_needed()
      File "C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\site-packages\puncover\builders.py", line 32, in build_if_needed
        self.build()
      File "C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\site-packages\puncover\builders.py", line 22, in build
        self.collector.parse_elf(self.get_elf_path())
      File "C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\site-packages\puncover\collector.py", line 306, in parse_elf
        self.parse_assembly_text("".join(self.gcc_tools.get_assembly_lines(elf_file)))
      File "C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\site-packages\puncover\gcc_tools.py", line 27, in get_assembly_lines
        return self.gcc_tool_lines('objdump', ['-dslw', os.path.basename(elf_file)], os.path.dirname(elf_file))
      File "C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\site-packages\puncover\gcc_tools.py", line 23, in gcc_tool_lines
        proc = subprocess.Popen([self.gcc_tool_path(name)] + args, stdout=subprocess.PIPE, cwd=cwd)
      File "C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\site-packages\puncover\gcc_tools.py", line 18, in gcc_tool_path
        raise Exception("Could not find %s" % path)
    Exception: Could not find C:/Users/den-sekkei10-npc/ncs/v1.6.0/toolchain/opt/bin/arm-none-eabi-objdump
    parsing ELF at C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build/zephyr/zephyr.elf
    FAILED: zephyr/cmake/reports/CMakeFiles/puncover
    cmd.exe /C "cd /D C:\Users\den-sekkei10-npc\ncs\v1.6.1\zephyr\samples\hello_world\build\zephyr\cmake\reports && C:\Users\den-sekkei10-npc\AppData\Roaming\Python\Python38\Scripts\puncover.exe --elf_file C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build/zephyr/zephyr.elf --gcc_tools_base C:/Users/den-sekkei10-npc/ncs/v1.6.0/toolchain/opt/bin/arm-none-eabi- --src_root C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr --build_dir C:/Users/den-sekkei10-npc/ncs/v1.6.1/zephyr/samples/hello_world/build"
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\Users\den-sekkei10-npc\ncs\v1.6.1\toolchain\opt\bin\cmake.EXE' --build 'C:\Users\den-sekkei10-npc\ncs\v1.6.1\zephyr\samples\hello_world\build' --target puncover
    

    I am sorry to keep repeating myself, but thank you in advance.

  • I was able to successfully launch puncover.
    It seemed that it would not work without a patch to puncover in Windows environmentization.

    The URL where the patch was published is here.

    https://github.com/HBehrens/puncover/issues/37

    Thanks for the advice.

Related