본문 바로가기
Embedded SW/[Infineon] TC275 English Version

10. Number of MCU CPUs? Multi Core? What is this?

by 방구석 임베디드 2023. 9. 5.
반응형

Hello.

Today, I'm going to write a very simple article.
It's about the CPU.

 

This article is one of the articles that serialize the overall contents of development.

So, if you look at the previous article, I think it will be more helpful.

I will link the article below. Read it if you need to.

(Of course, there is no big problem if you just read this article.)

 

00. Embedded SW development using TC275 (Prologue)
01. What is embedded SW and what is MCU (Micro Control Unit)?
02. How to purchase an embedded development board (TC275, Infineon)
03. How to set up an embedded SW development environment (what is a source code editor, compiler, and debugger environment)
04. How to create an MCU TC275 project (Infineon)

05. Digital output settings and LED blinking using TC275 (push-pull, open drain)

06. Understanding MCU Clock, Oscillator (Infineon TC275)

07. What is PLL in MCU? PLL and Clock settings on Infineon TC275

08. Let's design a timer using Infineon TC275 MCU

09. Before development, let’s organize the SW code (TC275, Infineon)

 


CPU stands for Central Processing Unit.
You can think of it as an arithmetic unit.
It performs the task of reading and executing the code we've designed.
But how many CPUs are in the TC275 that we are currently purchasing and operating?
It has 3 cores.
You can think of it as having 3 CPUs.

The MCU we purchased has an excellent spec, boasting as many as 3 cores.
Therefore, we can create something really cool later using these 3 cores.
You can study concepts like Mutex, Semaphore, and shared resources.
Price competitiveness is really important in the company.
By using not two MCUs but one MCU with two cores in the design, you can gain advantages in execution time, and above all, save money.

 

However, a lot of study is needed to design using two cores.
You also need to be proficient in handling Linker Script.
You should also be good at handling #pragma. Hahaha.
The reason embedded systems are so attractive is that you can design everything from top to bottom yourself.
So let's try using only 2 of the 3 cores using ILLD.
If you look at the IfxCpu_CStart0.c file in ILLD, you will see a section that determines the use of Tricore.

#ifndef IFX_CFG_CPU_CSTART_ENABLE_TRICORE0
#   define IFX_CFG_CPU_CSTART_ENABLE_TRICORE0        (1) /**< Cpu0 enabled by default*/
#endif
#ifndef IFX_CFG_CPU_CSTART_ENABLE_TRICORE1
#   define IFX_CFG_CPU_CSTART_ENABLE_TRICORE1        (1) /**< Cpu1 enabled by default*/
#endif
#ifndef IFX_CFG_CPU_CSTART_ENABLE_TRICORE2
#   define IFX_CFG_CPU_CSTART_ENABLE_TRICORE2        (0) /**< Cpu2 enabled by default*/
#endif


Originally, all are set to 1, but let's try changing Tricore2 to 0.
Then, the operation of Core2 will stop, and we will only be using Core0 and Core1.
Now let's try building it once.

An error occurs.
A linker error has occurred.
IfxCpu_CStart2.o has been created, but it says it can't find the Symbol called __USTACK2.


/* Load user stack pointer */

__setareg(sp, __USTACK(2));

 

Since we're not going to use Core2 now, let's remove the IfxCpu_CStart2.c file.
Then there should be no problem during linking!

 

First, we can confirm that the compilation has been done correctly.
And if you run the board below, you can see that the Core2 part is suspended and not operating.
Only Core0 and Core1 are running.

Now it would be good to think about the Start Code and Linker Script files.

But what does Start Code mean?

반응형

댓글