[Patch] bsp/tms570/sci: fix bug in tms570_sci_read_received_chars()

Adrien Chardon Adrien at reflexaerospace.com
Wed Jan 31 17:35:21 UTC 2024


Hi Sebastian,

(I believe I forgot to include devel at rtems.org in my previous answer, sorry for the duplicate email)

Sorry for the delayed answer, we were quite busy at work.

You will find attached the Git patch file for the SCI bug. I've taken into
account your suggestions.

While testing the counterpart of my protocol on a Zynq, I found a similar issue
where the UART is assumed to be used for printable text only. The second patch
fixes it.

I've used `git format-patch -2 HEAD` to generate the patch files. If something
is not quite right for you to integrate my changes, let me know.

Best regards,
Adrien Chardon, on behalf of Reflex Aerospace
________________________________
From: Sebastian Huber <sebastian.huber at embedded-brains.de>
Sent: 25 January 2024 20:29
To: Adrien Chardon <Adrien at reflexaerospace.com>; devel at rtems.org <devel at rtems.org>
Subject: Re: [Patch] bsp/tms570/sci: fix bug in tms570_sci_read_received_chars()

[You don't often get email from sebastian.huber at embedded-brains.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hello Adrien,

the change looks good. I would remove the
tms570_sci_read_received_chars() and TMS570_SCI_BUFFER_SIZE:

static void tms570_sci_interrupt_handler(void * arg)
{
   rtems_termios_tty *tty = arg;
   tms570_sci_context *ctx = rtems_termios_get_device_context(tty);

   /*
    * Check if we have received something.
    */
   if ( (ctx->regs->FLR & TMS570_SCI_FLR_RXRDY ) == TMS570_SCI_FLR_RXRDY ) {
     char buf[1];

     buf[0] = ctx->regs->RD;
     rtems_termios_enqueue_raw_characters(tty, buf, 1);
   }
embedded brains GmbH & Co. KG
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20240131/e059dc6e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-bsps-shared-zynq-uart-polled-fix-bug-in-zynq_uart_in.patch
Type: text/x-patch
Size: 1341 bytes
Desc: 0002-bsps-shared-zynq-uart-polled-fix-bug-in-zynq_uart_in.patch
URL: <http://lists.rtems.org/pipermail/devel/attachments/20240131/e059dc6e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-bsp-tms570-sci-fix-bug-in-tms570_sci_read_received_c.patch
Type: text/x-patch
Size: 3514 bytes
Desc: 0001-bsp-tms570-sci-fix-bug-in-tms570_sci_read_received_c.patch
URL: <http://lists.rtems.org/pipermail/devel/attachments/20240131/e059dc6e/attachment-0001.bin>


More information about the devel mailing list