8 years, 11 months ago.

PwmOut declaration is preventing compiled program from loading

If I try to load any program compiled with the PwmOut declaration, the binary will not load onto my Leopard Gecko SDK. Below is an example of a program that will not load. I have also tried both the standard mbed and mbed-src libraries. I receive no compiler errors.

  1. include "mbed.h"

PwmOut PWM1(LED1);

int main() { while(1) { } }

Am I using PwmOut incorrectly, and if not, is there a work around?

Thank you

Which board?

posted by Erik - 05 Dec 2015

Leopard Gecko EFM32LG-STK3600 board

posted by Keith Graham 05 Dec 2015

1 Answer

8 years, 11 months ago.

It seems it cannot use LED1 for PWM. Quickly looking at the source code I would think it should start blinking some LEDs to tell you, and also on the Serial connection give you a message. (The board apparantly has very few PWM options, only PA12, PA13 and PA14).

Accepted Answer

That appears to be the problem. I just tried switching PwmOut to PWM1(PA12) and the code compiled and loaded onto my Leopard Gecko SDK board. Thank you very much.

posted by Keith Graham 06 Dec 2015