public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jlarmour@redhat.com>
To: jeremy <chienyul@home.com>
Cc: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] HAL register write problem
Date: Thu, 18 Jan 2001 19:04:00 -0000	[thread overview]
Message-ID: <3A67AEC7.6036562F@redhat.com> (raw)
In-Reply-To: <000e01c08183$65c3bf00$7c6509c0@viatech.com>

jeremy wrote:
> 
> My platform is Samsung KS32C50100, which operates in big-endian mode.
> I got some problem with writing to register using HAL_WRITE function.
> For example, in plf_stub.c where I put the UART initialization function
> in,
> Here I write some initialize value to UART control registers,
>  HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_UART_UTXBUF, 0x0);
>  HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_UART_URXBUF, 0x0);
>  HAL_WRITE_UINT16(CYG_DEVICE_SERIAL_RS232_UART_UBRDIV, 0x280);
> 
> The first two lines for writing 8-bits registers works fine. But the
> last line doesn't write
> anything into the 16-bits register. I defined that 16-bits register
> like this in the first part
> of the program:
> #define CYG_DEVICE_SERIAL_RS232_UART_UBRDIV \
>     ((volatile cyg_uint16 *) CYG_DEVICE_SERIAL_RS232_UART_BASE + 0x14)

At a guess, you were probably intending to write

#define CYG_DEVICE_SERIAL_RS232_UART_UBRDIV \
    ((volatile cyg_uint16 *) (CYG_DEVICE_SERIAL_RS232_UART_BASE + 0x14))

because adding 0x14 to something cast to a pointer to a 16-bit type will
increment it by 2*0x14=0x28 bytes.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine

  parent reply	other threads:[~2001-01-18 19:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-18 14:07 jeremy
2001-01-18 15:11 ` Gary Thomas
2001-01-18 19:04 ` Jonathan Larmour [this message]
2001-01-19  8:33 ` Grant Edwards
2001-01-19 19:37   ` jeremy
2001-01-22  0:40     ` Jesper Skov
2001-01-23 16:16 jeremy
2001-01-24  7:18 ` Grant Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A67AEC7.6036562F@redhat.com \
    --to=jlarmour@redhat.com \
    --cc=chienyul@home.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).