This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Reading/Writing Registers in Omap35x

Other Parts Discussed in Thread: OMAP3530

A year ago in March, Juan Gonzales posted an app to enable reading a writing the OMAP35x registers.  I am trying to get this app running on the OMAP35x rev G EVM.  When I run this app as instructed by Juan's post last year, it crashes.  This is the output it gives:

 

root@omap3evm:/#
root@omap3evm:/# echo 01c40000 > /proc/regrw
ascii address is: ascii address is: 0011cc4400000000

<1>Unable to handle kernel paging request at virtual address 91c40000
Unable to handle kernel paging request at virtual address 91c40000
<1>pgd = c5a84000
pgd = c5a84000
<1>[91c40000] *pgd=00000000[91c40000] *pgd=00000000

Internal error: Oops: 5 [#1]
Internal error: Oops: 5 [#1]
Modules linked in:Modules linked in: regrw regrw sdmak sdmak lpm_omap3530 lpm_om
ap3530 dsplinkk dsplinkk cmemk cmemk

CPU: 0    Not tainted  (2.6.29-rc3-omap1 #3)
CPU: 0    Not tainted  (2.6.29-rc3-omap1 #3)
PC is at regrw_proc+0x12c/0x168 [regrw]
PC is at regrw_proc+0x12c/0x168 [regrw]
LR is at regrw_proc+0x118/0x168 [regrw]
LR is at regrw_proc+0x118/0x168 [regrw]
pc : [<bf039234>]    lr : [<bf039220>]    psr: 60000013
sp : c4e3fef0  ip : bf039b60  fp : c4e3ff1c
pc : [<bf039234>]    lr : [<bf039220>]    psr: 60000013
sp : c4e3fef0  ip : bf039b60  fp : c4e3ff1c
r10: 00000000  r9 : c4e3e000  r8 : 4001c000
r10: 00000000  r9 : c4e3e000  r8 : 4001c000
r7 : 00000009  r6 : c4e3fef8  r5 : 4001c000  r4 : 00000008
r7 : 00000009  r6 : c4e3fef8  r5 : 4001c000  r4 : 00000008
r3 : 01c40000  r2 : 91c40000  r1 : 01c40000  r0 : 01c40000
r3 : 01c40000  r2 : 91c40000  r1 : 01c40000  r0 : 01c40000
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5387d  Table: 85a84019  DAC: 00000015
Control: 10c5387d  Table: 85a84019  DAC: 00000015
Process sh (pid: 1225, stack limit = 0xc4e3e2e0)
Process sh (pid: 1225, stack limit = 0xc4e3e2e0)
Stack: (0xc4e3fef0 to 0xc4e40000)
Stack: (0xc4e3fef0 to 0xc4e40000)
fee0: fee0:
    00000057 00000057 00000000 00000000 34633130 34633130 30303030 30303030

ff00: ff00: c5a407a0 c5a407a0 4001c000 4001c000 c4e3ff70 c4e3ff70 00000009 00000
009 c4e3ff2c c4e3ff2c c4e3ff20 c4e3ff20 c00edef8 c00edef8 bf039114 bf039114

ff20: ff20: c4e3ff44 c4e3ff44 c4e3ff30 c4e3ff30 c00e9830 c00e9830 c00eded4 c00ed
ed4 c4fcee40 c4fcee40 4001c000 4001c000 c4e3ff6c c4e3ff6c c4e3ff48 c4e3ff48

ff40: ff40: c00aef64 c00aef64 c00e97f4 c00e97f4 c00ac8a4 c00ac8a4 00000000 00000
000 00000000 00000000 00000000 00000000 c4fcee40 c4fcee40 00000009 00000009

ff60: ff60: c4e3ffa4 c4e3ffa4 c4e3ff70 c4e3ff70 c00af424 c00af424 c00aeeb4 c00ae
eb4 00000000 00000000 00000000 00000000 c4e3ffa4 c4e3ffa4 00000000 00000000

ff80: ff80: c00ba748 c00ba748 00000009 00000009 4001c000 4001c000 401d95f8 401d9
5f8 00000004 00000004 c002ffa8 c002ffa8 00000000 00000000 c4e3ffa8 c4e3ffa8

ffa0: ffa0: c002fe00 c002fe00 c00af3ec c00af3ec 00000009 00000009 4001c000 4001c
000 00000001 00000001 4001c000 4001c000 00000009 00000009 00000000 00000000

ffc0: ffc0: 00000009 00000009 4001c000 4001c000 401d95f8 401d95f8 00000004 00000
004 00000009 00000009 00000000 00000000 00000001 00000001 000a929c 000a929c

ffe0: ffe0: 00000000 00000000 bea55460 bea55460 40127440 40127440 4017147c 40171
47c 60000010 60000010 00000001 00000001 00000000 00000000 00000000 00000000

Backtrace: Backtrace:

[<bf039108>] [<bf039108>] (regrw_proc+0x0/0x168 [regrw]) (regrw_proc+0x0/0x168 [
regrw]) from [<c00edef8>] from [<c00edef8>] (proc_file_write+0x30/0x34)
(proc_file_write+0x30/0x34)
 r7:00000009 r7:00000009 r6:c4e3ff70 r6:c4e3ff70 r5:4001c000 r5:4001c000 r4:c5a4
07a0 r4:c5a407a0

[<c00edec8>] [<c00edec8>] (proc_file_write+0x0/0x34) (proc_file_write+0x0/0x34)
from [<c00e9830>] from [<c00e9830>] (proc_reg_write+0x48/0x5c)
(proc_reg_write+0x48/0x5c)
[<c00e97e8>] [<c00e97e8>] (proc_reg_write+0x0/0x5c) (proc_reg_write+0x0/0x5c) fr
om [<c00aef64>] from [<c00aef64>] (vfs_write+0xbc/0x14c)
(vfs_write+0xbc/0x14c)
 r5:4001c000 r5:4001c000 r4:c4fcee40 r4:c4fcee40

[<c00aeea8>] [<c00aeea8>] (vfs_write+0x0/0x14c) (vfs_write+0x0/0x14c) from [<c00
af424>] from [<c00af424>] (sys_write+0x44/0x70)
(sys_write+0x44/0x70)
 r7:00000009 r7:00000009 r6:c4fcee40 r6:c4fcee40 r5:00000000 r5:00000000 r4:0000
0000 r4:00000000

[<c00af3e0>] [<c00af3e0>] (sys_write+0x0/0x70) (sys_write+0x0/0x70) from [<c002f
e00>] from [<c002fe00>] (ret_fast_syscall+0x0/0x2c)
(ret_fast_syscall+0x0/0x2c)
 r8:c002ffa8 r8:c002ffa8 r7:00000004 r7:00000004 r6:401d95f8 r6:401d95f8 r5:4001
c000 r5:4001c000 r4:00000009 r4:00000009

Code: Code: e2802209 e2802209 e1a03000 e1a03000 e58c3000 e58c3000 e1a01000 e1a01
000 (e5923000) (e5923000)

<4>---[ end trace 8d9c2a8359fa492b ]---
---[ end trace 8d9c2a8359fa492b ]---

 _____                    _____           _         _
|  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
|     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
|__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|
              |___|                    |___|

Arago Project http://arago-project.org omap3evm ttyS0

Arago 2009.09 omap3evm ttyS0

omap3evm login:

 

And then for a different address it gives this output:

root@omap3evm:~#
root@omap3evm:~# echo 48050c08 > /proc/regrw
ascii address is: ascii address is: 4488005500cc0088

<1>Unhandled fault: external abort on non-linefetch (0x1028) at 0xd8050c08
Unhandled fault: external abort on non-linefetch (0x1028) at 0xd8050c08
Internal error: : 1028 [#2]
Internal error: : 1028 [#2]
Modules linked in:Modules linked in: regrw regrw sdmak sdmak lpm_omap3530 lpm_om
ap3530 dsplinkk dsplinkk cmemk cmemk

CPU: 0    Tainted: G      D     (2.6.29-rc3-omap1 #3)
CPU: 0    Tainted: G      D     (2.6.29-rc3-omap1 #3)
PC is at regrw_proc+0x12c/0x168 [regrw]
PC is at regrw_proc+0x12c/0x168 [regrw]
LR is at regrw_proc+0x118/0x168 [regrw]
LR is at regrw_proc+0x118/0x168 [regrw]
pc : [<bf039234>]    lr : [<bf039220>]    psr: 60000013
sp : c5a57ef0  ip : bf039b60  fp : c5a57f1c
pc : [<bf039234>]    lr : [<bf039220>]    psr: 60000013
sp : c5a57ef0  ip : bf039b60  fp : c5a57f1c
r10: 00000000  r9 : c5a56000  r8 : 4001c000
r10: 00000000  r9 : c5a56000  r8 : 4001c000
r7 : 00000009  r6 : c5a57ef8  r5 : 4001c000  r4 : 00000008
r7 : 00000009  r6 : c5a57ef8  r5 : 4001c000  r4 : 00000008
r3 : 48050c08  r2 : d8050c08  r1 : 48050c08  r0 : 48050c08
r3 : 48050c08  r2 : d8050c08  r1 : 48050c08  r0 : 48050c08
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5387d  Table: 85a3c019  DAC: 00000015
Control: 10c5387d  Table: 85a3c019  DAC: 00000015
Process sh (pid: 1234, stack limit = 0xc5a562e0)
Process sh (pid: 1234, stack limit = 0xc5a562e0)
Stack: (0xc5a57ef0 to 0xc5a58000)
Stack: (0xc5a57ef0 to 0xc5a58000)
7ee0: 7ee0:
    00000057 00000057 00000000 00000000 35303834 35303834 38306330 38306330

7f00: 7f00: c5a407a0 c5a407a0 4001c000 4001c000 c5a57f70 c5a57f70 00000009 00000
009 c5a57f2c c5a57f2c c5a57f20 c5a57f20 c00edef8 c00edef8 bf039114 bf039114

7f20: 7f20: c5a57f44 c5a57f44 c5a57f30 c5a57f30 c00e9830 c00e9830 c00eded4 c00ed
ed4 c5ae0b60 c5ae0b60 4001c000 4001c000 c5a57f6c c5a57f6c c5a57f48 c5a57f48

7f40: 7f40: c00aef64 c00aef64 c00e97f4 c00e97f4 c00ac8a4 c00ac8a4 00000000 00000
000 00000000 00000000 00000000 00000000 c5ae0b60 c5ae0b60 00000009 00000009

7f60: 7f60: c5a57fa4 c5a57fa4 c5a57f70 c5a57f70 c00af424 c00af424 c00aeeb4 c00ae
eb4 00000000 00000000 00000000 00000000 c5a57fa4 c5a57fa4 00000000 00000000

7f80: 7f80: c00ba748 c00ba748 00000009 00000009 4001c000 4001c000 401d95f8 401d9
5f8 00000004 00000004 c002ffa8 c002ffa8 00000000 00000000 c5a57fa8 c5a57fa8

7fa0: 7fa0: c002fe00 c002fe00 c00af3ec c00af3ec 00000009 00000009 4001c000 4001c
000 00000001 00000001 4001c000 4001c000 00000009 00000009 00000000 00000000

7fc0: 7fc0: 00000009 00000009 4001c000 4001c000 401d95f8 401d95f8 00000004 00000
004 00000009 00000009 00000000 00000000 00000001 00000001 000a929c 000a929c

7fe0: 7fe0: 00000000 00000000 be938460 be938460 40127440 40127440 4017147c 40171
47c 60000010 60000010 00000001 00000001 00000000 00000000 00000000 00000000

Backtrace: Backtrace:

[<bf039108>] [<bf039108>] (regrw_proc+0x0/0x168 [regrw]) (regrw_proc+0x0/0x168 [
regrw]) from [<c00edef8>] from [<c00edef8>] (proc_file_write+0x30/0x34)
(proc_file_write+0x30/0x34)
 r7:00000009 r7:00000009 r6:c5a57f70 r6:c5a57f70 r5:4001c000 r5:4001c000 r4:c5a4
07a0 r4:c5a407a0

[<c00edec8>] [<c00edec8>] (proc_file_write+0x0/0x34) (proc_file_write+0x0/0x34)
from [<c00e9830>] from [<c00e9830>] (proc_reg_write+0x48/0x5c)
(proc_reg_write+0x48/0x5c)
[<c00e97e8>] [<c00e97e8>] (proc_reg_write+0x0/0x5c) (proc_reg_write+0x0/0x5c) fr
om [<c00aef64>] from [<c00aef64>] (vfs_write+0xbc/0x14c)
(vfs_write+0xbc/0x14c)
 r5:4001c000 r5:4001c000 r4:c5ae0b60 r4:c5ae0b60

[<c00aeea8>] [<c00aeea8>] (vfs_write+0x0/0x14c) (vfs_write+0x0/0x14c) from [<c00
af424>] from [<c00af424>] (sys_write+0x44/0x70)
(sys_write+0x44/0x70)
 r7:00000009 r7:00000009 r6:c5ae0b60 r6:c5ae0b60 r5:00000000 r5:00000000 r4:0000
0000 r4:00000000

[<c00af3e0>] [<c00af3e0>] (sys_write+0x0/0x70) (sys_write+0x0/0x70) from [<c002f
e00>] from [<c002fe00>] (ret_fast_syscall+0x0/0x2c)
(ret_fast_syscall+0x0/0x2c)
 r8:c002ffa8 r8:c002ffa8 r7:00000004 r7:00000004 r6:401d95f8 r6:401d95f8 r5:4001
c000 r5:4001c000 r4:00000009 r4:00000009

Code: Code: e2802209 e2802209 e1a03000 e1a03000 e58c3000 e58c3000 e1a01000 e1a01
000 (e5923000) (e5923000)

<4>---[ end trace 8d9c2a8359fa492c ]---
---[ end trace 8d9c2a8359fa492c ]---

 _____                    _____           _         _
|  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
|     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
|__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|
              |___|                    |___|

Arago Project http://arago-project.org omap3evm ttyS0

Arago 2009.09 omap3evm ttyS0

omap3evm login:

 

Does anyone know why I'm getting these errors that are crashing the program, and what I need to do to get the application to work?

 

Thanks

 

  • If you try accessing a register in a domain that does not have its clock running, or is in a powered down state then you will trigger a bus error since the peripheral will not respond and the bus transaction will timeout.

    Make sure that the peripheral is up and running before accessing it.

    For example, accessing the VENC control registers as you are trying to do above will certainly cause a bus exception if the VENC is not running.

    BR,

    Steve

  • Steve,

    I am running a Loopback application on the board, so its using both the composite input and output on the board.  So I've been assuming that the VENC control register is running, but how do I verify that its getting a clock and in a powered on state.

    Also, have you ran the regrw application on the OMAP35x evm before and know that it should work?

    Thanks for your help.

  • If you have something displayed on the TV out then yes, the sub-system is powered and the clocks are running.

    I use a different utility called mem_util for writing to registers.

    You can get it from https://gforge.ti.com/gf/project/am_sysinfo/scmsvn/?action=browse&path=%2F*checkout*%2Ftrunk%2Fmem_util%2Fmem_util.c&revision=2&pathrev=2

    BR,

    Steve

  • Steve,

    I built and ran the mem_util app, and I'm getting somewhat similar results, but its not crashing the system.  Here are some of the registers I tried to read.

    root@omap3evm:/#
    root@omap3evm:/# ./mem_util 0x01c40000 w
    /dev/mem opened.<1>Unhandled fault: external abort on non-linefetch (0x1018) at
    0x4001e000
    Unhandled fault: external abort on non-linefetch (0x1018) at 0x4001e000

    Memory mapped at address 0x4001e000.
    Bus error
    root@omap3evm:/#

     


    root@omap3evm:/# ./mem_util 0x48050c08 w
    /dev/mem opened.<1>Unhandled fault: external abort on non-linefetch (0x1018) at
    0x4001ec08
    Unhandled fault: external abort on non-linefetch (0x1018) at 0x4001ec08

    Memory mapped at address 0x4001e000.
    Bus error
    root@omap3evm:/#

     


    root@omap3evm:/# ./mem_util 0x80000000 w
    /dev/mem opened.
    Memory mapped at address 0x4001e000.
    Value at address 0x80000000 (0x4001e000): 0x6362696C
    root@omap3evm:/#

     

    Am I running the application properly?  I was able to get a result with 0x80000000, but nothing else has seemed to work.  Is there a reason why I wouldn't be able to read these other registers?  Have you been able to get good results with the other registers I've tried when you run the application?

    Thanks

     

     

     

     

  • What memory locations are you trying to read?

    0x01c40000 does not appear to be a hardware register, so it may not be mapped as a physical-logical address.

    0x48050c08 is a VENC register and should be readable. Is the loopback application still running and displaying an image on the TV out when you try to read this address?

    BR,

    Steve

  • Steve,

    I hadn't actually  tried reading the register while I was running the Loopback application.  I was able to read the register while I ran the application.  I'm guessing that the VENC register isn't actually getting a clock unless it is opened and being used?  If this is correct, is there a way to have all the registers receive a clock so that I can read them any time?

    Thanks for your help.

  • Under Linux you can simply enable the TV output.

    Have a look at the following web page.

    http://processors.wiki.ti.com/index.php/UserGuideDisplayDrivers_PSP_03.00.00.05

    You can also try the following...

    echo 0 > /sys/devices/platform/omapdss/overlay0/enabled
    echo "" > /sys/devices/platform/omapdss/overlay0/manager
    echo 0 > /sys/devices/platform/omapdss/display0/enabled
    echo "tv" > /sys/devices/platform/omapdss/overlay0/manager
    echo 1 > /sys/devices/platform/omapdss/display1/enabled
    echo 1 > /sys/devices/platform/omapdss/overlay0/enabled

     

    You can also look at the source code for the loop back application to see what it does in order to enable the TV output and then possibly reproduce that part of code without closing down the TV output.

    BR,

    Steve

  • Working with OMAP3530 ARM Cortex-A8.

    I'm trying to read a SDMA register, DMA4_REVISION at physical address 0x4805 6000, from my application written in C.  I'm using mmap() to map this physical address to virtual address but I get the following error when I try to read the register.    

    Unhandled fault: external abort on non-linefetch (0x1018) at 0x40021000
    bus error

    I know my mmap() implementation is right because I can read a GPMC register, GPMC_REVISION at physical address 0x6E00 0000, and I can read from it no problem.   From previous post, Steve mentioned that the bus error problem could be caused by the DMA module not having a clock or it being in power down state.  However, I don't know if that is my problem, because I'm able to read this register from my kernel space DMA driver with ioremap() at any time, no problem.  Then I try to access this register from my application user-space application and I get this error. Why am I able to read this register from kernel space but not from user-space?

    I am trying to read DMA status registers from my application to prevent from having to make an ioctl() call to do the same thing.  Figured its faster this way.