Freescale HCS12(x) memory map explanation (1).

Publisher:学富五车Latest update time:2021-08-12 Source: eefocusKeywords:Freescale  HCS12(x)  memory  map Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

For people who use MCU, it is not necessary to understand the mechanism and connection of HCS12(x) memory map. Because if you do not systematically study courses such as operating system and compiler theory, it is indeed difficult. In addition, for MCUs such as DG128 XS128, the default memory allocation method is sufficient. In this sense, it seems unnecessary to understand the memory map.
 

However, have you ever had a situation where you don't have enough RAM? Have you ever wanted to define variables in FLASH ROM? Have you ever defined variables in non-paged area to improve addressing efficiency? Have you ever failed to write to EEPROM?
Freescale's memory is very flexible. Improving efficiency through address mapping is a common practice of chip manufacturers (of course, first of all, the CPU must have this addressing and memory mapping conversion mechanism). However, looking at the HCS12(x) memory map, it is really the limit. In my previous words, it is to use limited resources to obtain unlimited benefits. Look at DG128, 64K logical space, after mapping, RAM EEPROM FALSH ROM, can fully play a role, and it is also convenient to expand FLASH. XS128 is more advanced, with a dedicated MMC to manage HCS12(x) memory map.
 

I have a general understanding of the HCS12(x) memory map of these two chips, so I would like to share my understanding and opinions on this. If there are any errors, please feel free to point them out.
 

First, let’s talk about 6 concepts.
 

1 memory map address mapping, do not understand it as memory mapping, memory is RAM.
 

2 Why is mapping necessary? Because the addressing of the CPU is based on the physical address operation, but after the RESET of the microcontroller, there is only a relative address. I understand the relative address as a piece by piece, not a continuous one. As the name implies, the relative address is relative. Before mapping, the CPU cannot find it, nor can it use the data of the relative address. Here is an explanation from Baidu: In order to ensure that the CPU can correctly access the storage unit when executing instructions, the logical address in the user program needs to be converted into a physical address that is directly addressed by the machine at runtime. This process is called address mapping.
 

3 RAM, I won’t say much about this, it is used to store variables and stacks, it is high-speed and will be lost when power is off.
 

4 EEPROM, this is a special kind of FLASH. It is generally used to save a small amount of data and will not be lost when the power is off. FLASH is also non-volatile, and SD card is a kind of FLASH. The difference between EEPROM and ordinary FLASH lies in the byte operation when reading and writing. I basically have no experience with this because it is a very low-level thing.
 

5 FLASH and ROM. In HCS12(X), it is recommended to understand FLASH and ROM as equivalent. Your program is stored here. There is also a const variable and interrupt vector in it. There may be a misunderstanding about ROM, which can only be read but not written, one-time, which is good. However, there is a premise that it should be a controllable ROM.
 

6 There is also an important register space, which is used to store I/O addresses and microcontroller programmable registers. It is defined by the manufacturer and can be seen in the header file. For example, extern volatile PORTABSTR _PORTAB @(REG_BASE + 0x00000000) is a typical register space mapping.
  

I understand memory map as three things: one is mapping management, one is paging mechanism, and one is addressing. Mapping management is the relationship between logical address and physical address after the microcontroller is reset. The paging mechanism is mainly due to the limited addressing capability of 16 bits, which requires paging. In addition, it can gain more advantages in virtual memory management. As for the CPU addressing problem, I won't go into it in depth.
  

This time we take DG128 as an example. XS128 is a little more complicated. If you understand DG128, XS128 will not be a big problem.
  

Let's talk about mapping management first: In DG128, mapping is achieved by setting INITRG, INITRM, and INITEE. For specific settings, see DS. By default: register space is mapped to 0X0000 to 0x03FF, which has the highest priority. RAM space is mapped to 0x0400-0X1FFF. See, there are only 7K in reality, which means that only 7K RAM can be used. However, DG128's RAM has 8K logical space. Therefore, you can change INITRG, INITRM, and INITEE to remap to increase the actual available space of RAM. How to change depends on the need. WJ will say a word here, you can see how PE is changed. And FLASH maps 3, there are two non-paged addresses 0x4000-0x7FFF and 0xC000-0xFEFF. There is also a paged address, and this paged address has 6 pages. Six pages occupy one paging window and one logical space. How can these six pages work together and allow the CPU to find them?

