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.

Fail load program using gdb_server and gdb

Other Parts Discussed in Thread: UNIFLASH, TMS570LS3137, SEGGER

Hercules TMS570LC43x Launchpad XL2 board

(gdb) info target
Symbols from "C:\Users\jdrewniak\workspace\TMS570\SOFT\hercules\build\hercules.elf".
Remote serial target in gdb-specific protocol:
Debugging a target over a serial line.
While running this, GDB does not access memory from...
Local exec file:
`C:\Users\jdrewniak\workspace\TMS570\SOFT\hercules\build\hercules.elf', file type elf32-littlearm.
Entry point: 0x1fc
0x00000000 - 0x00000020 is .isr_vector
0x00000020 - 0x000004e0 is .text
0x000004e0 - 0x000004e0 is .rodata
0x08000000 - 0x08000000 is .data
0x08000000 - 0x08000000 is .bss
0x08000000 - 0x08004000 is ._user_heap_stack
(gdb) monitor reset
CPU has been reset
(gdb) monitor halt
CPU has been halted
(gdb) load
Loading section .isr_vector, size 0x20 lma 0x0
Load failed
(gdb) monitor help
Target does not support this command.
(gdb) help monitor
Send a command to the remote monitor (remote targets only).
(gdb) monitor load
Target does not support this command.
(gdb) print $r0
$1 = 0
(gdb) print $r1
$2 = 16777216

C:\ti\emupack\ccs_base\common\uscif\gdb_agent_console.exe C:\Users\jdrewniak\workspace\TMS570\SOFT\hercules\xds110-tms570.dat
Successfully configured C:\Users\jdrewniak\workspace\TMS570\SOFT\hercules\xds110-tms570.dat
CPU Name Port
-------- ----
cortexr5 :55000

Starting all cores
CPU Name Status
-------- ------
cortexr5 Waiting for client
cortexr5 Client connected...Connecting to Target
cortexr5 - Processor type =CORTEX_RXX (Big endian)
cortexr5 - Target device is connected
Using ctools hardware breakpoint support.
Target connected...Starting server

FAILED! GTI_WRITEMEM_BLK(hpid=00B4EA20,addr=0x0,count=20)=ffffffff
(Error -1065 @ 0x0)
Unable to access device memory. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK).
(Emulation package 6.0.407.3)

I can load program using CCS6 but I dont want to use CCS

  • Jacek,

    I asked about this earlier and found out that except for MSP432 the GDB server doesn't include any support for downloading code into flash.

    Apparently it's typical to use some sort of script or hook to implement flash loading but I don't know of a good example for you.

    You might try a tool vendor like Atollic that supports gnu tools as a standard product, unless you want to really delve into the depths of writing this sort of hook yourself. That would be a lot of work I think unless it were going to just call CCS Uniflash or CCS debug server 'behind the scenes' in a sort of headless mode. If you want something that works completely devoid of CCS you'd almost have to adapt one of the bootloaders for this purpose, and these relocate the F021 API from flash to RAM during execution so it's not the simplest thing to do.

    -Anthony
  • Anthony,

    Thank You for a lot of information. It is sad that there is a lack of this kind of information in official documents. But now I can try it out from the other side.

    On this site processors.wiki.ti.com/.../XDS110 I can read that xds110 supports CMSIS-DAP. So I can use it with OpenOCD in theory. I also can see ti_tms570ls3137.cfg target in OpenOCD tcl directory. So my question: Is there any documentation that supports me to write mu own target script or just use OpenOCD?
    For STM32 this kind of information are in reference documents for example in STM Document RM0090 in section 38. Where I can found it for TI devices like TMS570LC43x ?

  • Hi Jacek,

    So this is one area where the TI strategy might be different than other competitors, we invest quite a lot in CCS which is a professional grade compiler and IDE and it's free for you even to develop full commercial products with, the only limitation being the speed of the emulator [you are just limited to XDS100 class].

    We dont' have any documentation on how to make these open-source tools work with our product.
    The only thing we have are docs describing the low level hardware like IceCrusher, and these are really geared to an expert that already knows how something like OpenOCD works and knows enough to do their own port. It's not at all any sort of 'cookbook'.

    CCS can debug very well any binary compiled with the GNU toolchain. Building from inside the CCS IDE I'm sure can be done although the GNU toolchain that ships with CCS does not fully support Cortex R.

    So if you need to use the GNU compiler tools - I'd still suggest doing so from within CCS.

    If you need to actually use the GNU debugger, then probably going to a third party like Atollic or Segger is your best option.

    There are some people who have successfully reported here porting GDB and using OpenOCD with Hercules. I think they have been generous enough to post ports for download. But I haven't tried them out myself and TI can't support them. So if you really absolutely need GDB and don't want to use a commercial offering then this is probably the place to go.

    I don't know that you can do much with CMSIS-DAP on the Cortex R as this is geared to Cortex M. You might have better luck with OpenOCD + XDS100v2. Not sure if anyone's done work moving OpenOCD to the XDS110 and this could be risky as the XDS110 has a programmable firmware that should evolve over time.

    Good luck anyway.

    Thanks and Best Regards,
    Anthony
  • Thank You for Your replay.

    By support I meant a document where I can foud TAPs for hercules. I can found TAP for ICEpick in SPNS195C and it is 0x1B95A02F. But I can't found TAPs for internal daisy chain components that ICEpick can serve.

    I don't need a 'coockbok'. I will appreciate if You suggest me this 'low level hardware docks' :)

    Your last paragraph makes me confused because on this site processors.wiki.ti.com/.../XDS110 in generals features section I can see information that says "OpenOCD ready (OpenOCD version 0.8 and above)" So maybe You are right that CMSIS-DAP works only with Cortex-M

    Thank You for all of the suggestions! They are very informative.

    Best regards
    Jacek
  • Hi Jacek,

    For questions specific to the XDS110 and OpenOCD or CMSIS DAP I would suggest posting to the CCS forum.
    But please understand that I think most of these statements are driven by MSP432 products based on Cortex M.
    We don't ask for or test any of these capabilities for Hercules.

    All of the documentation on the CPU - even in terms of the instruction set, is found on ARM's website. We don't duplicate that
    documentation. So you'll want to understand their specs for the Cortex R CPU and the Coresight debug architecture.

    For the other TAPs like boundary scan, RTP, DMM, ETM, AJSM, I'd suggest leaving them alone. You don't need them to attach a debugger. [except AJSM in case you have already programmed the security key but that's not something you are likely to do anytime soon if you cannot connect to the CPU.. ]

    -Anthony