Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Rares
Level 1
Level 1
First like given First reply posted First question asked

Hello,

 

I have a question regarding the uncached and cached memory regions, I am confused about the actual location of the data stored at one of this addresses. Is the data actually stored two times in the memory, once at address starting with 0x80000000 and one more time at the address starting with 0xA0000000 or is the data store only once?

 

Thank you in advance for your answers,

0 Likes
6 Replies
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Hi,

Please let me redeclare as below:

i.e. TC39x has 16MB PFlash, the 0xA... and 0x8... should be only one copy of the memory but with or without cached. If enable SOTA, the 7MB of PFlash will be support A/B swap function, that means 14MB is used for SOTA and 2MB is left.

If use Memtool 2021 to load a .hex file, region 0x80000020-0x80002bc3 will be programmed into region 0xa0000000-0xa0002bc3 as below screenshot:

dw_0-1665203447650.png

 

dw

Jayakumar
Level 1
Level 1
First like received First reply posted First like given

My understanding is that the data stored only once physically with  location starting 0x80000000.

1) uncached access provided while 0x80.. address is used.

2) cached access to same physical location 0x80.. is  provided while 0xA0.. addressed  is used.

Rares
Level 1
Level 1
First like given First reply posted First question asked

Than you for your answers.
My initial understanding was that we can have data both in the cached region and also in the un-cached one and depending upon the location where it is saved it cached or not :), this is the reason why I was also confused , because if it's the same physical memory location then how does the CPU know if that memory has to be cached or not?
For example, is the following binary file valid?

Rares_0-1665377723249.png

 



0 Likes
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Hi Rares,

It's valid, .hex file is also same format.

If use Memtool 2021 to load a .hex file, region 0x80000020-0x80002bc3 will be programmed into region 0xa0000000-0xa0002bc3

dw

0 Likes
Rares
Level 1
Level 1
First like given First reply posted First question asked

Hello,

I think I understand now, it doesn't matter what we have in the hex file, if the cached option is enabled it will write the data starting with address 0x80000000 and if it's not it will write it starting with address 0xA0000000 correct?

But if this is the case , doesn't it mean that we actually have two regions in memory where we write the data depending on the cached or un-cached option?

Thank you in advance.

0 Likes
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

I think the program is only physically in 0xA000 0000 and when you access 0x8000 0000 in source code the cached mechnism will be used.

0 Likes