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.

The problem of Programming TM4C123AE6PM

Other Parts Discussed in Thread: TM4C123AE6PM, SEGGER, LM3S811

I would like to program TI TM4C123AE6PM device. We referred to the datasheet to test TM4C123AE6PM, and we could use SWD interface to read SWDID (0x2BA01477), but the next steps seemed didn’t respond. We tried to read "DID0(0x400FE000)" & "DID1(0x400FE004)", but what we read out were all "0xFFFFFFFF".

Below are our test sequences for Erase function:

a. Power_on (VDD set 3.3V).
b. send 50 pulse to SWDCK(SWDIO set hi) and 0xE79E.
c. send 50 pulse to SWDCK(SWDIO set hi).
d. read SWDID (0x2BA01477).
e. send ABORT (0x0000001E) & DP-CTRL/STAT(0x50000000) & DP-AP-SELECT(0x00000000) & AP-CTRL/STAT(0x23000012).
f. Enable Debug : write 0xA05F0003 to 0xE000EDF0
g. Reset : write 0xA05F0004 to 0xE000ED0C
h. Halt : write 0xA05F000Bto 0xE000EDF0 and delay 50ms.
i. write 0xA4420004 to FMC,and poll the FMC register until the MERASE bit is cleared.

I read FMC for several times but what I read out were all "0xFFFFFFFF", I think I can’t access AHB-AP. Could someone can  help to check it for me?  Thank you.

  • Hello Eddie,

    What IDE and debugger are you using? Also is this being done on a EVM or a custom board?

    Regards

    Amit

  • Hello Sir,

    Thank you for your reply. I don't use IDE and debugger. Our customer wants to use my tool to program your TM4C123AE6PM device. We read ARM and your documents to try this algorithm. But it no work. Could you help me? Thank you,.

    Regards

    Eddie

  • You describe IDE (none) and debugger (ditto) but don't respond to the request for board identification.  (custom boards are always suspect)

    May I suggest Segger and their J-Link?  We use this w/IAR (that IDE not required) and Segger has a variety of free programs which enable SWD or JTAG communication w/multiple, ARM MCUs. 

    Our combination (IAR & J-Link) works extremely well - under SWD exclusively - with MCUs from this & most all other ARM MCU vendors.  (we've yet to find one which will not "communicate.")  Segger offers a "student version" of J-Link @ great discount - ideal if you are part of a school. (or can induce a local school to participate)

    Surely you want to "sell" your tool - but as you're presently "stuck" - use of the "known good" Segger/J-Link combo may be shortest/easiest path to your objective...  (i.e. you may discover "missing link" via method suggested - and massage your tool into compliance...or simply employ the Segger/J-Link combo. and commence productive work.)

  • Hello Eddie

    Without knowing what the tool is doing or at least having the tool, it is rather tough.

    The first thing to do to make sure the DAP is connected, is to read out DID0 register at 0x400FE000 address. If that is correct then we can see why FMC access is not working

    Regards

    Amit

  • Hello Amit,

    Thank you for your message. We are an IC writer maker, so we don't need to use any tool, we can control all SWD signals.
    Currently we can read SWD ID and control DAP successfully, but we could not access DID0 register, and I guess this was why we also could not access FMC register 
     
    Should we implement any special controlling sequence to initialize the chip before using DAP to access DID0 or FMC register?
    Please kindly advise, and I appreciate your support.  
     
    Regards
     
    Eddie
  • Hello Eddie,

    To be able to implement any higher level tools, it is important to have the low level JTAG or SWD access working. I would first suggest a good read of the "ARM Debug Interface v5 Architecture Specification". I have used this document in the past to implement a JTAG bases solution (not a SWD solution). The document describes very well how low level access from an emulator would be translated to CPU system access.

    I would also need to look into the document to understand what SWD would require (so it would be a co-read for us), so responses may be delayed.

    Regards

    Amit

  • Eddie Chung said:
    We are an IC writer maker, so we don't need to use any tool

    But of course - you, "Don't need to use any tool" - yet your tool lands you here - with progress stalled.  Thus my suggestion of your use of a, "known good/working SWD tool" (such as J-Link) which may effectively serve as a model for, "your tool."  (via capture & subsequent study of signals, timings & sequences emanating from, "working tool.")

  • Hi Sir,
     
    Thank you for your suggestion. We know ARM Debug Interface v5 Architecture Specification document and we have read it carefully. We have tried both SWD and JTAG interface but the result are the same. We still can't access DID0 register.
     
    We tried to use your LM3S811 EVAL kit and capture some SWD signals. But we have no idea how to analysis most of the waveform we got. If you could help us with that. We will post them. 
     
    Thank you for your great support.
     
    Regards,
    Eddie
  • Hi,

    Read or write any register from the ARM address map through the AHP-AP, using the DPACC and APACC JTAG instructions.

    These are explained in your documentation.

    Do not use LM3S8xx, since this is only JTAG, follow cb1's advise for Segger....

    Petrei

  • Hello Eddie,

    In the past I have used the following JTAG sequence on TM4C123 and TM4C129 to read the DID0 register value. Hopefully you can use this as a starting point for debugging. This was created using the same document.

    1110:00000000000000000000000000000000
    1010:01010000000000000000000000100000010
    1011:00100011000000000000000000010010000
    1011:01000000000011111110000000000000010
    1011:00000000000000000000000000000000111
    1010:00000000000000000000000000000000111

    Regards

    Amit

  • Hi Amit,

    Thank you for your suggestion. I used your JTAG sequence and now the JTAG interface works. I can read DIDO register and  program/read Flash memory. 

    Thank you for your great support.

    Regards

    Eddie