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.

segmentation fault on target

Other Parts Discussed in Thread: PMP, CCSTUDIO

Hi,

i am presently working on 816x/393x ti digital spectral board . Recently i downloaded a zip file to run the test code on the board . In the zip file i got four folder GEL,INCLUDE,LIB AND TEST.  I tried to write my code to blink the led using I2C0 .

MY CODE IS

#include "evm816x.h"

#include "evm816x_i2c.h"

main()

{

  char val[2];

 val[0]=0xaa;

val[1]=0xff;

EVM816X_init();

EVM816X_write_i2c0(0x20,val,2);

}

I am using ubuntu 11.10 and i am using Makefile to compile my code and execute them on the target.

the content of my makefile is

include /usr/local/ezsdk/Rules.make

sec:
    $(CSTOOL_PREFIX)gcc -o seven secondapp.c

/usr/local/ezsdk is the location where i installed my ezsdk.

when i am trying to compile the program i got an error

/root/CodeSourcery/Sourcery_G++_Lite//bin/arm-none-linux-gnueabi-gcc -o seven secondapp.c
/tmp/ccMFHN89.o: In function `main':
secondapp.c:(.text+0x1c): undefined reference to `EVM816X_init'
collect2: ld returned 1 exit status
make: *** [sec] Error 1

In order to overcome this error what i have done is i have included the .c file in my test code file . now my file look like

#include "evm816x.h"

#include "evm816x_i2c.h"

#include "evm816x.c"

#include "evm816x_i2c.c"

main()

{

  char val[2];

 val[0]=0xaa;

val[1]=0xff;

EVM816X_init();

EVM816X_write_i2c0(0x20,val,2);

}

after doing this i am able to generate the executable file.

I have changed the base address but still i am getting segmentation fault.

IN ORDER to see where my program is geting segmentation fault i found that when i try to write any I2C register i got the segmentation fault.

Also I HAVE Done nothing with the gel file. Please tell me the purpose of having gel file and its application . And also tell me the correct way to include the library so that i don't have to include .c file in the main application.