This is the content of the paging management mechanism. The 6 pages are:
     

      PAGE_38 = READ_ONLY 0x388000 TO 0x38BFFF;
      PAGE_39 = READ_ONLY 0x398000 TO 0x39BFFF;
      PAGE_3A = READ_ONLY 0x3A8000 TO 0x3ABFFF;
      PAGE_3B = READ_ONLY 0x3B8000 TO 0x3BBFFF;
      PAGE_3C = READ_ONLY 0x3C8000 TO 0x3CBFFF;
      PAGE_3D = READ_ONLY 0x3D8000 TO 0x3DBFFF;
  

As mentioned above, you can create a new DG128 project and look at the PRM file.
  

Let's look at the paging management mechanism: In DG128, only the FLASH space can be paged, while in XS128, there are too many things to page. In DG128, FLASH paging is done through the PPAGE register. PPAGE is a 5-bit register, and the CPU12 core specification states that each page can only have 16KB. Therefore, the FLASH addressing space of DG128 is 2^5*16KB=512KB.


Keywords:Freescale  HCS12(x)  memory  map Reference address:Freescale HCS12(x) memory map explanation (1).

Previous article:Freescale HCS12(x) memory map explanation 3.
Next article:Freescale HCS12(x) memory map explanation 2.

Recommended ReadingLatest update time:2024-11-16 08:55

Micron is the first to provide industry partners with high-speed, low-latency 128GB large-capacity RDIMM memory based on 32Gb single-die DRAM
Micron's 1β advanced process-based DRAM delivers up to 8,000 MT/s, providing better solutions for memory-intensive applications such as generative AI November 22, 2023, Shanghai, China - Micron Technology, Inc. (Micron Technology, Inc.) recently announced the industry's first 128GB DDR5 RDIMM memo
[Embedded]
Micron is the first to provide industry partners with high-speed, low-latency 128GB large-capacity RDIMM memory based on 32Gb single-die DRAM
s3c2440 bare metal-memory controller (3-4, implementation of norflash programming)
1. Identify norflash We know that to identify the norflash attributes, we need to put norflash into cfi mode, and then send a series of commands according to the table in the manual to obtain the norflash attributes. 1) Send command Then we need to implement a function nor_cmd() that allows the CPU to send command
[Microcontroller]
s3c2440 bare metal-memory controller (3-4, implementation of norflash programming)
AUTOSAR diagnostic system event memory management
Event memory management is defined as the process of adding, updating, and deleting event memory entries in the DEM module. The DEM module determines whether an event memory entry is new or currently exists in the event memory. Event retention Event retention defines the ability of the DEM module to
[Embedded]
OK6410A Development Board (VIII) 36 linux-5.11 OK6410A Memory Management Phase 4
D mm_init- mem_init returns- mm_init- kmem_cache_init returns ----At this time, slab is established, opening the era of slab memory manager based on the buddy memory manager era kmem_cache_init This process is based on slabs. Through the slab api kmem_cache_create, many slabs are created. Assume that these slabs
[Microcontroller]
Vivo S12 Pro appears on the benchmarking platform with 12GB of memory
Recently, two vivo smartphones with model numbers V2162A and V2163A were certified by the 3C authority. Reports suggest that these models will debut in the Chinese market with the names vivo S12 and vivo S12 Pro. The Pro model has now appeared on the Geekbench benchmarking website and has provided some key specifica
[Mobile phone portable]
Vivo S12 Pro appears on the benchmarking platform with 12GB of memory
Rambus Launches CXL™ Memory Interconnect Program to Lead the New Era of Data Center Architecture
summary: • Initiate R&D work to transform data center architectures through memory expansion and pooling solutions to enable disaggregated and composable server architectures • Combines unique expertise in high-speed interfaces, embedded security and server memory buffers to devel
[Semiconductor design/manufacturing]
Rambus Launches CXL™ Memory Interconnect Program to Lead the New Era of Data Center Architecture
Memory "barometer": Server market rises, prices rise after a brief period of flattening
At the beginning of 2020, due to the large-scale outbreak of the novel coronavirus pneumonia, all walks of life suffered huge impacts and losses. In the semiconductor storage industry, due to the outbreak of the epidemic, considering factors such as the epidemic, upstream resources, transportation logistics, and insuf
[Mobile phone portable]
OK6410A Development Board (VIII) 31 linux-5.11 OK6410A Perception of Linux Memory Management
Linux memory management, we perceive three types of memory management System Memory ManagementA Kernel thread memory management A User process memory management Kernel state A User Mode B These should be divided into two categories, AB Class A shares the same memory (virtual and physical) Class B has o
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号