7 years, 7 months ago.

Why do all programs that use additional libraries (eg GPS libraries) become "blinky"?

Just printing an integer number to serial works fine. But when I load a program (that compiled w/o errors or warnings) that uses for example a GPS library (GPS.h, AdafruitGPS.h and also TinyGPS.h) they turn into "Blinky". Does anybody have an idea as to why this might happen?

Thank you for your input...

Here's my code :

TinyGPS example

#include "mbed.h"
#include "TinyGPS.h"

#define TX0 P2_14
#define RX0 P2_15
#define TX5 P8_11
#define RX5 P8_13

Serial Serial0(TX0, RX0);
Serial GPSSerial(TX5, RX5);

TinyGPS tgps;

int i = 0;

int main(void) {
    // setup
    GPSSerial.baud(9600);
    wait(0.001);
    Serial0.baud(115200);
    wait(0.001);

    while(1) {
      while(1) {
        if( !GPSSerial.readable() )
        {
          break;
        }
        char c = GPSSerial.getc();
        Serial0.printf("%c", c);
      }
      Serial0.printf("%d\r\n",i);
      i++;
      wait(1.0);
    }
}

Question relating to:

Renesas Electronics Corporation (TSE: 6723), the world's number one supplier of microcontrollers, is a premier supplier of advanced semiconductor solutions including microcontrollers, SoC solutions and a broad range of analog …

1 Answer

7 years, 7 months ago.

Often when the LED starts blinking very fast it comes with a message over the serial port that says "Pinmap not found for peripheral". This happens when you wrongly declare a pin (e.g. declare a TX pin as RX).

According to the pinout P8_11 is RX and P8_13 is TX, but in your code you switched them around.

Accepted Answer

Thanks, it was indeed switched pins. And yes, I got the "Pinmap not found for peripheral" message on the Serial. It's working now.

posted by カレヴィ アンダース 13 Sep 2016