Thanks for the reply Jan.

In your path you have xilinx_scosa, is it some xilinx's board?

My console-config is different, it hasn't console_tbl structure (I attach it to the mail).

I did not know there was a list of rtems developers, I'm going to ask that list, thank you very much.

Marco Fuentes García


El 2017-08-31 16:32, jan.som...@dlr.de escribió:
I think I encountered this problem as well.
I found this patch in my history. Maybe it helps:

diff --git
a/c/src/lib/libbsp/arm/xilinx_scosa/console/console-config.c
b/c/src/lib/libbsp/arm/xilinx_scosa/console/console-config.c
index 94e5e4f799..6db8d0da88 100644
--- a/c/src/lib/libbsp/arm/xilinx_scosa/console/console-config.c
+++ b/c/src/lib/libbsp/arm/xilinx_scosa/console/console-config.c
@@ -30,7 +30,7 @@ console_tbl Console_Configuration_Ports[] = {
     .ulMargin = 0,
     .ulHysteresis = 0,
     .pDeviceParams = (void *) 115200,
-    .ulCtrlPort1 = 0xe0000000,
+    .ulCtrlPort1 = 0xe0001000,
     .ulCtrlPort2 = 0,
     .ulDataPort = 0,
     .getRegister = NULL,
@@ -38,7 +38,7 @@ console_tbl Console_Configuration_Ports[] = {
     .getData = NULL,
     .setData = NULL,
     .ulClock = 0,
-    .ulIntVector = ZYNQ_IRQ_UART_0
+    .ulIntVector = ZYNQ_IRQ_UART_1
   }, {
     .sDeviceName = "/dev/ttyS1",
     .deviceType = SERIAL_CUSTOM,
@@ -48,7 +48,7 @@ console_tbl Console_Configuration_Ports[] = {
     .ulMargin = 0,
     .ulHysteresis = 0,
     .pDeviceParams = (void *) 115200,
-    .ulCtrlPort1 = 0xe0001000,
+        .ulCtrlPort1 = 0xe0000000,
     .ulCtrlPort2 = 0,
     .ulDataPort = 0,
     .getRegister = NULL,
@@ -56,7 +56,7 @@ console_tbl Console_Configuration_Ports[] = {
     .getData = NULL,
     .setData = NULL,
     .ulClock = 0,
-    .ulIntVector = ZYNQ_IRQ_UART_1
+    .ulIntVector = ZYNQ_IRQ_UART_0
   }
 };


Best regards

   Jan

-----Original Message-----
From: users [mailto:users-boun...@rtems.org] On Behalf Of mfg
Sent: Thursday, August 31, 2017 2:32 PM
To: users@rtems.org
Subject: How to change UARTs RTEMS

Hello,

I'm using the Zedboard's BSP and my objetive is to print what goes out through
the uart1 interface for uart0 and vice versa.
I thought changing the memory addresses of the “console-config.c”
configuration file would suffice, but it is not.

zynq_uart_context zynq_uart_instances[2] = {
   {
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 0" ),
     .regs = (volatile struct zynq_uart *) 0xe0001000,
  //it was 0xe0000000,
     .irq = ZYNQ_IRQ_UART_0
   }, {
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 1" ), .regs = (volatile struct zynq_uart *) 0xe0000000, //it was 0xe0001000,
     .irq = ZYNQ_IRQ_UART_1
   }
};

Do I have to modify more files like zyn-uart-regs.h?
Has anyone done it or can it guide me?

Thanks in advance.

Marco Fuentes Garcia

_______________________________________________
users mailing list
users@rtems.org
http://lists.rtems.org/mailman/listinfo/users
/*
 * Copyright (c) 2013, 2017 embedded brains GmbH.  All rights reserved.
 *
 *  embedded brains GmbH
 *  Dornierstr. 4
 *  82178 Puchheim
 *  Germany
 *  <i...@embedded-brains.de>
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://www.rtems.org/license/LICENSE.
 */

#include <rtems/console.h>
#include <rtems/bspIo.h>

#include <bsp/irq.h>
#include <bsp/zynq-uart.h>

#include <bspopts.h>

zynq_uart_context zynq_uart_instances[2] = {
  {
    .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 1" ),
    .regs = (volatile struct zynq_uart *) 0xe0001000,
    .irq = ZYNQ_IRQ_UART_1
  }, {
    .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 0" ),
    .regs = (volatile struct zynq_uart *) 0xe0000000,
    .irq = ZYNQ_IRQ_UART_0
  }
};

rtems_status_code console_initialize(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
)
{
  size_t i;

  rtems_termios_initialize();

  for (i = 0; i < RTEMS_ARRAY_SIZE(zynq_uart_instances); ++i) {
    char uart[] = "/dev/ttySX";

    uart[sizeof(uart) - 2] = (char) ('0' + i);
    rtems_termios_device_install(
      &uart[0],
      &zynq_uart_handler,
      NULL,
      &zynq_uart_instances[i].base
    );

    if (i == BSP_CONSOLE_MINOR) {
      link(&uart[0], CONSOLE_DEVICE_NAME);
    }
  }

  return RTEMS_SUCCESSFUL;
}
_______________________________________________
users mailing list
users@rtems.org
http://lists.rtems.org/mailman/listinfo/users

Reply via email to