Hello,
I’m using VSC with PlatformIO extension installed running on macOS 10.14.5.
I’ve been following the Unit Testing Tutorial here:
https://docs.platformio.org/en/latest/tutorials/core/unit_testing_blink.html
Ran it on a uno board all ok, then decided to use the SigFox MKR1200 board I have as that is going to be my target device moving forward.
The main & test_main.cpp have remained the same, but I have modified my platformIO.ini file to include the environment for the MKR1200, added the lines below:
[env:mkrfox1200]
platform = atmelsam
board = mkrfox1200
framework = arduino
Project builds and appears to upload to the board ok, when the upload finishes, I get the “Available ports” prompt and only see the Bluetooth Port, not the serial port I would expect (/dev/cu.usbmodem4112401). I can enter the port’s full name and all seems ok.
If I then run, ‘platformio test -e mkrfox1200 --verbose’ everything seems to build and then upload ok, then the [test/*] Testing… starts and nothing happens. I just get:
If you don’t see any output for the first 10 secs, please reset board (press reset button)
If I reset the board nothing happens.
Running
$ pio device list
/dev/cu.Bluetooth-Incoming-Port
-------------------------------
Hardware ID: n/a
Description: n/a
/dev/cu.usbmodem4112401
-----------------------
Hardware ID: USB VID:PID=2341:8050 SER=46F9A11D5150484735202020FF0C3220 LOCATION=65-1.2.4
Description: Arduino MKRFox1200
I have also tried updating the platformIO.ini file with the following:
test_port = /dev/cu.usbmodem4112401
test_speed = 9600
This gives an error that there is no such file??
=============== [test/] Testing… (3/3) ============*
If you don’t see any output for the first 10 secs, please reset board (press reset button)
[Errno 2] could not open port /dev/cu.usbmodem4112401: [Errno 2] No such file or directory: ‘/dev/cu.usbmodem4112401’
======================== [TEST SUMMARY] ==============
test/ > mkrfox1200 [FAILED]*
================= [FAILED] Took 12.83 seconds ==============
I also removed the port speed, so that it took the default value of 115200, but to no avail?
When the test is running and I connect to the serial port using “Serial Monitor”… I see the following looping through the terminal constantly:
--------------------------------
11 Tests 1 Failures 0 Ignored
FAIL
---------------------------------
--------------------------------
11 Tests 1 Failures 0 Ignored
FAIL
---------------------------------
Am I missing something obvious with this??