I’m trying to program my FRDM-KL27Z (Freescale Kinetis FRDM-KL27Z — PlatformIO latest documentation) with platform IO but I’ve not been able to manage.
In case it’s relevant information I’m doing this on a windows virtual machine (windows host & guest).
The board has two USB ports I’m connecting to the one that says OpenSDA and I can see the a F: drive mounting and a COM3 mounting, (I’m passing them to the virtual machine) I have uploaded an example blink program through MCUXpresso so both the board and the USB connection are good.
The board is somewhat old It might just be that:
Board: FRDM-KL27Z
It has a sticker with version information:
700-28303 Rev A
SCH-28303 Rev B
The PCB has a silk marking: 170-28303 Rev B
If I’m reading the serial correctly it was made on 2018
I’m trying to upload code from one of the examples from: GitHub - platformio/platform-freescalekinetis: Freescale Kinetis: development platform for PlatformIO (I’m creating a new porject and selecting the board but copying the main.cpp from the /mbed-rtos-blink-baremetal example).
Here’s the code:
/* mbed Microcontroller Library
* Copyright (c) 2019 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*/
#include "mbed.h"
#define WAIT_TIME_MS 5000
DigitalOut led1(LED1);
int main()
{
printf("This is the bare metal blinky example running on Mbed OS %d.%d.%d.\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION);
while (true)
{
led1 = !led1;
thread_sleep_for(WAIT_TIME_MS);
}
}
And here’s my INI:
[env:frdm_kl27z]
platform = freescalekinetis
board = frdm_kl27z
framework = mbed
debug_tool = cmsis-dap
upload_protocol = cmsis-dap
;upload_port = F: ;whether I specify the port or not it fails.
When I try to upload trhough platform IO I get the following message:
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [==== ] 35.3% (used 5776 bytes from 16384 bytes)
Flash: [======== ] 78.4% (used 51376 bytes from 65536 bytes)
Building .pio\build\frdm_kl27z\firmware.bin
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, mbed
CURRENT: upload_protocol = cmsis-dap
Uploading .pio\build\frdm_kl27z\firmware.bin
WARNING:pyocd.tools.flash_tool:pyocd-flashtool is deprecated; please use the new combined pyocd tool.
WARNING:pyocd.probe.common:STLink and CMSIS-DAPv2 probes are not supported because no libusb library was found.
No connected debug probes
Error: There is no debug probe connected.
*** [upload] Error 1
I found the following thread: Unable To Debug - tool-pyocd ModuleNotFoundError: No module named 'board'
where it recommends to install gdbserver outside of vscode and trying to connect but when I try to execute the following:
C:\Users\win10>pyocd gdbserver -t kl27z4
All I get is this:
C:\Users\win10>pyocd gdbserver -t kl27z4
Waiting for a debug probe to be connected...
And it just hangs there indefinitely.
That thread mention something about installing compatibility for libusb but when I click see libusb installation it always leads me to this link: GitHub - pyocd/pyOCD: Open source Python library for programming and debugging Arm Cortex-M microcontrollers