Description
Description
I have following problem with Nordic's nRF52 DK board and the newest mbed-os. Regardless of used code the second on-board led is always on. There was no such behavior in applications build with previous versions of mbed-os that used Nordic SDK 11 for this target. I checked my old mbed apps (mbed-os 5.8) and examples from Nordic SDK 14.2 and they don't have this issue so it's not hardware.
The bug is not critical but annoying.
Target:
NRF52_DK
Tools:
mbed-cli 1.8.3
Toolchain:
GCC_ARM
Toolchain version:
GNU Tools for ARM Embedded Processors 6-2017-q2-update 6.3.1 20170620 (release)
Mbed OS SHA:
a8d1d26 (HEAD, tag: mbed-os-5.11.3, tag: latest)
Steps to reproduce
Build and run the following code:
#include <mbed.h>
#include <Thread.h>
#include <gpio_api.h>
#include "ble/BLE.h"
DigitalOut led(LED1);
gpio_t led2;
int main()
{
BLE &ble = BLE::Instance();
ble.init();
gpio_init(&led2,LED2);
gpio_dir(&led2,PIN_OUTPUT);
printf("Is connected: %d\r\n",gpio_is_connected(&led2));
int led2_state = 0;
while(1)
{
led = !led;
gpio_write(&led2, led2_state^=1);
printf("LED1: %d, LED2: %d\r\n",led.read(),gpio_read(&led2));
ThisThread::sleep_for(1000);
}
}
I used following .mbedignore file inside mbed-os directory:
features/cellular/*
features/cryptocell/*
features/deprecated_warnings/*
features/device_key/*
features/FEATURE_BOOTLOADER/*
features/frameworks/*
features/lorawan/*
features/lwipstack/*
features/nanostack/*
features/netsocket/*
features/nfc/*
features/unsupported/*
features/storage/*
components/wifi/*
components/802.15.4_RF/*
components/storage/*
components/TARGET_PSA/*
Logs look like this:
Is connected: 1
LED1: 1, LED2: 1
LED1: 0, LED2: 0
LED1: 1, LED2: 1
...
However LED2 is always on...
Issue request type
[ ] Question
[ ] Enhancement
[x] Bug