SFE_ARTEMIS and SFE_ARTEMIS_MODULE won't compile blink in mbed OS

I’m trying to get up and running using the Artemis module on a custom board. I think I want to use mbed OS to get more control over the code and not have to worry about licenses as much but I am totally new to mbed.

Anyway, I can’t get blinky to compile with the SFE_ARTEMIS_MODULE or the SFE_ARTEMIS targets in mbed. Here is the output when compiling using SFE_ARTEMIS_MODULE:

[Error] mbed_pinmap_default.cpp@72,9: use of undeclared identifier 'USBTX'
[Error] mbed_pinmap_default.cpp@72,16: use of undeclared identifier 'USBRX'
[Error] mbed_pinmap_default.cpp@75,15: invalid application of 'sizeof' to an incomplete type 'const PinName []'
[Error] mbed_pinmap_default.cpp@96,53: use of undeclared identifier 'STDIO_UART_TX'
[Error] mbed_pinmap_default.cpp@103,16: invalid application of 'sizeof' to an incomplete type 'const int []'
[ERROR] .\mbed-os\hal\source\mbed_pinmap_default.cpp:72:9: error: use of undeclared identifier 'USBTX'
USBTX, USBRX
^
.\mbed-os\hal\source\mbed_pinmap_default.cpp:72:16: error: use of undeclared identifier 'USBRX'
USBTX, USBRX
^
.\mbed-os\hal\source\mbed_pinmap_default.cpp:75:15: error: invalid application of 'sizeof' to an incomplete type 'const PinName []'
sizeof(pins) / sizeof(pins[0]),
^~~~~~
.\mbed-os\hal\source\mbed_pinmap_default.cpp:96:53: error: use of undeclared identifier 'STDIO_UART_TX'
static const int stdio_uart = pinmap_peripheral(STDIO_UART_TX, serial_tx_pinmap());
^
.\mbed-os\hal\source\mbed_pinmap_default.cpp:103:16: error: invalid application of 'sizeof' to an incomplete type 'const int []'
sizeof peripherals / sizeof peripherals[0],
^~~~~~~~~~~
5 errors generated.

Here is my code: (my custom board has LED connected to module pin D26)

/* mbed Microcontroller Library
 * Copyright (c) 2019 ARM Limited
 * SPDX-License-Identifier: Apache-2.0
 */

#include "mbed.h"


// Blinking rate in milliseconds
#define BLINKING_RATE     500ms

#define MYLED D26

int main()
{
    // Initialise the digital pin LED1 as an output
    DigitalOut led(MYLED);

    while (true) {
        led = !led;
        ThisThread::sleep_for(BLINKING_RATE);
    }
}

And here is the config I am trying to build:

mbed config blinky.PNG

It looks like it won’t compile because the module has no USB connection. I’m not sure where to go from here.

Any help would be greatly appreciated. Thanks! :slight_smile:

I figured out what I was doing wrong.

I setup mbed os using the instructions in the blog post here: https://learn.sparkfun.com/tutorials/ar … he-release

Turns out a newer version of the mbed os support for the artemis is in the mbed os v6.3.0 release. Once I changed to that copy of mbed os everything worked great.

Thanks for posting the fix. This will help our community because this is a very easy to miss detail just like the hide and seek champion, the almighty semicolon!