Trouble using JTAG Link with digi unc90 and j-link

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Trouble using JTAG Link with digi unc90 and j-link

    Hi,
    i've messed up one digi unc90 (CC9U) module (erased bootloader) and having trouble getting it to work.

    jflash-lite did not have the AT91RM9200 so i use j-link

    - connecting a working module
    device AT91RM9200
    speed 12000
    r
    savebin c:\unc90\uok-boot.bin, 10000000 3ffff

    this file looks like an u-boot.....

    - loading this to ram
    loadbin c:\unc90\uok-boot.bin, 0x00210000

    savebin c:\unc90\uok-writeback.bin, 0x00210000 3ffff

    the files uok-boot.bin and uok-writeback.bin are diffrent


    - connecting the broken module:

    loadbin c:\unc90\uok-boot.bin, 0x10000000

    J-Link>loadbin c:\unc90\uok-boot.bin, 0x10000000
    Downloading file [c:\unc90\uok-boot.bin]...O.K.
    J-Link>
    **********************
    Here some output is missing as mentioned in segger.com/jlink-flash-download.html

    Also loading this to ram
    - loading this to ram
    loadbin c:\unc90\uok-boot.bin, 0x00210000
    - and
    setpc 0x00210000
    g

    did not work,

    J-Link>loadbin c:\unc90\uok-boot.bin, 210000
    Downloading file [c:\unc90\uok-boot.bin]...O.K.
    J-Link>mem 210000,128
    00210000 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00210010 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


    SEGGER J-Link Commander V4.98a ('?' for help)
    Compiled Mar 26 2015 18:40:28
    DLL version V4.98a, compiled Mar 26 2015 18:40:07
    Firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46
    Hardware: V8.00
    S/N: 38000040
    OEM: DIGI-LINK
    Feature(s): GDB
    VTarget = 3.261V
    Info: TotalIRLen = 4, IRPrint = 0x01
    Info: CP15.0.0: 0x41129200: ARM, Architecure 4T
    Info: CP15.0.1: 0x0D172172: ICache: 16kB (64*8*32), DCache: 16kB (64*8*32)
    Info: Cache type: Separate, Write-back, Format A
    Found 1 JTAG device, Total IRLen = 4:
    #0 Id: 0x05B0203F, IRLen: 04, IRPrint: 0x1, ARM920T Core (Atmel)
    Found ARM with core Id 0x05B0203F (ARM9)
    ETM V1.3: 4 pairs addr.comp, 2 data comp, 8 MM decs, 2 counters, sequencer
    Target interface speed: 100 kHz
    J-Link>



    thanks for any help
    jens
  • Hi,

    Before trying to download any files, I would recommend to get it up and running step by step.
    Therefore, could you please start J-Link Commander, enter the commands below and provide a screenshot of the entire output?
    r
    mem 0x00210000 0x40
    w4 0x00210000 00112233 44556677 8899AABB CCDDEEFF
    mem 0x00210000 0x40

    We gave it a quick try here and it is working perfectly fine. The SRAM can be written successfully.


    - Erik
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi, and thanks for that hint...

    J-Link>exec device = AT91RM9200
    Info: Device "AT91RM9200" selected.
    J-Link>r
    Reset delay: 0 ms
    Reset type NORMAL: Using RESET pin, halting CPU after Reset
    Info: CP15.0.0: 0x41129200: ARM, Architecure 4T
    Info: CP15.0.1: 0x0D172172: ICache: 16kB (64*8*32), DCache: 16kB (64*8*32)
    Info: Cache type: Separate, Write-back, Format A
    J-Link>mem 0x00210000 0x40
    00210000 = ED 7F 91 2E 2D 56 98 38 C6 FE 1F 13 27 BB A9 76
    00210010 = AB B3 0D E7 75 6F 27 5D C6 8F 7E F3 E6 A3 5D 73
    00210020 = B1 96 21 D8 08 5B C9 0A 7D 32 15 AB A5 62 9D DF
    00210030 = 2B 72 FF 7F F5 2B B5 F0 BA A5 ED 68 7B C1 75 43
    J-Link>w4 0x00210000 00112233 44556677 8899AABB CCDDEEFF
    Writing 00112233 -> 00210000
    Writing 44556677 -> 00210004
    Writing 8899AABB -> 00210008
    Writing CCDDEEFF -> 0021000C
    J-Link>mem 0x00210000 0x40
    00210000 = 33 22 11 00 77 66 55 44 BB AA 99 88 FF EE DD CC
    00210010 = AB B3 0D E7 75 6F 27 5D C6 8F 7E F3 E6 A3 5D 73
    00210020 = B1 96 21 D8 08 5B C9 0A 7D 32 15 AB A5 62 9D DF
    00210030 = 2B 72 FF 7F F5 2B B5 F0 BA A5 ED 68 7B C1 75 43
    J-Link>

    I see, this is working

    savebin c:\unc90\utest1.bin 0x00210000 0x40

    loadbin c:\unc90\utest1.bin 0x00210000 0x40
    verifybin c:\unc90\utest1.bin 0x00210000 0x40

    also works fine.

    Using this writeout to create bigger file with 16x copy +
    copy /b utest1.bin 1
    copy /b 1+1+....+1 2
    copy /b 2+2+....+2 3
    copy /b 3+3+....+3 4.bin (262.144 Byte, 40000 HEX)


    J-Link>loadbin c:\unc90\4.bin 00210000
    Downloading file [c:\unc90\4.bin]...O.K.
    J-Link>verifybin c:\unc90\4.bin 00210000
    Loading binary file c:\unc90\4.bin
    Reading 262144 bytes data from target memory @ 0x00210000.
    Verify successful.

    J-Link>mem 00210000 0x128
    00210000 = 33 22 11 00 77 66 55 44 BB AA 99 88 FF EE DD CC
    00210010 = 70 02 D0 00 D0 00 68 00 68 00 01 10 06 01 00 01
    .....
    00210100 = 33 22 11 00 77 66 55 44 BB AA 99 88 FF EE DD CC
    00210110 = 70 02 D0 00 D0 00 68 00 68 00 01 10 06 01 00 01
    00210120 = 08 08 08 08 08 08 08 08

    OK, this is working too

    J-Link>savebin c:\unc90\4_writeout.bin 00210000,40000
    Opening binary file for writing... [c:\unc90\4_writeout.bin]
    Reading 262144 bytes from addr 0x00210000 into file...O.K.
    J-Link>verifybin c:\unc90\4_writeout.bin 00210000
    Loading binary file c:\unc90\4_writeout.bin
    Reading 262144 bytes data from target memory @ 0x00210000.
    Verify successful.
    J-Link>loadbin c:\unc90\4_writeout.bin 00210000
    Downloading file [c:\unc90\4_writeout.bin]...O.K.
    J-Link>verifybin c:\unc90\4_writeout.bin 00210000
    Loading binary file c:\unc90\4_writeout.bin
    Reading 262144 bytes data from target memory @ 0x00210000.
    Verify successful.

    262.144 4.bin
    262.144 4_writeout.bin

    now i read from flash the u-boot

    savebin c:\unc90\ubout.bin 10000000 ,40000
    J-Link>verifybin c:\unc90\ubok.bin 10000000
    Loading binary file c:\unc90\ubok.bin
    Reading 262144 bytes data from target memory @ 0x10000000.
    Verify successful.



    262.144 (Byte) ubout.bin

    Now comes my problem:

    J-Link>savebin c:\unc90\ubout.bin 10000000 ,40000
    Opening binary file for writing... [c:\unc90\ubout.bin]
    Reading 262144 bytes from addr 0x10000000 into file...O.K.
    J-Link>loadbin c:\unc90\ubout.bin 0x00210000
    Downloading file [c:\unc90\ubout.bin]...O.K.
    J-Link>verifybin c:\unc90\ubout.bin 0x00210000
    Loading binary file c:\unc90\ubout.bin
    Reading 262144 bytes data from target memory @ 0x00210000.
    Verify failed @ address 0x00210000.
    Expected 06 read 00J-Link>

    J-Link>mem 0x00210000 0x40
    00210000 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00210010 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    J-Link>mem 2414D8, 128
    002414D8 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    002414E8 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    002414F8 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00241508 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00241518 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00241528 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00241538 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    it looks like j-link didn't like same data of u-boot

    i belive it shouldn't make a diffrence if i read from flash or from ram.....

    of cource with j-flash i can read ubout.bin as data, set start address to 210000
    and i see the u-boot (like enviroment beginning at 2414D8)

    as well if i "mem" it from j-link it is identical

    J-Link>mem 100314D0, 128
    100314D0 = FF FF FF FF 00 D6 F0 20 62 6F 6F 74 61 72 67 73
    100314E0 = 3D 63 6F 6E 73 6F 6C 65 3D 74 74 79 53 30 00 62
    100314F0 = 6F 6F 74 63 6D 64 3D 72 75 6E 20 62 6F 6F 74 5F
    10031500 = 66 6C 61 73 68 00 62 6F 6F 74 64 65 6C 61 79 3D
    10031510 = 33 00 62 61 75 64 72 61 74 65 3D 33 38 34 30 30
    10031520 = 00 73 74 64 5F 62 6F 6F 74 61 72 67 3D 00 69 70
    10031530 = 61 64 64 72 3D 31 39 32 2E 31 36 38 2E 34 32 2E



    my idea is loading u-boot to ram, starting the u-boot and using it to write the u-boot back to flash
    since j-link didn't wants to write to flash


    thanks again for your effort helping me :)
    jens

    The post was edited 1 time, last by jens ().

  • Hi,

    i belive it shouldn't make a diffrence if i read from flash or from ram.....
    Which flash area are you referring to? The AT91RM9200 does not come with internal flash. Do you mean external?

    However, lets focus on the "problem":
    The AT91RM9200 has 16 KB SRAM at address 0x00200000. You write 256 KB (0x00040000) data at address 0x00210000 which does not fit into the internal SRAM.

    Therefore, the J-Link writes to undefined memory which seems to confuse the device as after the write operation,
    read memory always returns 0. The behavior when writing to undefined memory dependence on the device.


    - Erik
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Oh, i see ....

    From the Manual:
    3.5. Chip Selects
    Chip Select Usage Memory-Map
    CS0# Flash Memory 0x1000 0000 – 0x1FFF FFFF

    CS1# SDRAM Memory 0x2000 0000 – 0x2FFF FFFF
    CS2# Not used
    CS3# Available outside UNC90 0x4000 0000 – 0x4FFF FFFF
    CS4# Available outside UNC90 0x5000 0000 – 0x5FFF FFFF

    I have to use external
    SDRAM Memory 0x2000 0000 – 0x2FFF FFFF

    As i read in the manual u-boot use 0x20100000 for storing a tft u-boot before copying to external flash

    but i'm afraid, j-link did not uses this :(

    J-Link>exec device = AT91RM9200
    Info: Device "AT91RM9200" selected.
    J-Link>speed 12000
    Target interface speed: 12000 kHz
    J-Link>r
    Reset delay: 0 ms
    Reset type NORMAL: Using RESET pin, halting CPU after Reset
    Info: CP15.0.0: 0x41129200: ARM, Architecure 4T
    Info: CP15.0.1: 0x0D172172: ICache: 16kB (64*8*32), DCache: 16kB (64*8*32)
    Info: Cache type: Separate, Write-back, Format A
    J-Link>mem 0x20100000 0x40
    20100000 = 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF
    20100010 = 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF
    20100020 = 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF
    20100030 = 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF 9F FF
    J-Link>w4 0x20100000 00112233 44556677 8899AABB CCDDEEFF
    Writing 00112233 -> 20100000
    Writing 44556677 -> 20100004
    Writing 8899AABB -> 20100008
    Writing CCDDEEFF -> 2010000C
    J-Link>mem 0x20100000 0x40
    20100000 = DD FF DD FF DD FF DD FF DD FF DD FF DD FF DD FF
    20100010 = DD FF DD FF DD FF DD FF DD FF DD FF DD FF DD FF
    20100020 = DD FF DD FF DD FF DD FF DD FF DD FF DD FF DD FF
    20100030 = DD FF DD FF DD FF DD FF DD FF DD FF DD FF DD FF
    J-Link>

    So using external sdram or flash memory is not possible with j-link?




    Thanks,
    and have a nice day :)
    jens
  • So using external sdram or flash memory is not possible with j-link?
    Both can be done using J-Link, see description below:

    external SDRAM:
    The external SDRAM controller has be setup and configured correctly. This has to be done by the debugger (user) as this initialization may differ from device to device, so no generic implementation is possible. Once the controller has been setup, J-Link can read / write the external SDRAM.

    External flash memory:

    There are differences depending on the flash memory type:
    • CFI complaint flash types (e.g. parallel NOR flashes): This is quite similar to the external SDRAM. The external memory controller has to be setup and configured and the memory range has to be configured. For further information, please refer to the J-Link user guide (UM08001) chapter "6.5. Setup for various debuggers (CFI flash)".

    • None-memory-mapped external flashes (e.g. SPI Flash, NAND Flash, etc...): As the connection of the external flash may differ from device to device and even if the same device is used, the connection can differ (e.g. other pins are used in the design to connect the flash to the MCU), a so called custom RAMCode is required. Currently, this supported in J-Flash only. For further information, please refer to chapter "8.1 Which devices can be programmed by J-Flash" of the J-Flash user guide (UM08003).


    - Erik
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.