No module named board with pyOCD - FRDM-K64F in cmsis-dap mode

Hi, I am trying to get a FRDM-k64F to work with platformio, debug included. So I need to communicate with it in cmsis-dap mode, but I get the following error in the pyOCD library:

ModuleNotFoundError: No module named ‘board’

Does anyone know how to solve this? Thank you.

$ platformio run -t upload -v
Processing frdm_k64f (platform: freescalekinetis; board: frdm_k64f; framework: mbed; upload_protocol: cmsis-dap)
----------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/freescalekinetis/frdm_k64f.html
PLATFORM: Freescale Kinetis 5.0.1 > Freescale Kinetis FRDM-K64F
HARDWARE: MK64FN1M0VLL12 120MHz, 256KB RAM, 1MB Flash
DEBUG: Current (cmsis-dap) On-board (cmsis-dap) External (jlink)
PACKAGES: 
 - framework-mbed 6.51401.200113 (5.14.1) 
 - tool-pyocd 0.801.0 (8.1) 
 - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
Collecting mbed sources...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 4 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
MethodWrapper(["checkprogsize"], [".pio/build/frdm_k64f/firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   2.2% (used 5880 bytes from 262144 bytes)
Flash: [          ]   4.5% (used 46712 bytes from 1048576 bytes)
.pio/build/frdm_k64f/firmware.elf  :
section              size        addr
.interrupts          1024           0
.flash_config          16        1024
.text               43928        1088
.ARM                    8       45016
.init_array             4       45024
.fini_array             4       45028
.interrupts_ram      1024   536805376
.crash_data_ram       256   536806400
.heap_0             64256   536806656
.data                2784   536870912
.uninitialized          0   536873696
.bss                 3096   536873696
.heap              186632   536876792
.ARM.attributes        46           0
.debug_info        428387           0
.debug_abbrev       54558           0
.debug_loc         113026           0
.debug_aranges       8016           0
.debug_ranges       11344           0
.debug_line         91581           0
.debug_str          99884           0
.comment              126           0
.debug_frame        26844           0
.stab                  60           0
.stabstr              118           0
Total             1137022
<lambda>(["upload"], [".pio/build/frdm_k64f/firmware.bin"])
AVAILABLE: cmsis-dap, jlink, mbed
CURRENT: upload_protocol = cmsis-dap
"/home/daniele/.platformio/penv/bin/python3" "/home/daniele/.platformio/packages/tool-pyocd/pyocd-flashtool.py" -t k64f .pio/build/frdm_k64f/firmware.bin
Traceback (most recent call last):
  File "/home/daniele/.platformio/packages/tool-pyocd/pyocd-flashtool.py", line 24, in <module>
    from pyOCD.tools.flash_tool import main
  File "/home/daniele/.platformio/packages/tool-pyocd/site-packages/pyOCD/__init__.py", line 18, in <module>
    import board
ModuleNotFoundError: No module named 'board'
*** [upload] Error 1
============================== [FAILED] Took 5.45 seconds ==============================

This is the content of my platform.ini:

[env:frdm_k64f]
platform = freescalekinetis
board = frdm_k64f
framework = mbed
upload_protocol = cmsis-dap

EDIT: solved by using an updated pyocd with custom upload and debug:

[env:frdm_k64f]
platform = freescalekinetis
board = frdm_k64f
framework = mbed
upload_protocol = custom
upload_command = pyocd flash $SOURCE
debug_tool = custom
debug_server = pyocd-gdbserver