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.

Implement my own JTAG flash programmer in C. Where can I find the TI-specific specification?

Other Parts Discussed in Thread: CC2538, CC2650

I am about to start a project where an ARM processor will need to program (=write firmare to the internal flash memory) a CC2640F128-chip at the production site through JTAG. I found a very helpful tutorial on JTAG (w w w . f p g a 4 f u n . c o m / J T A G . h t m l) but it doesn't seem that programming a built-in flash memory is part of the JTAG standard. It seems that TI has added their own instructions to enable JTAG debuggers to program the flash memory. Where can I find a specification that explains how to program the flash in the CC2640F128-chip using JTAG?

  • In stead of using JTAG, have you considered using the built-in serial boot loader on the chip? The boot loader was developed for exactly this purpose.

    Refer to this app note for further information about the boot loader: www.ti.com/.../swra466 (CC2538/CC26xx Bootloader Interface).
  • Thank you for your reply. Yes, I know about the bootloader but would prefer to use JTAG.
  • OK. Then there's a couple of things you need to do:

    Read chapter 5 in the CC2650 Technical Reference Manual. It explains for instance how to enable the four-pin JTAG interface on the chip (5.2.2) and also explains the internal debug architecture, for instance how the DAP is connected to the ICEPick module.
     
    Next, you may want to develop a small application that runs in RAM on the device. This application can receive data from the host CPU and then use the flash API from the CC26xx driverlib to program the flash.

  • Ok, so I've been reading up a bit on IEEE 1149.1 (4-wire traditional JTAG) and IEEE 1149.7 (2-wire compact JTAG). On page 416 ("5.8 Debug Features Supported Through WUC TAP") in the pdf-document "CC26xx SimpleLink™ Wireless MCU Technical Reference Manual" I find a command called CHIP_ERASE_REQ. Is that what I would use to erase the flash before I program it? How would I then go about to upload code into RAM? I am unable to find a command for that.
  • Hi,

    Programming flash is not part of any JTAG standard and is mostly done indirectly through a flash loader as you cannot write to flash directly the way you write to a register or SRAM address.

    You will need to connect JTAG to the WUC TAP (test access port) to do an erase.
    To flash the device you will need to connect to the CPU DAP (debug access port) and upload a flash loader to RAM which writes data to flash using driverlib API's (see cc26xxware driverlib/flash.h) and control the CPU as needed.
    Things like these are fairly complicated and unless there is a very specific need to use JTAG I would recommend using the on-chip bootloader for factory programming.

    Regards,
    Svend
  • We (me and my fellow colleagues) believe having an embedded JTAG interface that, at the very minimum, can erase the flash and preferably also write several assembler instructions (firmware) into RAM would be beneficial to us in many products for many years to come. Therefore, we are prepared to put some efforts into this and we realize it will be difficult and challenging. In essence, what we are trying to do is emulate a small subset of the functionality of the XDS100v3 and I had a loook at the Wikipage for the XDS100v3,  h t t p : / / p r o c e s s o r s . w i k i . t i . c o m / i n d e x . p h p / X D S 1 0 0. It seems there is a microcontroller on the XDS100v3 that implements the JTAG protocol and handles the WUC TAP, CPU DAP, etc. Can I somehow obtain the source code for the XDS100v3-microcontroller and use that code as my starting point?

  • Hi,

    I see your point but we cannot unfortunately provide the source (+ the XDS100v3 is FPGA-based). A lot of ground-work is already done here with Open OCD, I would recommend e.g. looking at the Bus Blaster project (v4) for HW+FW.

    Best regards,
    Svend