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.

TM4C1230H6PM: write and read the FMD, FMA, and FMC registers

Part Number: TM4C1230H6PM
Other Parts Discussed in Thread: UNIFLASH,

Tool/software:

Hi,

How can I write and read the FMD, FMA, and FMC registers?
(I plan to select UART as the serial interface)

If the GPIO is in the specified state when the device is reset, the ROM bootloader is invoked.
I would like to use this method to call the ROM bootloader.

To do this, I would like to configure the BOOTCFG register.

To configure the BOOTCFG register, I must write and read the FMD, FMA, and FMC registers.

Literature Number: SPMU301E

Of the serial commands described in the above document, if I use the following commands, will it be possible to write to the FMD, FMA, and FMC registers?

COMMAND_DOWNLOAD = 0x21
COMMAND_SEND_DATA = 0x24

There seems to be no serial command to read registers.
How can I read the FMD, FMA, and FMC registers?

Regards,

Toru

  • Hi,  

    To configure the BOOTCFG register, I must write and read the FMD, FMA, and FMC registers.

    This post has instructions on how to program the BOOTCFG register with code snippet example. 

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/546775/bootcfg-not-being-written

    Of the serial commands described in the above document, if I use the following commands, will it be possible to write to the FMD, FMA, and FMC registers?

    COMMAND_DOWNLOAD = 0x21
    COMMAND_SEND_DATA = 0x24

    Please refer to the below app note if you want to implement a programmer for serial bootloader. 

    Implementation of Programmer for Serial Bootloaders on TM4C12x Microcontroller (Rev. A)

    There seems to be no serial command to read registers.
    How can I read the FMD, FMA, and FMC registers?

    These registers are memory mapped. You need to use the CPU to read them. 

  • Hi,

    Thank you for your reply.

    I will continue to ask questions.

    Document number: SPMS332E

    No.1 : About program and erase
    Is it possible to access the registers from the debug port using JTAG or SWD and pragram and erase the flash memory (address: 0x0000_0000 to 0x0003_FFFF) according to the descriptions in [7.2.3.8 Basic Program / Erase Operations] and [7.2.3.9 32-Word Flash Memory Write Buffer] in the above document?

    No.2 : About read
    Is it possible to access the flash memory (address: 0x0000_0000 to 0x0003_FFFF) from the debug port using JTAG or SWD and read it?

    No.3 : About bootloader
    Is it possible to program to and erase the flash memory (addresses: 0x0000_0000 to 0x0003_FFFF) without using a flash bootloader or a ROM bootloader?
    If the answer to No.1 is [yes], then I think it is possible without using a flash bootloader or a ROM bootloader.

    Regards,

    Toru

  • No.1 : About program and erase
    Is it possible to access the registers from the debug port using JTAG or SWD and pragram and erase the flash memory (address: 0x0000_0000 to 0x0003_FFFF) according to the descriptions in [7.2.3.8 Basic Program / Erase Operations] and [7.2.3.9 32-Word Flash Memory Write Buffer] in the above document?

    Yes, you can use Uniflash or CCS to erase the main flash array. See below. 

    If you want to also erase the non-volatile registers such as BOOTCFG then you must perform a "Unlock" operation which will not only erase the flash array but also the non-volatile registers and EEprom to its factory setting. 

    No.2 : About read
    Is it possible to access the flash memory (address: 0x0000_0000 to 0x0003_FFFF) from the debug port using JTAG or SWD and read it?

    Yes. You can do it in various ways. You can view the flash content in CCS by opening a Memory Browser window or use the Uniflash to read the content. See below. 

    No.3 : About bootloader
    Is it possible to program to and erase the flash memory (addresses: 0x0000_0000 to 0x0003_FFFF) without using a flash bootloader or a ROM bootloader?
    If the answer to No.1 is [yes], then I think it is possible without using a flash bootloader or a ROM bootloader.

    See above answer to No. 1 and 2. 

  • Hi,

    Thank you for your kind reply.

    The image you sent seems to be an operation with Texas Instruments' flash programming tool UniFlash.

    This time, I am considering using the programmer we developed to read, program, and erase the flash memory of the TM4C1230H6PM.

    To summarize the answers so far, I understand that the programmer we developed can do the following if it operates according to the TM4C1230H6PM specifications.
    (As a supplement, if the programmer we developed can operate according to the TM4C1230H6PM specifications)

    Using JTAG or SWD from the debug port
    - It is possible to access the registers and program and erase the flash memory (addresses: 0x0000_0000 to 0x0003_FFFF).
    - It is possible to access and read the flash memory (addresses: 0x0000_0000 to 0x0003_FFFF).

    Could you please let me know if I understand it wrong?


    Regards,

    Toru

  • To summarize the answers so far, I understand that the programmer we developed can do the following if it operates according to the TM4C1230H6PM specifications.
    (As a supplement, if the programmer we developed can operate according to the TM4C1230H6PM specifications)

    Using JTAG or SWD from the debug port
    - It is possible to access the registers and program and erase the flash memory (addresses: 0x0000_0000 to 0x0003_FFFF).
    - It is possible to access and read the flash memory (addresses: 0x0000_0000 to 0x0003_FFFF).

    Hi,

      If you are developing your own programmer then it is no different than TI's programmer such as Uniflash where it can program and erase the flash (addresses: 0x0000_0000 to 0x0003_FFFF) and even the non-volatile registers. You will need to download your programmer code through the JTAG to the internal RAM and have the CPU execute your programmer code out of SRAM to program and erase the flash. 

  • Hi,

    Thank you for your reply.

    Let me check if my understanding is correct.

    Is the following understanding correct?

    - it is possible to access the registers from the debug port using JTAG or SWD and pragram and erase the flash memory (address: 0x0000_0000 to 0x0003_FFFF).

    - However, the recommended approach is to download the programmer code through JTAG or SWD to the internal RAM and have the CPU execute the programmer code of internal SRAM to program and erase the flash.

    Regards,

    Toru

  • - it is possible to access the registers from the debug port using JTAG or SWD and pragram and erase the flash memory (address: 0x0000_0000 to 0x0003_FFFF).

    Yes.

    - However, the recommended approach is to download the programmer code through JTAG or SWD to the internal RAM and have the CPU execute the programmer code of internal SRAM to program and erase the flash.

    I'm not an expert in the programmer design. My understanding is that you would scan an instruction through the JTAG to the CPU's debug logic. For example, if you have a MOV r0, r1 instruction that you want the CPU to execute. You would scan the instruction to the CPU debug logic and have the CPU store this instruction opcode on the RAM. You will then force the CPU's program counter to the RAM and have the CPU execute this MOV instruction.  I will suggest you go through the Arm M4F datasheet and the DAP to understand how it works.