6 years, 12 months ago.

Printf not working and it freeze the program lpcxpresso 1549

Hello

I have some problems with the serial communication between my lpcxpresso 1549 and PC. I tested the Blinky application and it work fine.However, whenever I use Printf() It start act strange way. It refuse to refuse to blink nor print in the terminal. there is the code that I'm using.

#include "mbed.h"
 
DigitalOut led(LED_GREEN);
 
int main() {
    printf("Hello World");
    while(1){
            led = 1;
            wait(1);
            led = 0;
            wait(1);
            }
}
 

I also tried the example piece of cod and it did not work

#include "mbed.h"              
 
Serial pc(USBTX, USBRX); // tx, rx
 
int main() {
    pc.printf("Hello World!\n");  

Is the problem from the code or from the board?

Thank you Taha

1 Answer

6 years, 12 months ago.

Hi,

I tested your test cases and both of them worked fine.

Can you please...

1) Update the firmware https://developer.mbed.org/teams/NXP/wiki/Updating-LPCXpresso-firmware

2) Install serial driver (if you are using Windows) https://developer.mbed.org/handbook/Windows-serial-configuration

3) Update mbed library to be latest

  • Select a small mbed icon in your program workspace
  • Click Revisions button (it takes some time...)
  • Select latest version of library (e.g. Revision 92)
  • Click Switch button

Accepted Answer