8 years, 7 months ago.

strange problem with stm32 L152 and Serial 6

hi to all, i have this very strange situation, i use st nucleo L152RE, if i write this code

#include "mbed.h"

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

Serial pc(SERIAL_TX, SERIAL_RX);
 
DigitalOut myled(LED1);
 
int main() {
  int i = 1;
  pc.printf("Hello World !\n");
  while(1) { 
      wait(1);
      pc.printf("This program runs since %d seconds.\n", i++);
      myled = !myled;
  }
}

all work well. Now if i want use the serial 6 for see my output i write this code

#include "mbed.h"

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


 Serial pc(PA_11,PA_12); //Serial6 PA_11 TX, PA_12 RX  
 
DigitalOut myled(LED1);
 
int main() {
  int i = 1;
  pc.printf("Hello World !\n");
  while(1) { 
      wait(1);
      pc.printf("This program runs since %d seconds.\n", i++);
      myled = !myled;
  }
}

don't work nothing, the led don't blink and the logic analyzer don't see nothing. the all is frozen can you help me? best regards

2 Answers

8 years, 7 months ago.

NUCLEO-L152RE does not have serial6.
PA_11 and PA_12 are not assigned serial port.
https://developer.mbed.org/platforms/ST-Nucleo-L152RE/

Accepted Answer

thanks for your answer i write this code

<<code>>

  1. include "mbed.h" Serial pc(PC_10,PC_11); Serial 4 TX, RX this don't work Serial pc(PB_10,PB_11); Serial 3 TX, RX work well

DigitalOut myled(LED1);

int main() { int i = 1; pc.printf("Hello World !\n"); while(1) { wait(1); pc.printf("This program runs since %d seconds.\n", i++); myled = !myled; } } <</code>>

i see that Serial 3 work well but serial 4 don't work i don't know this situetion

posted by Antoniolinux B. 02 Sep 2015
8 years, 7 months ago.

PA11/12 are the CTS/RTS connected ports. I use the STM L1 doc "DM00098321" which has the port definitions for the STML1 series. See table on page 43 (col LQFP64).