please help me out

  • Vineet,

    What are you trying to do here? Are you running the executable on the target or host PC? If its on target, please share the complete logs, including the boot logs. 

  • Hi Renjith Thomas

    here is my boot log

    BOOTLOG

    Welcome to minicom 2.5

    OPTIONS: I18n

    Compiled on May 2 2011, 00:39:27.

    Port /dev/ttyUSB3

    Press CTRL-A Z for help on special keys

    U-Boot 2010.06 (Oct 10 2012 - 02:01:22)

    TI8168-GP rev 2.1

    ARM clk: 987MHz

    DDR clk: 796MHz

    I2C: ready

    DRAM: 2 GiB

    NAND: HW ECC BCH8 Selected

    256 MiB

    MMC: OMAP SD/MMC: 0

    :,;;:;:;;;;;;;;r;;:,;;:;:;;;;;;;;:,;;:;:;;;;;;;;:,;;:;:;;;;;;;;:;;;;;;;;:,;;:;:

    ;,;:::;;;;r;;;rssiSiS552X5252525259GX2X9hX9X9XX2325S55252i5:,;;:;:;;;;;;;;:,;;:

    ;:;;;;;;;rrssSsS52S22h52299GGAAMHMM#BBH#B#HMM#HMBA&&XX2255S2S5Si:,;;:;:;;;;;;;;

    ;:;;r;;rsrrriiXS5S329&A&MH#BMB#A&9XXA252GXiSXX39AAMMMBB&G22S5i2SSiiiisi:,;;:;:;

    ;;;;;r;rr2iisiih393HB#B#AA99i22irrrX3X52AGsisss2Xii2299HBMA&X2S5S5iSiisSsi:,;;:

    r:r;rrsrsihXSi2&##MHB&Ahh3AGHGA9G9h&#H##@@@##MAMMXXX9SSS29&&HGGX2i5iisiiisisi:,

    ;;rrrrsSiiiA&ABH&A9GAGhAhBAMHA9HM@@@@@@@@@@@@@@@@@@@HHhAh2S2SX9&Gh22SSiisiiisii

    r:rrssisiS2XM##&h3AGAX&3GG3Ssr5H@M#HM2; ;2X&&&MHMB###GBB#B&XXSSs529XX55iSsisisi

    r;rsrisSi2XHAhX99A3XXG&&XS;:,rH#HGhAS @@@@3rs2XBM@@A552&&AHA2XiisSS252SSsisSs

    r;issi5S22&&3iSSX292&hXsr;;:;h@&G339&S9@@@@2@MA&9&HB##Xris29ABMAAX2ir;rsSi5iss5

    rrsSi2XhG&9GXh399&X99i;;;;;;r#H&293H9X#@@@@@@@B&9GhAH@XrrsrsiXABHB&HG2rr;rrSiSi

    ;:rsisS599&AA9XG&3A35r;:::;,;BMh&&2iX5A@@@@@@@&392X5GB2;;;r;iSX393A##A&Xi:::rsi

    ;:rss552222X553&XHMhir;;::,:,h#HhGSXhG3#@@@@#AXXS2XAHA;::;;;;ss55XShBA3239r:,;;

    r;ii2S5SSi2i53hirsh2srr::,,,,;MMXX359&Ah3h&Si59SX99A#i:,::::;;sri2,.2r;:SGAr;,:

    ;:;rrrrssiriXGSi::shs;;;,,,:,,rBBA9h5s5h5iS5isi2SAHB5:,,,:::;rrs5&SrisSX5Srrr:,

    ;,r;;;;rsriSSrrrr;;5Xrr;;,:,,.,;9AA2SsisS5323XXXG9&i:.,,::;;r;;;srrrrrr;;:;::::

    :,;r;r;rrissrrr;:;::;s;;;;,:,,..,r293h222hXXAAGGGX;:,,,:,:,::;:;::,:,,,,...,,,,

    ;,;;;;rrrrrrrrirr;,.,,:::::::,,,,.,;SX&ABAB2hhXir:,,.,,.,,:,,,,..,,,..,..,,,..:

    :.:;:;;;:;;;;r;rrs;:.. ,,:::::,:,:,,.::rrsrr;;,,.......,..,....,,,,,,,...,.,,:,

    :.:::,::::::;;r;rrr;:.......,.,.,,:::,,...............,,::.,,,,:,::,,:,:,,,:,;:

    ,.::,:,,,,,;;;;;;;;r;;::,..............................;;;:;::::,:::::::,:,:,,,

    : ,,:,,,,,,,,,,,,,:;rrr;;:;,,,,,,,::,.,.:.,.,;s,:;;;;:;:;;;;;::::,:::,:::,:,:,:

    ,.,,,,,,,...,,.,,....................................:,............:,,,:,:,,,,,

    Net: Detected MACID:0:18:31:e6:e0:dc

    Ethernet PHY: GENERIC @ 0x01

    DaVinci EMAC

    Hit any key to stop autoboot: 0

    NAND read: device 0 offset 0x280000, size 0x272800

    2566144 bytes read: OK

    ## Booting kernel from Legacy Image at 81000000 ...

    Image Name: Arago/2.6.37-psp04.04.00.01/dm81

    Image Type: ARM Linux Kernel Image (uncompressed)

    Data Size: 2566028 Bytes = 2.4 MiB

    Load Address: 80008000

    Entry Point: 80008000

    Verifying Checksum ... OK

    Loading Kernel Image ... OK

    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.

    Linux version 2.6.37 (x0029463@swubn01) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #1 Wed Oct 10 01:57:43 IST 2012

    CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f

    CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache

    Machine: ti8168evm

    reserved size = 52428800 at 0x0

    FB: Reserving 52428800 bytes SDRAM for VRAM

    Memory policy: ECC disabled, Data cache writeback

    OMAP chip is TI8168 2.0

    Built 1 zonelists in Zone order, mobility grouping on. Total pages: 19712

    Kernel command line: console=ttyO2,115200n8 root=/dev/nfs nfsroot=10.0.0.1:/root/targetfs,nolock rw mem=128M

    ip=10.0.0.2:10.0.0.1:10.0.0.1:255.255.255.0:dm816x:eth0:off rootdelay=4 notifyk.vpssm3_sva=0xbf900000

    PID hash table entries: 512 (order: -1, 2048 bytes)

    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)

    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)

    Memory: 78MB = 78MB total

    Memory: 73216k/73216k available, 57856k reserved, 0K highmem

    Virtual kernel memory layout:

    vector : 0xffff0000 - 0xffff1000 ( 4 kB)

    fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)

    DMA : 0xffc00000 - 0xffe00000 ( 2 MB)

    vmalloc : 0xc8800000 - 0xf8000000 ( 760 MB)

    lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)

    pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)

    modules : 0xbf000000 - 0xbfe00000 ( 14 MB)

    .init : 0xc0008000 - 0xc003c000 ( 208 kB)

    .text : 0xc003c000 - 0xc04da000 (4728 kB)

    .data : 0xc04da000 - 0xc0522f00 ( 292 kB)

    SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

    NR_IRQS:407

    IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts

    Total of 128 interrupts on 1 active controller

    GPMC revision 6.0

    Trying to install interrupt handler for IRQ400

    Trying to install interrupt handler for IRQ401

    Trying to install interrupt handler for IRQ402

    Trying to install interrupt handler for IRQ403

    Trying to install interrupt handler for IRQ404

    Trying to install interrupt handler for IRQ405

    Trying to install interrupt handler for IRQ406

    Trying to install type control for IRQ407

    Trying to set irq flags for IRQ407

    OMAP clockevent source: GPTIMER1 at 27000000 Hz

    Console: colour dummy device 80x30

    Calibrating delay loop... 986.31 BogoMIPS (lpj=4931584)

    pid_max: default: 32768 minimum: 301

    Security Framework initialized

    Mount-cache hash table entries: 512

    CPU: Testing write buffer coherency: ok

    devtmpfs: initialized

    omap_voltage_early_init: voltage driver support not added

    regulator: core version 0.5

    regulator: dummy:

    NET: Registered protocol family 16

    omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!

    omap_voltage_add_dev: VDD specified does not exist!

    OMAP GPIO hardware version 0.1

    OMAP GPIO hardware version 0.1

    omap_mux_init: Add partition: #1: core, flags: 0

    _omap_mux_get_by_name: Could not find signal i2c2_scl.i2c2_scl

    _omap_mux_get_by_name: Could not find signal i2c2_sda.i2c2_sda

    NOR: Can't request GPMC CS

    registered ti816x_gpio_vr device

    registered ti816x_sr device

    pm_dbg_init: only OMAP3 supported

    registered ti81xx_vpss device

    registered ti81xx_vidout device

    registered ti81xx on-chip HDMI device

    registered ti81xx_fb device

    registered ti81xx_vin device

    ti81xx_pcie: Invoking PCI BIOS...

    ti81xx_pcie: Setting up Host Controller...

    ti81xx_pcie: Register base mapped @0xc8820000

    ti81xx_pcie: Starting PCI scan...

    PCI: bus0: Fast back to back transfers enabled

    bio: create slab <bio-0> at 0

    regulator: VFB: 800 <--> 1025 mV at 1010 mV

    vgaarb: loaded

    SCSI subsystem initialized

    usbcore: registered new interface driver usbfs

    usbcore: registered new interface driver hub

    usbcore: registered new device driver usb

    USBSS revision 4ea20809

    registerd cppi-dma Intr @ IRQ 17

    Cppi41 Init Done

    omap_i2c omap_i2c.1: bus 1 rev4.0 at 100 kHz

    omap_i2c omap_i2c.2: bus 2 rev4.0 at 100 kHz

    Advanced Linux Sound Architecture Driver Version 1.0.23.

    Switching to clocksource gp timer

    musb-hdrc: version 6.0, host, debug=0

    musb-hdrc musb-hdrc.0: dma type: dma-cppi41

    MUSB controller-0 revision 4ea20800

    musb-hdrc musb-hdrc.0: MUSB HDRC host driver

    musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1

    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

    usb usb1: Product: MUSB HDRC host driver

    usb usb1: Manufacturer: Linux 2.6.37 musb-hcd

    usb usb1: SerialNumber: musb-hdrc.0

    hub 1-0:1.0: USB hub found

    hub 1-0:1.0: 1 port detected

    musb-hdrc musb-hdrc.0: USB Host mode controller at c881e000 using DMA, IRQ 18

    musb-hdrc musb-hdrc.1: dma type: dma-cppi41

    MUSB controller-1 revision 4ea20800

    musb-hdrc musb-hdrc.1: MUSB HDRC host driver

    musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2

    usb usb2: New USB device found, idVendor=1d6b, idProduct=0002

    usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1

    usb usb2: Product: MUSB HDRC host driver

    usb usb2: Manufacturer: Linux 2.6.37 musb-hcd

    usb usb2: SerialNumber: musb-hdrc.1

    hub 2-0:1.0: USB hub found

    hub 2-0:1.0: 1 port detected

    musb-hdrc musb-hdrc.1: USB Host mode controller at c8826800 using DMA, IRQ 19

    NET: Registered protocol family 2

    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

    TCP established hash table entries: 4096 (order: 3, 32768 bytes)

    TCP bind hash table entries: 4096 (order: 2, 16384 bytes)

    TCP: Hash tables configured (established 4096 bind 4096)

    TCP reno registered

    UDP hash table entries: 256 (order: 0, 4096 bytes)

    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

    NET: Registered protocol family 1

    RPC: Registered udp transport module.

    RPC: Registered tcp transport module.

    RPC: Registered tcp NFSv4.1 backchannel transport module.

    NetWinder Floating Point Emulator V0.97 (double precision)

    PMU: registered new PMU device of type 0

    omap-iommu omap-iommu.0: ducati registered

    omap-iommu omap-iommu.1: sys registered

    JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.

    msgmni has been set to 143

    io scheduler noop registered

    io scheduler deadline registered

    io scheduler cfq registered (default)

    Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled

    omap_uart.0: ttyO0 at MMIO 0x48020000 (irq = 72) is a OMAP UART0

    omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1

    omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2

    console [ttyO2] enabled

    brd: module loaded

    loop: module loaded

    ahci ahci.0: forcing PORTS_IMPL to 0x3

    ahci ahci.0: AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl platform mode

    ahci ahci.0: flags: ncq sntf pm led clo only pmp pio slum part ccc

    scsi0 : ahci_platform

    scsi1 : ahci_platform

    ata1: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x100 irq 16

    ata2: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x180 irq 16

    m25p80 spi1.0: found m25p05-nonjedec, expected m25p80

    m25p80 spi1.0: m25p05-nonjedec (64 Kbytes)

    Creating 4 MTD partitions on "spi_flash":

    0x000000000000-0x000000040000 : "U-Boot"

    mtd: partition "U-Boot" extends beyond the end of device "spi_flash" -- size truncated to 0x10000

    0x000000010000-0x000000012000 : "U-Boot Env"

    mtd: partition "U-Boot Env" is out of reach -- disabled

    0x000000000000-0x000000280000 : "Kernel"

    mtd: partition "Kernel" extends beyond the end of device "spi_flash" -- size truncated to 0x10000

    0x000000010000-0x000000010000 : "File System"

    mtd: partition "File System" is out of reach -- disabled

    omap2-nand driver initializing

    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca (Micron )

    Creating 5 MTD partitions on "omap2-nand.0":

    0x000000000000-0x000000260000 : "U-Boot"

    0x000000260000-0x000000280000 : "U-Boot Env"

    0x000000280000-0x0000006c0000 : "Kernel"

    0x0000006c0000-0x00000cee0000 : "File System"

    0x00000cee0000-0x000010000000 : "Reserved"

    davinci_mdio davinci_mdio.0: davinci mdio revision 1.6

    davinci_mdio davinci_mdio.0: detected phy mask fffffff9

    davinci_mdio.0: probed

    davinci_mdio davinci_mdio.0: phy[1]: device 0:01, driver unknown

    davinci_mdio davinci_mdio.0: phy[2]: device 0:02, driver unknown

    usbcore: registered new interface driver cdc_ether

    usbcore: registered new interface driver dm9601

    Initializing USB Mass Storage driver...

    usbcore: registered new interface driver usb-storage

    USB Mass Storage support registered.

    mice: PS/2 mouse device common for all mice

    omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0

    i2c /dev entries driver

    Linux video capture interface: v2.00

    usbcore: registered new interface driver uvcvideo

    USB Video Class driver (v1.0.0)

    OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec

    usbcore: registered new interface driver usbhid

    usbhid: USB HID core driver

    notify_init : notify drivercreated for remote proc id 2 at physical Address 0xbf900000

    usbcore: registered new interface driver snd-usb-audio

    asoc: tlv320aic3x-hifi <-> davinci-mcasp.2 mapping ok

    ALSA device list:

    #0: TI81XX EVM

    TCP cubic registered

    NET: Registered protocol family 17

    VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3

    omap_voltage_late_init: Voltage driver support not added

    Power Management for TI81XX.

    smartreflex smartreflex: Driver initialized

    omap_rtc omap_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)

    ata2: SATA link down (SStatus 0 SControl 300)

    ata1: SATA link down (SStatus 0 SControl 300)

    mmc0: new high speed SDHC card at address aaaa

    mmcblk0: mmc0:aaaa SD08G 7.40 GiB

    mmcblk0: p1 p2

    davinci_mdio davinci_mdio.0: resetting idled controller

    net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, id=282f014)

    IP-Config: Complete:

    device=eth0, addr=10.0.0.2, mask=255.255.255.0, gw=10.0.0.1,

    host=dm816x, domain=, nis-domain=(none),

    bootserver=10.0.0.1, rootserver=10.0.0.1, rootpath=

    Waiting 4sec before mounting root device...

    PHY: 0:01 - Link is Up - 1000/Full

    VFS: Mounted root (nfs filesystem) on device 0:15.

    devtmpfs: mounted

    Freeing init memory: 208K

    INIT: version 2.86 booting

    Please wait: booting...

    Starting udev

    udevd (68): /proc/68/oom_adj is deprecated, please use /proc/68/oom_score_adj instead.

    FAT: bogus number of reserved sectors

    VFS: Can't find a valid FAT filesystem on dev mmcblk0.

    EXT3-fs: barriers not enabled

    kjournald starting. Commit interval 5 seconds

    EXT3-fs (mmcblk0p2): warning: maximal mount count reached, running e2fsck is recommended

    EXT3-fs (mmcblk0p2): using internal journal

    EXT3-fs (mmcblk0p2): recovery complete

    EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode

    Root filesystem already rw, not remounting

    Caching udev devnodes

    NET: Registered protocol family 10

    ALSA: Restoring mixer settings...

    NOT configuring network interfaces: / is an NFS mount

    Wed Oct 10 11:47:00 UTC 2012

    INIT: Entering runlevel: 5

    Loading HDVICP2 Firmware

    DM816X prcm_config_app version: 2.0.0.1

    Doing PRCM settings...

    PRCM for IVHD0 is in Progress, Please wait.....

    BW Phy Addr : 0x48180600 Data : 0x00000002

    AW Phy Addr : 0x48180600 Data : 0x00000002

    Phy Addr : 0x48180c04 Data : 0x00000037

    BW Phy Addr : 0x48180620 Data : 0x00070000

    AW Phy Addr : 0x48180620 Data : 0x00070002

    BW Phy Addr : 0x48180624 Data : 0x00030000

    AW Phy Addr : 0x48180624 Data : 0x00010002

    Phy Addr : 0x48180600 Data : 0x00000102

    BW Phy Addr : 0x48180c10 Data : 0x00000007

    AW Phy Addr : 0x48180c10 Data : 0x00000003

    Phy Addr : 0x48180c14 Data : 0x00000004

    BW Phy Addr : 0x58088000 Data : 0x41848cc1

    AW Phy Addr : 0x58088000 Data : 0xeafffffe

    BW Phy Addr : 0x58098000 Data : 0x2a9bb256

    AW Phy Addr : 0x58098000 Data : 0xeafffffe

    BW Phy Addr : 0x48180c10 Data : 0x00000003

    AW Phy Addr : 0x48180c10 Data : 0x00000000

    Phy Addr : 0x48180c14 Data : 0x00000007

    PRCM for IVHD0 is Done Successfully

    PRCM for IVHD1 is in Progress, Please wait.....

    BW Phy Addr : 0x48180700 Data : 0x00000002

    AW Phy Addr : 0x48180700 Data : 0x00000002

    Phy Addr : 0x48180d04 Data : 0x00000037

    BW Phy Addr : 0x48180720 Data : 0x00070000

    AW Phy Addr : 0x48180720 Data : 0x00050002

    BW Phy Addr : 0x48180724 Data : 0x00030000

    AW Phy Addr : 0x48180724 Data : 0x00010002

    Phy Addr : 0x48180700 Data : 0x00000102

    BW Phy Addr : 0x48180d10 Data : 0x00000007

    AW Phy Addr : 0x48180d10 Data : 0x00000003

    Phy Addr : 0x48180d14 Data : 0x00000004

    BW Phy Addr : 0x5a088000 Data : 0xafefd849

    AW Phy Addr : 0x5a088000 Data : 0xeafffffe

    BW Phy Addr : 0x5a098000 Data : 0x834942cf

    AW Phy Addr : 0x5a098000 Data : 0xeafffffe

    BW Phy Addr : 0x48180d10 Data : 0x00000003

    AW Phy Addr : 0x48180d10 Data : 0x00000000

    Phy Addr : 0x48180d14 Data : 0x00000007

    PRCM for IVHD1 is Done Successfully

    PRCM for IVHD2 is in Progress, Please wait.....

    BW Phy Addr : 0x48180800 Data : 0x00000002

    AW Phy Addr : 0x48180800 Data : 0x00000002

    Phy Addr : 0x48180e04 Data : 0x00000037

    BW Phy Addr : 0x48180820 Data : 0x00070000

    AW Phy Addr : 0x48180820 Data : 0x00050002

    BW Phy Addr : 0x48180824 Data : 0x00030000

    AW Phy Addr : 0x48180824 Data : 0x00010002

    Phy Addr : 0x48180800 Data : 0x00000102

    BW Phy Addr : 0x48180e10 Data : 0x00000007

    AW Phy Addr : 0x48180e10 Data : 0x00000003

    Phy Addr : 0x48180e14 Data : 0x00000004

    BW Phy Addr : 0x53088000 Data : 0xc6440cd1

    AW Phy Addr : 0x53088000 Data : 0xeafffffe

    BW Phy Addr : 0x53098000 Data : 0x9406904e

    AW Phy Addr : 0x53098000 Data : 0xeafffffe

    BW Phy Addr : 0x48180e10 Data : 0x00000003

    AW Phy Addr : 0x48180e10 Data : 0x00000000

    Phy Addr : 0x48180e14 Data : 0x00000007

    PRCM for IVHD2 is Done Successfully

    PRCM Initialization completed

    SysLink version : 2.20.00.14

    SysLink module created on Date:Oct 10 2012 Time:02:57:36

    FIRMWARE: I2cInit will be done by M3

    FIRMWARE: Memory map bin file not passed

    Usage : firmware_loader <Processor Id> <Location of Firmware> <start|stop> [-mmap <memory_map_file>] [-i2c <0|1>]

    ===Mandatory arguments===

    <Processor Id> 0: DSP, 1: Video-M3, 2: Vpss-M3

    <Location of Firmware> firmware binary file

    <start|stop> to start/stop the firmware

    ===Optional arguments===

    -mmap input memory map bin file name

    -i2c 0: i2c init not done by M3, 1(default): i2c init done by M3

    FIRMWARE: isI2cInitRequiredOnM3: 1

    FIRMWARE: Default memory configuration is used

    Firmware Loader debugging not configured

    Default FL_DEBUG: warning

    Allowed FL_DEBUG levels: error, warning, info, debug, log

    MemCfg: DCMM (Dynamically Configurable Memory Map) Version : 2.1.2.1

    FIRMWARE: 1 start Successful

    Loading HDVPSS Firmware

    FIRMWARE: I2cInit will be done by M3

    FIRMWARE: Memory map bin file not passed

    Usage : firmware_loader <Processor Id> <Location of Firmware> <start|stop> [-mmap <memory_map_file>] [-i2c <0|1>]

    ===Mandatory arguments===

    <Processor Id> 0: DSP, 1: Video-M3, 2: Vpss-M3

    <Location of Firmware> firmware binary file

    <start|stop> to start/stop the firmware

    ===Optional arguments===

    -mmap input memory map bin file name

    -i2c 0: i2c init not done by M3, 1(default): i2c init done by M3

    FIRMWARE: isI2cInitRequiredOnM3: 1

    FIRMWARE: Default memory configuration is used

    Firmware Loader debugging not configured

    Default FL_DEBUG: warning

    Allowed FL_DEBUG levels: error, warning, info, debug, log

    MemCfg: DCMM (Dynamically Configurable Memory Map) Version : 2.1.2.1

    FIRMWARE: 2 start Successful

    HDMI W1 rev 2.0

    HDMI CEC Spec version 1.2

    Starting system message bus: dbus.

    Starting telnet daemon.

    Starting syslogd/klogd: done

    Starting thttpd.

    Starting PVR

    Starting Matrix GUI application.

    _____ _____ _ _

    | _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_

    | | _| .'| . | . | | __| _| . | | | -_| _| _|

    |__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|

    |___| |___|

    Arago Project http://arago-project.org dm816x-evm ttyO2

    Arago 2011.09 dm816x-evm ttyO2

    dm816x-evm login: root

    root@dm816x-evm:~#

    The changes i made in the evm816x_i2c.h are as follows

    for I2C0

    #define I2C0_IRQENABLE_SET *( volatile Uint32* ) 0X4802802C

    #define I2C0_IRQSTATUS *( volatile Uint32* ) 0X48028028

    #define I2C0_WE *( volatile Uint32* ) 0X48028034

    #define I2C0_SYSS *( volatile Uint32* ) 0X48028090

    #define I2C0_BUF *( volatile Uint32* ) 0X48028094

    #define I2C0_CNT *( volatile Uint32* ) 0X48028098

    #define I2C0_DATA *( volatile Uint32* ) 0X4802809C

    #define I2C0_SYSC *( volatile Uint32* ) 0X48028010

    #define I2C0_CON *( volatile Uint32* ) 0X480280A4

    #define I2C0_OA *( volatile Uint32* ) 0X480280A8

    #define I2C0_SA *( volatile Uint32* ) 0X480280AC

    #define I2C0_PSC *( volatile Uint32* ) 0X480280B0

    #define I2C0_SCLL *( volatile Uint32* ) 0X480280B4

    #define I2C0_SCLH *( volatile Uint32* ) 0X480280B8

    #define I2C0_SYSTEST *( volatile Uint32* ) 0X480280BC

    well i am compiling on the host and executing on the board. I am booting the board with NFS.

  • Hi Vineet,

    These tests are for using with CCStudio. You can run tests directly (without any modifications/updates), with loading the .out files with CCStudio (in example i2c0_mapper.out).

    You can check here for more info:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/7623.aspx

    Best Regards,

    Pavel

  • Vineet,

    From the logs I couldn't see you running the application and no segfault is visible.

  • Hi Ranjith

    In the next step what i am doing is simply changed the base address in the evm816x.h file and complite the program file which contain

    #include"evm816x.h"

    #include"evm816x_i2c.h"

    main()

    {

    EVM816X_init();

    }

    I am compiling the above program using makefile as mention in EZSDK SOFTWARE devlopment pdf. after that i am executing the resulting binary on the target

    when i am executing i am getting segmentation fault.

  • Vineet,

    You can start debugging this by enabling printfs inside your program. Also go into the code for EVM816X_init() and enable prints and see where exactly its failing. 

  • Hi Renjith

    I have done the same , i have used printf and i came to know that the moment i am assigning any register i am getting a crash.

    I have changed the address in of all the i2c register as per the datasheet of 816x. still i am gettting a crash. Does the gel file has anything to do with it .

    Please help me out.

  • Hi Vineet,

     

    Could you check if it is powered on in PRCM?

     

    Regards,

    Brijesh

  • Vineet,

    I hope you are running the app after Linux boots up. Why do you need GEL file if you running from Linux. Also are you try to access registers from user space or are you trying call a kernel API which is failing? Also can you share the exact place in your code where it fails?

  • Hi Renjith,

    I am running this app after linux bootup. I have asked about the gel file as i am new so i don't  know the purpose of the gel file. I have written a program and yes i am trying to access the register through userspace. I am not making any api calls.

    the below is the evm816x.c fiile which i am using in my testapp

    #include "evm816x.h"
    #include "evm816x_i2c.h"
     
    /* ------------------------------------------------------------------------ *
     *                                                                          *
     *  EVM816X_init( )                                                           *
     *      Setup PinMux                                                        *
     *      Setup I2C & I2C GPIO                                                *
     *                                                                          *
     * ------------------------------------------------------------------------ */
    Int16 EVM816X_init( )
    {
        EVM816X_I2C0_init();
        //EVM816X_I2C1_init();
        return 0;
    }

    the below is evm816x.h  file

    below is evm816_12c.c file

    #include "evm816x.h"
    #include "evm816x_i2c.h"
    #include<stdio.h>
    /* ------------------------------------------------------------------------ *
     *  EVM816X_I2C0_init( )                                                      *
     *      Initialize I2C - self address is 0xCC                               *
     *                                                                          *
     *      The interrupts are not configured b/c this example will only deal   *
     *      with polling.                                                       *
     * ------------------------------------------------------------------------ */
    void EVM816X_I2C0_init( )
    {
       printf("its is comming here\n");
        Uint16 selfAddress = 0xCC;
       printf("selfaddress passed\n");
        /* Disable I2C and set to default state */
        //I2C0_CON = 0;
        printf("12c0-on is passed");
        EVM816X_waitusec( 500 );
     
        /* Disable interrupts */
        //I2C0_IRQENABLE_SET = 0; 
        printf("passed the irqenale set\n ");
        /* Set Clock Prescaler ( since CK_REF = 12MHz ) no scale down needed */
        //I2C0_PSC = 0xff;
        printf("12cpsc  passed\n");
        /* Set SCL low time & SCL high time */
        /* ( 12MHz clock / ( 400kHz i2c clk * 2 ) ) minus 6 for reg. setting */
        /* Equivalent to ( ( 12 * 1000 ) / ( 400 * 2 ) ) - 6; */
        //I2C0_SCLH = I2C0_SCLL = 9;
        printf("12csclh passed\n");
        /* Set Own Address - cannot conflict with other devices addresses */
        //I2C0_OA = selfAddress & I2C_OA_MASK;
         printf("i2c00a passed\n");
        /* Enable I2C */
        //I2C0_CON = I2C_CON_I2C_EN;
        printf("i1c0_con\n");
        /* Set the Slave address to 0, this is only temporary */
        //I2C0_SA = 0;
        printf("sa passed\n");
        /* Set Data Count */
        //I2C0_CNT = 0;
        printf("i2c_cnt passed\n");
        /* Enable interrupts */
        /* NOTE: for this example, polling is used instead of interrupts */
        //I2C0_IRQENABLE_SET = 0
              //| I2C0_IE_GC_IE      // General Call
              //| I2C0_IE_XRDY_IE    // Transmit Data Ready
              //| I2C0_IE_RRDY_IE    // Receive Data Ready
              //| I2C0_IE_ARDY_IE    // Register Access Ready
              //| I2C0_IE_NACK_IE    // No Acknowledgement
              //| I2C0_IE_AL_IE      // Arbitration Lost
                ;
        //*I2C0_WE=7;
       printf("no error till here\n");
    }
     
    i have used printf to check where the segmentation fault is occuring , and i came to know the moment i am uncommenting and I2C0_CON i am getting crash there. if i am commenting I2C0_CON and uncommenting I2C_IRQENABLE_SET=0 LINE i am getting a crash there. so what i make out is that the moment i am trying to access anyregister i am getting a crash.

    please help me out.

  • Vineet,

    GEL file is an initialization script which is used to initialize basic clocks, DDR etc. GEL file is not required when there is a software running which has taken care of all these.

    You cannot access any physical address directly in Linux. First of all you need to map the physical address to a virtual address. Ideally this should be done from kernel space. What you are trying to do is from user space. 

    However if you want to access I2C driver from user space, you can use the kernel's I2C driver APIs using file operations. But this is not required generally. 

    Whatever you are trying is for any particular project? Or, are you just trying to get familiar with the system? In any case let me know what is the functionality that you are trying to achieve from this. I may be able to help you out.

  • Hi Ranjith

    Well i have to interface a texas instument motor driving module (DRV8821EVM-DRV8823EVM) with the ti 816x/389x EVM . For attaining this i am trying different serial communication method like i2c and spi. I went through the schematic diagram of ti 816x/389 and i came to know the spi pin are not connected to the jumper. Please tell me how i am able to carry out communication between the target and the motor driver module

  • Vineet,

    Are you worried about the hardware interface? I am assuming that you'll be able connect I2C to your board. 

    You can write a small driver for your motor controller module, which in turn will use kernel I2C APIs for communication. You can write a small sample application to call the driver APIs to get your motor rolling.