Nucleo STM32 L152RE : Serial communications

Hello,

I am a student in an intership, and i am using the Nucleo STM32 L152RE and I program with mbed. I am trying to use any of the available serial ports of that platform, but none of them works. I already tried serial communications on a STM32 L053 and it worked perfectly. Now, I can't even see any streams of communications on every TX pins of every ports.

Here is my program:

#include "mbed.h"

//------------------------------------
// Hyperterminal configuration
// 9600 bauds, 8-bit data, no parity
//------------------------------------

Serial pc(USBTX,USBRX);

Serial Serial1(PA_9,PA_10); 

Serial Serial3(PB_10,PB_11);  

Serial Serial4(PC_12,PD_2); 

Serial Serial5(PC_10,PC_11); 

int main() {

    Serial1.format(8, Serial::None, 1);

    Serial1.baud(9600);

    Serial3.format(8, Serial::None, 1);

    Serial3.baud(9600);

    Serial4.format(8, Serial::None, 1);

    Serial4.baud(9600);

    Serial5.format(8, Serial::None, 1);

    Serial5.baud(9600);

    pc.format(8, Serial::None, 1);

    pc.baud(9600);
    
    int i=0;
    
  while(1) { 
  
Serial1.puts("AA");

Serial3.puts("AA");

Serial4.puts("AA");

Serial5.puts("AA");

      pc.printf("This program runs since %d seconds.\r\n", i);

      i++;

      wait(1);

  }
}

With this program, the pc.printf wasn't showing on hyperterminal, it seems that it gets stuck before it.

/media/uploads/VICO/stm32l152re_pins_morpho.png

/media/uploads/VICO/stm32l152re_pins_arduino.png

26 May 2015

I tried to enable serial 4 and 5.

Import programL152RE_serial45_example

NUCLEO-L152RE serial4,5 test program

I tested your program, and it didn't work, I have nothing on serial port Why is there so many libraries ?

24 Feb 2017

http://www.emcu.it/NUCLEOevaBoards/U2andL152/U2andL152.html#USART2_for_communication_with_shield_or

Please check this link. As some jumpers are required to connect a serial port to output pins (like Tx or Rx). Good luck!