Using PA9/10 for UARTD1

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Th3Link
Posts: 3
Joined: Tue Jan 28, 2014 12:39 pm

Using PA9/10 for UARTD1

Post by Th3Link »

Hi,
I'm working on a Project were an xbee module over UART is used. The Board is the STM32F407-Discovery. During development I used UARTD1 on PB6/7. Since this pins are used for CAN, I changed to PA9/10 but only rubbish came out.
I reduced toe problem to the UART example where I got the same result. When I use PB6/7 I get "0123456789ABCDEF" over an external FTDI USB chip. On PA9/10 I get "00 B0 FD FF FF FF 00 00" (Hex). I also observed that LD7 is flashing which is normally only on when I use the USB Serial interface. Any Ideas?

Thank you,

Code: Select all

int main(void) {

  /*
   * System initializations.
   * - HAL initialization, this also initializes the configured device drivers
   *   and performs the board-specific initializations.
   * - Kernel initialization, the main() function becomes a thread and the
   *   RTOS is active.
   */
  halInit();
  chSysInit();

  /*
   * Activates the UART driver 2, PA2(TX) and PA3(RX) are routed to USART2.
   */
  uartStart(&UARTD1, &uart_cfg_1);
  palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(7));
  palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(7));


  /*
   * Normal main() thread activity, in this demo it does nothing.
   */
  while (TRUE) {
    if (palReadPad(GPIOA, GPIOA_BUTTON)) {
      /*
       * Starts both a transmission and a receive operations, both will be
       * handled entirely in background.
       */
      uartStopReceive(&UARTD1);
      uartStopSend(&UARTD1);
      uartStartReceive(&UARTD1, 16, buffer);
      uartStartSend(&UARTD1, 16, message);
    }
    chThdSleepMilliseconds(500);
  }
}
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Using PA9/10 for UARTD1

Post by Giovanni »

Hi,

It is because PA9 and P10 are already wired on the Discovery, see the schematic.

Giovanni
Th3Link
Posts: 3
Joined: Tue Jan 28, 2014 12:39 pm

Re: Using PA9/10 for UARTD1

Post by Th3Link »

Oh, haven't seen this. I've taken a look to the STM32F4DISCOVERY USB_OTG_FS Schematic (Sheet 5).
PA9 is the VBUS_FS, I understand it as supply for the EMIF02-USB03F2. But when PC0 is high, the supply is disabled. If I measure PC0 it is high. When UART TX is inactive PA9 is high, thats why the led flashs, right?
I think the problem is at R59 which is 0 Ohm. Do you think, it is wise to remove R59 or replace is with more resistance?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Using PA9/10 for UARTD1

Post by Giovanni »

You should simply use another UART, there are 6 of them.

Giovanni
Th3Link
Posts: 3
Joined: Tue Jan 28, 2014 12:39 pm

Re: Using PA9/10 for UARTD1

Post by Th3Link »

Yes, it do ;) the problem is just that it is already on a board. But PC10/11 seems to close enought for some beautiful cuts and bridges ;)
Thank you
Post Reply