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.

RM57L843: Reading and Writing RAM memory contents from MCU

Part Number: RM57L843
Other Parts Discussed in Thread: TMS570LC4357

Hi,

We are working on the project in which we have to access (Read/write) the RAM memory contents when the code is running.

The current program flow is:

1. Client application will send the command to MCU (requesting the current contents at the specified Address location)

2. MCU will receive the command and sends the current value present at the corresponding memory location

Note : RAM memory address locations are taken from .map file

Currently we are using ethernet interface for the above scenario.

The problem in above is, I am getting approx. 30-40 seconds delay to reflect new data contents.

So, Is there any way or tool by which we can monitor real time RAM memory contents ?

Can I access memory via debug interfaces after flashing the code? If this possible what will be the approach for this?

Please help me in this.

Thanks.

Pratik

  • Hello Pratik,

    How and when the data is written to RAM? Is DMA is used? If the data is still the cache when the MCU gets the command, the returned data may not be the latest value of the variable. You can configure the memory region used for your data as write-through 

    In debug mode, you can check the memory content from the memory browser window. 

    RM57Lx device has a module called RTP. The RTP provides the ability to datalog the RAM contents of the RM57 devices or accesses to peripherals without program intrusion. It can trace all data write or read accesses to internal RAM.

    Please refer to RTP chapter of TRM.

  • Thanks for the reply.

    We are not using DMA.

    We want to access RAM data in runtime. Data is written to RAM when MCU gets command from client application 

    (Command for write 2,0x08001508,15) means write value 15 to address location 0x08001508

    2 -> command identifier

    0x08001508 -> Address of variable to be modified

    15 -> value written to RAM address 0x08001508 

    (Command for read variable 3,0x08001508) means read the value from address location 0x08001508

    3 -> command identifier

    0x08001508 -> Address of variable to be read

    Above scenario is limited to some memory addresses, when we try to access some memory address code stuck in between.

    So, is there any other way to do this ?

    We don't want this scenario in debug mode. Is RTP limited to debug mode or free running mode ?

    So, can I use RTP in this case ?

  • How do you protect the data at 0x08001508 from overwritten by other variable? 

    The compiler supports the ability to specify the run-time address of a variable at the source level. This can be accomplished with the LOCATION pragma or attribute.

    #pragma LOCATION(xyz, 0x08001508)
    uint32_t xyz;

    main(){

       xyz = 15;

    }

  • RTP is used to trace all accesses to the internal RAM or peripherals without impacting the CPU's code execution. This uses a dedicated high-bandwidth interface to transfer the trace information to an external trace analyzer. See https://www.isystem.com/downloads/winIDEA/help9_12_256/index.html?ICETMS470.html

    For example, Vector's VX1000 supports TMS570 via the RTP and DMM interfaces: 

    You can connect the RTP to DMM of another RM57Lx MCU. The DMM is used to make write accesses to any on-chip RAM that is in the CPU's memory map, with minimal impact to the main CPU's code execution. 

  • Yes thanks for the information.

    I understood RTP and DMM can be used in this case.

    So, how can I enable RTP or DMM functionality or use RTP and DMM library?

    I see there are tabs and some pin Mode for RTP and DMM but no any enable/disable functionalities, are they by default enabled ?

    Where can I get sample code for RTP DMM demonstration ?

    Please help me in this.

    Thanks

    Pratik

  • QJ, Pratik,

    There is also a simpler way of accessing the on-chip RAM without affecting CPU code execution. The debug sub-system on TMS570 devices includes a Debug Access Port (DAP) that can be used to read/write from/to any memory location.

    Follow the sequence in the below images (done on a TMS570LC4357 LaunchPad):

    This does require you to first connect to the CPU (thereby halting it) since it is the default core to be connected to (defined via the .ccxml file). This can probably also be changed to connect to the DAP by default, so you don't have to halt the code execution at all.

    After the last step in the sequence, you are using the DAP interface for the memory accesses while the main application code continues to be executed by the CPU.