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] New: Bug in serial driver when using Parity (Even or Odd)
@ 2010-11-04 20:51 bugzilla-daemon
  2010-11-22  9:35 ` [Bug 1001068] " bugzilla-daemon
  0 siblings, 1 reply; 6+ messages in thread
From: bugzilla-daemon @ 2010-11-04 20:51 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

           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 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).