[ECOS] Re:CYGNUM_HAL_RTC_PERIOD help

Ram Sudhir Tadavarthi ram.tadavarthi@netco.de
Wed May 10 06:57:00 GMT 2006



-----Ursprüngliche Nachricht-----
Von: Ram Sudhir Tadavarthi [mailto:ram.tadavarthi@netco.de] 
Gesendet: Mittwoch, 10. Mai 2006 08:54
An: 'Gary Thomas'
Betreff: AW: [ECOS] CYGNUM_HAL_RTC_PERIOD help

Hallo,

Target environment:
Platform : Motorola PQ2FADS-ZU Board
Processor: MPC 8280 (predecessor of MPC 8260)
Clock frequency : 100MHz

Project components:
eCos Kernel
FreeBSD stack

Thanks a lot. CYGHWR_HAL_POWERPC_BOARD_SPEED is set properly to 100MHz.
Still there is one more parameter CYGNUM_HAL_RTC_DENOMINATOR which decides
the CYGNUM_HAL_RTC_PERIOD. Can you please guide me how to find the proper
value for this denominator? I have set the numerator to 1000000000,
denominator to 100 and CYGNUM_HAL_RTC_PERIOD to
(((CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/4)/CYGNUM_HAL_RTC_DENOMINATOR)
which is computed as 250000.

With this configuration my loop back ping test (ping_lo_test.c) application
gives following ping results which the delay for loopback test ex: 80ms
which is too high(which might be incorrect due to wrong
CYGNUM_HAL_RTC_DENOMINATOR) and this delay value is changing if I change the
denominator. So I concluded that my CYGNUM_HAL_RTC_PERIOD settings are wrong
because the displayed time is high which is not believable because it is an
internal loopback test for freebsd stack. 

Can anybody show me the correct direction to proceed further?

Thanking you,
Ram


ping_lo_test.c results
64 bytes from 127.0.0.1: icmp_seq=0, time=80ms
Net malloc[32] = 0x0009e8d0
Allocate cluster = 0x000b7fc4
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=1, time=130ms
Net malloc[32] = 0x0009e8d0
Allocate cluster = 0x000b87c4
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=2, time=130ms
Net malloc[32] = 0x0009e8d0
Allocate cluster = 0x000b8fc4
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=3, time=130ms
Net malloc[32] = 0x0009e8d0
Allocate cluster = 0x000b97c4
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=4, time=130ms
Net malloc[32] = 0x0009e8d0
Allocate cluster = 0x000b9fc4
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=5, time=130ms
Net malloc[32] = 0x0009e8d0
Allocate cluster = 0x000ba7c4
Alloc mbuf = 0x000a6880
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=6, time=170ms
Net malloc[32] = 0x0009e8d0
Alloc mbuf = 0x000a6900
Allocate cluster = 0x000bafc4
Alloc mbuf = 0x000a6980
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=7, time=200ms
Net malloc[32] = 0x0009e8d0
Alloc mbuf = 0x000a6a00
Allocate cluster = 0x000bb7c4
Alloc mbuf = 0x000a6a80
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=8, time=200ms
Net malloc[32] = 0x0009e8d0
Alloc mbuf = 0x000a6b00
Allocate cluster = 0x000bbfc4
Alloc mbuf = 0x000a6b80
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=9, time=200ms
Net malloc[32] = 0x0009e8d0
Alloc mbuf = 0x000a6c00
Allocate cluster = 0x000bc7c4
Alloc mbuf = 0x000a6c80
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=10, time=210ms
Net malloc[32] = 0x0009e8d0
Alloc mbuf = 0x000a6d00
Allocate cluster = 0x000bcfc4
Alloc mbuf = 0x000a6d80
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=11, time=200ms
Net malloc[32] = 0x0009e8d0
Alloc mbuf = 0x000a6e00
Allocate cluster = 0x000bd7c4
Alloc mbuf = 0x000a6e80
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=12, time=200ms
Net malloc[32] = 0x0009e8d0
Alloc mbuf = 0x000a6f00
Allocate cluster = 0x000bdfc4
Alloc mbuf = 0x000a6f80
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=13, time=210ms
Net malloc[32] = 0x0009e8d0
Alloc mbuf = 0x000a7000
Allocate cluster = 0x000be7c4
Alloc mbuf = 0x000a7080
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=14, time=200ms
Net malloc[32] = 0x0009e8d0
Alloc mbuf = 0x000a7100
Allocate cluster = 0x000befc4
Alloc mbuf = 0x000a7180
Net malloc[32] = 0x0009e8d0
64 bytes from 127.0.0.1: icmp_seq=15, time=210ms
Sent 16 packets, received 16 OK, 0 bad



 

-----Ursprüngliche Nachricht-----
Von: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] Im Auftrag von Gary Thomas
Gesendet: Dienstag, 9. Mai 2006 18:33
An: Ram Sudhir Tadavarthi
Cc: ecos-discuss@ecos.sourceware.org
Betreff: Re: [ECOS] CYGNUM_HAL_RTC_PERIOD help

On Tue, 2006-05-09 at 18:22 +0200, Ram Sudhir Tadavarthi wrote:
> Dear all,
> 
> I am a newbie to embedded world and eCos as well. I am trying to bring up
> eCos on Motorola PQ2FADS board. In this journey I have encountered the
> Macros CYGNUM_HAL_RTC_PERIOD which depends on CYGNUM_HAL_RTC_NUMERATOR and
> CYGNUM_HAL_RTC_DENOMINATOR. I have observed that the proper definition of
> these values is required without which the time is calculated incorrectly.
> 
> I tried to experiment with these values to find out the correct one but
> trial and error did not help. I concluded that I won't be successful
without
> understanding the underlying concept behind this.
> 
> I have read the following documentation 
> http://ecos.sourceware.org/docs-latest/ref/hal-clocks-and-timers.html
> 
> but still did not understand how to find these values. I only understood
> that the period specifies clock interrupt intervals.
> 
> Can anyone give me a clue/pointer/reference to further documentation to
> proceed further to find out correct CYGNUM_HAL_RTC_NUMERATOR and
> CYGNUM_HAL_RTC_DENOMINATOR values?

The only value you should need to adjust is CYGNUM_HAL_RTC_PERIOD
        cdl_option CYGNUM_HAL_RTC_PERIOD {
            display       "Real-time clock period"
            flavor        data
            default_value {
(((CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/4)/CYGNUM_HAL_RTC_DENOMINATOR) }
        }

Thus, if you have the value set properly for CYGHWR_HAL_POWERPC_BOARD_SPEED,
you
should get the clock running at the right rate.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list