Can't enable a dummy clock driver

Denis Obrezkov denisobrezkov at gmail.com
Sun Jul 23 20:05:17 UTC 2017


2017-07-23 15:20 GMT+02:00 Denis Obrezkov <denisobrezkov at gmail.com>:

> 2017-07-22 21:24 GMT+02:00 Joel Sherrill <joel at rtems.org>:
>
>>
>>
>> On Jul 22, 2017 3:01 PM, "Denis Obrezkov" <denisobrezkov at gmail.com>
>> wrote:
>>
>> Hello, I am trying to enable a dummy clock driver.
>> I did as Joel suggested like in v850sim BSP.
>> But now I have a problem - the driver isn't initialized properly.
>> I receive an exception "Illegal instruction" during rtems_io_initialize.
>> The line with the exception is /cpukit/sapi/src/ioinitialize.c:36:
>> return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL
>>
>> and "p callout" in gdb returns:
>> (rtems_device_driver_entry) 0x2040087c <Clock_initialize+34>
>>
>> What could be the reason for such a behavior?
>>
>>
>> Accidental data overwrite?
>>
>>
>>
>> --
>> Regards, Denis Obrezkov
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>>
>>
>>
> I was able to proceed further by enabling a console driver. But I can't
> create a thread, because of an error.
> For example, I have a backtrace:
> #0  0x20408984 in rtems_task_start (id=2147488832 <(214)%20748-8832>,
> entry_point=0x80001448, argument=16777216)
>     at /home/reprofy/Projects/riscv/rtems/development/rtems/
> kernel/rtems-riscv/c/src/../../cpukit/rtems/src/taskstart.c:29
> #1  0x204004c6 in Init (argument=0) at /home/reprofy/Projects/riscv/
> rtems/development/rtems/kernel/rtems-riscv/c/src/../..
> /testsuites/samples/ticker/init.c:59
> #2  0x20410438 in _Thread_Entry_adaptor_idle (executing=0x80000f88)
>     at /home/reprofy/Projects/riscv/rtems/development/rtems/
> kernel/rtems-riscv/c/src/../../cpukit/score/src/
> threadentryadaptoridle.c:25
> #3  0x2041ba5c in _Thread_Handler () at /home/reprofy/Projects/riscv/
> rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/score/src/
> threadhandler.c:73
> #4  0x2041b9fa in _User_extensions_Thread_exitted (executing=0x80000f88)
> at ../../cpukit/../../../hifive1/lib/include/rtems/score/userextimpl.h:298
>
> But after several steps it is:
> #0  0x204104f2 in _Objects_Are_ids_equal (left=541099722, right=2147490432
> <(214)%20749-0432>) at ../../cpukit/../../../hifive1/
> lib/include/rtems/score/objectimpl.h:817
> #1  0x2041057a in _Thread_Get (id=167837697, lock_context=0x80001a58) at
> /home/reprofy/Projects/riscv/rtems/development/rtems/
> kernel/rtems-riscv/c/src/../../cpukit/score/src/threadget.c:28
> #2  0x204089c0 in rtems_task_start (id=167837697, entry_point=0x204003a4
> <Test_task>, argument=1)
>     at /home/reprofy/Projects/riscv/rtems/development/rtems/
> kernel/rtems-riscv/c/src/../../cpukit/rtems/src/taskstart.c:43
> #3  0x204004c6 in Init (argument=0) at /home/reprofy/Projects/riscv/
> rtems/development/rtems/kernel/rtems-riscv/c/src/../..
> /testsuites/samples/ticker/init.c:59
> #4  0x20410438 in _Thread_Entry_adaptor_idle (executing=0x80000f88)
>     at /home/reprofy/Projects/riscv/rtems/development/rtems/
> kernel/rtems-riscv/c/src/../../cpukit/score/src/
> threadentryadaptoridle.c:25
> #5  0x2041ba5c in _Thread_Handler () at /home/reprofy/Projects/riscv/
> rtems/development/rtems/kernel/rtems-riscv/c/src/../../cpukit/score/src/
> threadhandler.c:73
> #6  0x2041b9fa in _User_extensions_Thread_exitted (executing=0x80000f88)
> at ../../cpukit/../../../hifive1/lib/include/rtems/score/userextimpl.h:298
> Backtrace stopped: frame did not save the PC
>
> You can see that rtems_task_start arguments have been changed. Though it
> is the same function.
> Also, the value of 'left' in _Objects_Are_ids_equal should be 'id' value
> from _Thread_Get.
>
>
> --
> Regards, Denis Obrezkov
>
> 2017-07-22 21:24 GMT+02:00 Joel Sherrill <joel at rtems.org>:
>
>>
>>
>> On Jul 22, 2017 3:01 PM, "Denis Obrezkov" <denisobrezkov at gmail.com>
>> wrote:
>>
>> Hello, I am trying to enable a dummy clock driver.
>> I did as Joel suggested like in v850sim BSP.
>> But now I have a problem - the driver isn't initialized properly.
>> I receive an exception "Illegal instruction" during rtems_io_initialize.
>> The line with the exception is /cpukit/sapi/src/ioinitialize.c:36:
>> return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL
>>
>> and "p callout" in gdb returns:
>> (rtems_device_driver_entry) 0x2040087c <Clock_initialize+34>
>>
>> What could be the reason for such a behavior?
>>
>>
>> Accidental data overwrite?
>>
>>
>>
>> --
>> Regards, Denis Obrezkov
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>>
>>
>>
>
>
> --
> Regards, Denis Obrezkov
>
My stack size was only 256.
I increased it back to 512, so now I obtain:
*** LOW MEMORY CLOCK TICK TEST ***
                                  TA1  - rtems_clock_get_tod - 09:00:00
12/31/1988

        TA-2147475599  - rtems_clock_get_tod - 09:00:00   12/31/1988

(I haven't implemented in the console driver a special symbol substitution
(\n -> \r))
The name of the task in not very pleasant.

Also, should printk work without
"CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER" being defined?

-- 
Regards, Denis Obrezkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170723/60231e31/attachment-0002.html>


More information about the devel mailing list