Skip to content

Blinky program doesn't blink on some target boards #271

Open
@toyowata

Description

@toyowata

Description of defect

LED is not blinking on some target boards.
Recently, following code has been added in this example code.

   // Initialise the digital pin LED1 as an output
#ifdef LED1
    DigitalOut led(LED1);
#else
    bool led;
#endif

The #ifdef detective doesn't recognize typedefed LED1 symbol, so LED doesn't blink for some target boards such as NXP LPC1768, Renesas, Nordic, Maxim and other target board which declare LED symbol as typedef.

Typical decleration for typedef is as below.

typedef enum {
    // snip
    LED1 = PF4,
    LED2 = PF5,
    LED3 = PF6,
    LED4 = PF7,
    // snip
} PinName;

AFAIK, C/C++ preprocessor can only handle macros and arithmetic constant expressions.

Target(s) affected by this defect ?

NXP LPC1768, Renesas, Nordic, Maxim, Toshiba target and others

Toolchain(s) (name and version) displaying this defect ?

arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

What version of Mbed-os are you using (tag or sha) ?

mbed-os-example-blinky (#8164c4764939, tag: mbed-os-6.14.0)
`- mbed-os (#3377f083b3a6, tags: mbed-os-6.14.0, mbed-os-6.14.0-rc1)

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

$ mbed --version
1.10.5
$ mbed-tools --version
7.35.0

How is this defect reproduced ?

Import the example, compile and run.

$ mbed-tools import https://github.com/ARMmbed/mbed-os-example-blinky
$ cd mbed-os-example-blinky
$ mbed compile -m rz_a1h -t gcc_arm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions