How to make overlay for MPC5777C

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to make overlay for MPC5777C

1,197 Views
mathias_edman
Contributor III

Hi,

Are there any examples for how to create overlays for MPC5777C?

I am looking at the example for "MPC5748G_Overlay_SRAM_Overlay_Flash_config_S32DS" but this pretty different from the MCU I am working with. If anyone could point me in the right direction I would be grateful!

Regards,

Mathias

Tags (2)
5 Replies

900 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, instead of overlay MPC5777C use "old" approach using MMU virtual address translation to redirect certain address space to different place. I have copied out the a chapter fro MPC5644A VertiCAL Guide that describing it quite clearly, I think.

--------------

8. MMU Mapping of Calibration Data

Engine calibration data is typically stored as constant data located within internal flash. During engine calibration
this data is manipulated in real time, and therefore needs to be relocated to SRAM to achieve this. The VertiCal
connector provides the mechanism to connect to an external SRAM, however the Memory Management Unit
(MMU) provides the seamless integration of this with software.

The MMU works on the principal of "Effective" (i.e. virtual) memory addressing and "Real" (i.e. physical) memory
addressing. The core, and therefore all software run on the core, uses the Effective memory addressing. All
resources external to the core, such as the eDMA and peripherals, use Real memory addressing. The MMU is
located within the core and interfaces between Effective memory pages and Real memory pages, providing flexible
routing between the different page types. The MMU allows users to setup memory pages by creating Translation
Lookaside Buffer (TLB) Entries, and specify the address, size and permissions for this memory space.

Typically an MMU entry would have a matching Effective page number (EPN) and Real page number (RPN). For
example, the following EPN and RPN in a TLB entry would create a memory page for internal flash.

• Effective Page Number (EPN) = 0x0000_0000
• Real Page Number (RPN) = 0x0000_0000

If software in the core accessed a resource at address 0x0000_0004, then this is treated as the physical. The MMU
will translate this to the RPN, which in this example is the same, and therefore accesses internal flash at the address
0x0000_0004.

During calibration, data stored in the internal flash will need to be re-mapped to the external SRAM. The MMU
allows this to be done with minimal software overhead. When calibration begins, software could remap the Real
Page Number from internal flash to the external SRAM. Continuing the above example, if the MMU re-mapped the
memory then the updated TLB Entry would have these properties:

• Effective Page Number (EPN) = 0x0000_0000
• Real Page Number (RPN) = 0x4000_0000

Software would still attempt to access the resource at the address 0x0000_0004, however the MMU would translate
this and perform the access to the physical address 0x4000_0004, an address in the external SRAM.

900 Views
mathias_edman
Contributor III

Hi David,

Thanks so much for your reply, it helps me a lot!!

What is confusing me is that I have two files (delivered by NXP) that describes all registers for the mcu in question:

MPC577xC.h

MPC5777C.h

When I search in these huge files I get 0 results for the words:

EPN

RPN

TLB

MMU

I would assume that I get something at least?

Do you have any example that I can take a look at, that could help me setting up the EPN and RPN with the right permissions etc. for MPC5777C?

Regards,

Mathias

0 Kudos

900 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

These are core register that are not described in any header file.

If you look at my example, file Optimizations.c, you may see the way how to modify MMU entry (in the assembler). This 

Example XPC567XRKIT PinToggleStationery CW210 

Also following excel tool will help you to setup TLB entries, it generates assembly code as well:

MMU Assist Register CONFIGURATOR 

Your debugger should be able to show MMU table as follows (PeMicro debugger in this case)

pastedImage_1.gif

And finally I am attaching presentation slide.

900 Views
mathias_edman
Contributor III

Hi again David,

Thanks for fast reply. I understand what I need to do now.

One final question:

Do you know what would happen if you change MMU table for the same area where you are currently executing? 

Regards,

Mathias

0 Kudos

900 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

As following synchronization instruction are used when TLB is updated,

    msync
    tlbwe
    isync

it happens just that context is changed i.e. before that specific address points to certain place and after that is points to different place.