10 years, 4 months ago.

pinmap not found for peripheral

This error is generated when attempting to use LED in PWM mode in K64F. and displayed on the serial port. Where does the message get generated? are there other ERRORS waiting for the unwary? and why is it not picked up by the mbed compiler?

Code lifted from mbed site and pinnames changed for K64F Arduino style "A0" appears to be recognised, as does "SW2"

  1. include "mbed.h"

DigitalIn button(SW2); was p19 AnalogIn pot(A0); was p20 PwmOut led1(LED1); compiles, RED LED flashes continuously msg on serial port "pinmap not found for peripheral" int main() { while(1) { printf("Value of pot is %.3f\n", pot.read()); wait (0.1); if (button && (pot < 0.7)) { led1 = pot; } else { led1 = 0.0; } } }

Question relating to:

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

1 Answer

10 years, 4 months ago.

The K64F sadly does not have the LED connected to PWM capable pin, so it generates that error. Many other pins are PWM capable, and for them it works fine.

Why the compiler doesn't throw an error? It is calculated at runtime. That cannot be different while still using the regular C++ classes. In theory a compiler could figure it out, but they simply don't do that.

Accepted Answer