public inbox for ecos-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug 1001068] New: Bug in serial driver when using Parity (Even or Odd)
@ 2010-11-04 20:51 bugzilla-daemon
  2010-11-22  9:43 ` [Bug 1001068] " bugzilla-daemon
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: bugzilla-daemon @ 2010-11-04 20:51 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001068

           Summary: Bug in serial driver when using Parity (Even or Odd)
           Product: eCos
           Version: 3.0
          Platform: stm32e_eval (ST STM3210E EVAL board)
        OS/Version: Cortex-M
            Status: UNCONFIRMED
          Severity: normal
          Priority: low
         Component: Serial
        AssignedTo: unassigned@bugs.ecos.sourceware.org
        ReportedBy: pme.neratec@gmx.ch
                CC: ecos-bugs@ecos.sourceware.org
             Class: Advice Request


stm32_serial.h defines the following "translation" (see
http://ecos.sourceware.org/cgi-bin/cvsweb.cgi/ecos/packages/devs/serial/cortexm/stm32/current/src/stm32_serial.h?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=ecos):

// Translate system parity selector into local values.
static cyg_uint32 select_parity[] = {
    0,                                                                  // No
parity
    CYGHWR_HAL_STM32_UART_CR1_PCE|CYGHWR_HAL_STM32_UART_CR1_PS_EVEN,    // Even
parity
    CYGHWR_HAL_STM32_UART_CR1_PCE|CYGHWR_HAL_STM32_UART_CR1_PS_ODD,     // Odd
parity
    0,  // Mark (1) parity -- not supported
    0  // Space (0) parity -- not supported
};


But - when selecting a parity (EVEN or ODD), you must also configure the M9-Bit
on the stm32. If you don't, you end up sending 7 databits and 1 parity bit
(instead of sending 8 databits and 1 parity bit).

Therefore the correct "translation" array must look like this:
// Translate system parity selector into local values.
static cyg_uint32 select_parity[] = {
    0,                                                                  // No
parity
   
CYGHWR_HAL_STM32_UART_CR1_PCE|CYGHWR_HAL_STM32_UART_CR1_PS_EVEN|CYGHWR_HAL_STM32_UART_CR1_M_9,
   // Even parity
   
CYGHWR_HAL_STM32_UART_CR1_PCE|CYGHWR_HAL_STM32_UART_CR1_PS_ODD|CYGHWR_HAL_STM32_UART_CR1_M_9,
    // Odd parity
    0,  // Mark (1) parity -- not supported
    0  // Space (0) parity -- not supported
};

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1001068] Bug in serial driver when using Parity (Even or Odd)
  2010-11-04 20:51 [Bug 1001068] New: Bug in serial driver when using Parity (Even or Odd) bugzilla-daemon
@ 2010-11-22  9:43 ` bugzilla-daemon
  2010-12-21 19:38 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2010-11-22  9:43 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001068

John Dallaway <john@dallaway.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEEDINFO
                 CC|                            |john@dallaway.org.uk
         AssignedTo|unassigned@bugs.ecos.source |john@dallaway.org.uk
                   |ware.org                    |
     Ever Confirmed|0                           |1

--- Comment #1 from John Dallaway <john@dallaway.org.uk> 2010-11-22 09:34:58 GMT ---
Phil, thank you for the bug report. Your proposed fix does not accommodate the
STM32 7 data bits + parity bit mode (where the M bit should be clear).

In effect, STM32 requires the word length to be specified inclusive of the
parity bit. Since the word length is represented by a single bit only, I
suggest we abandon the select_word_length array and calculate word_length in
stm32_serial_config_port() as follows:

  cyg_uint32 word_length =
    ((new_config->word_length == CYGNUM_SERIAL_WORD_LENGTH_8) &&
    (new_config->parity != CYGNUM_SERIAL_PARITY_NONE)) ?
    CYGHWR_HAL_STM32_UART_CR1_M_9 : CYGHWR_HAL_STM32_UART_CR1_M_8;

