TMS470 GDB init

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

  • TMS470 GDB init

    Hi all,

    situation is :

    Redaded flash contents with Jflash, then loaded and disassembled with IDAPro now i need to debug target with IDA over JLinik GDB server.

    Problem is:

    Tms470 have MSM module who need to be init before getting access to memory, in JFlash i do this with thiese commands in CPU initial sequence

    Source Code

    1. Reset(0);
    2. DisableChecks();
    3. Write32(0xFFFFFFE0, 0x00004007); // Disable illegal address reset
    4. Write32(0xFFFFF724, 0x80000000);
    5. Read32(0x0000FFE0);
    6. Read32(0x0000FFE4);
    7. Read32(0x0000FFE8);
    8. Read32(0x0000FFEC);
    9. Write32(0xFFFFFFDC, 0x00000000);
    10. EnableChecks();
    11. SetJTAGSpeed(8000);
    Display All

    Now the problem is HOW to do this sequnse when JLinkGDBServer.exe starts?

    Thanks in advance and sorry for my maybe stuppid question :).
  • Hi,

    a GDBInit file is needed. For more information how to use them, please refer to UM08005 3.3 Setting up GDB.

    The following sequence should work for the TMS470R1B1M:

    C Source Code

    1. #
    2. # connect to the J-Link gdb server
    3. #
    4. target remote localhost:2331
    5. #
    6. # Setup flash programming
    7. #
    8. monitor flash device = TMS470R1B1M
    9. monitor flash download = 1
    10. #
    11. # Select target endianess
    12. #
    13. monitor endian big
    14. #
    15. # Set init JTAG speed to 30 kHz
    16. #
    17. monitor speed 30
    18. #
    19. # Reset the chip to get to a known state.
    20. #
    21. monitor reset
    22. #
    23. # CPU core initialization (to be done by user)
    24. #
    25. monitor DisableChecks
    26. monitor WriteU32 0xFFFFFFE0 0x00004007
    27. monitor WriteU32 0xFFFFFE04 0x000000B0
    28. monitor WriteU32 0xFFFFFE00 0x00000000
    29. monitor WriteU32 0xFFFFFE08 0x00000000
    30. monitor WriteU32 0xFFFFFE0C 0x00000000
    31. monitor WriteU32 0xFFFFFE10 0x00000040
    32. monitor WriteU32 0xFFFFFE14 0x00000070
    33. monitor WriteU32 0xFFFFFE18 0x00000000
    34. monitor WriteU32 0xFFFFFE1C 0x00000000
    35. monitor WriteU32 0xFFFFFE20 0x00000080
    36. monitor WriteU32 0xFFFFFE24 0x00000010
    37. monitor WriteU32 0xFFFFFE04 0x000001B0
    38. monitor WriteU32 0xFFFFF724 0x80000000
    39. monitor memU32 0x0000FFE0
    40. monitor memU32 0x0000FFE4
    41. monitor memU32 0x0000FFE8
    42. monitor memU32 0x0000FFEC
    43. monitor WriteU32 0xFFFFFFDC 0x00000002
    44. monitor EnableChecks
    45. monitor speed 12000
    46. #
    47. # Setup GDB for faster downloads
    48. #
    49. set remote memory-write-packet-size 4096
    50. set remote memory-write-packet-size fixed
    51. monitor speed 12000
    52. file TMS470R1B1M.elf
    53. break main
    54. load
    55. continue
    Display All

    Best regards
  • Thanks for reply,

    How can JLinkGDBServer.exe call this init file?

    I know that this file can be called from all IDE's (keil,iar,ccs), but i use IDA pro to reverse disassembled flash contents and he cannot call any gdb config file.
    Sorry for my dumb questins, but all help is wellcome.

    Thanks advance again, with best redards.
  • Hi,

    Usually when the GDB (not the GDBServer) is started, it can be started like: arm-none-eabi-gdb -x ./sample.gdb
    where sample.gdb is the gdbinit file which comes with the configuration mentioned above.

    Another option is to start the GDBServer as follows: jlinkgdbserver -xc <YourConfigurationFile>
    For more information about the GDBServer command line options, please refer to the GDB Server user manual.

    - Alex