Do you concur?

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1001068] Bug in serial driver when using Parity (Even or Odd)
  2010-11-04 20:51 [Bug 1001068] New: Bug in serial driver when using Parity (Even or Odd) bugzilla-daemon
  2010-11-22  9:43 ` [Bug 1001068] " bugzilla-daemon
@ 2010-12-21 19:38 ` bugzilla-daemon
  2010-12-31  9:40 ` bugzilla-daemon
  2013-02-02 20:43 ` bugzilla-daemon
  3 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2010-12-21 19:38 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001068

--- Comment #2 from Phil <pme.neratec@gmx.ch> 2010-12-21 08:26:58 GMT ---
John - Yes I agree. Since I currently only use 8 data bit with or without
parity my proposed solution worked for me.

I would be happy if you would enhance the stm32 serial driver to be able to
properly handle the parity bit.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1001068] Bug in serial driver when using Parity (Even or Odd)
  2010-11-04 20:51 [Bug 1001068] New: Bug in serial driver when using Parity (Even or Odd) bugzilla-daemon
  2010-11-22  9:43 ` [Bug 1001068] " bugzilla-daemon
  2010-12-21 19:38 ` bugzilla-daemon
@ 2010-12-31  9:40 ` bugzilla-daemon
  2013-02-02 20:43 ` bugzilla-daemon
  3 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2010-12-31  9:40 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001068

--- Comment #3 from John Dallaway <john@dallaway.org.uk> 2010-12-21 19:37:52 GMT ---
Created an attachment (id=1068)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1068)
stm32-serial-m-101221.patch

This patch addresses the reported issue.

Phil, can you confirm that this works for you please?

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1001068] Bug in serial driver when using Parity (Even or Odd)
  2010-11-04 20:51 [Bug 1001068] New: Bug in serial driver when using Parity (Even or Odd) bugzilla-daemon
                   ` (2 preceding siblings ...)
  2010-12-31  9:40 ` bugzilla-daemon
@ 2013-02-02 20:43 ` bugzilla-daemon
  3 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2013-02-02 20:43 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001068

John Dallaway <john@dallaway.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |CURRENTRELEASE

--- Comment #5 from John Dallaway <john@dallaway.org.uk> ---
Marking "RESOLVED".

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1001068] Bug in serial driver when using Parity (Even or Odd)
  2010-11-04 20:51 [Bug 1001068] New: " bugzilla-daemon
@ 2010-11-22  9:35 ` bugzilla-daemon
  0 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2010-11-22  9:35 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001068

John Dallaway <john@dallaway.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEEDINFO
                 CC|                            |john@dallaway.org.uk
         AssignedTo|unassigned@bugs.ecos.source |john@dallaway.org.uk
                   |ware.org                    |
     Ever Confirmed|0                           |1

--- Comment #1 from John Dallaway <john@dallaway.org.uk> 2010-11-22 09:34:58 GMT ---
Phil, thank you for the bug report. Your proposed fix does not accommodate the
STM32 7 data bits + parity bit mode (where the M bit should be clear).

In effect, STM32 requires the word length to be specified inclusive of the
parity bit. Since the word length is represented by a single bit only, I
suggest we abandon the select_word_length array and calculate word_length in
stm32_serial_config_port() as follows:

  cyg_uint32 word_length =
    ((new_config->word_length == CYGNUM_SERIAL_WORD_LENGTH_8) &&
    (new_config->parity != CYGNUM_SERIAL_PARITY_NONE)) ?
    CYGHWR_HAL_STM32_UART_CR1_M_9 : CYGHWR_HAL_STM32_UART_CR1_M_8;

Do you concur?

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-02 20:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-04 20:51 [Bug 1001068] New: Bug in serial driver when using Parity (Even or Odd) bugzilla-daemon
2010-11-22  9:43 ` [Bug 1001068] " bugzilla-daemon
2010-12-21 19:38 ` bugzilla-daemon
2010-12-31  9:40 ` bugzilla-daemon
2013-02-02 20:43 ` bugzilla-daemon
2010-11-04 20:51 [Bug 1001068] New: " bugzilla-daemon
2010-11-22  9:35 ` [Bug 1001068] " bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).