How to use multi-core for the MPC5748G

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

How to use multi-core for the MPC5748G

3,924 Views
chfakhtchfakht
Contributor III

Hi everyone,

 

I'm trying to implement the LZMA algorithm (compression/decompression algorithm) in the MPC5748G, however i need an example on how to use more than one core since there are 2 cores of 160Mhz

 

I'm using LZMA to reduce flashing time, the file firstly is compressed and then sent to the MPC ... it should then decompress the file and perform the flashing operation.

 

The algorithm need to run on a separate core because the other core are doing other things and contains a lot of tasks.The results are not very good and the decompression takes too much time.

 

Any help for using the other core will be very helpfull,thanks.

Labels (1)
12 Replies

2,362 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

take a look at this multicore example:

Example MPC5748G PinToggleStationery GHS614

More examples can be found here:

MPC5 software example list

Regards,

Lukas

2,193 Views
Andris
Contributor I

Thank you for sharing your t32 scripts

0 Kudos

2,362 Views
chfakhtchfakht
Contributor III

@Lukas Zadrapa can you tell me if using on single core for the LZMA decompression will be much usefull and give more performance ?

Also the example you gave me already contains the elf files to be flashed but do i need to use the cmm script that does the operation ... and also what options to use to compile those files, thanks

0 Kudos

2,361 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Sure, using one core for SW tasks like LZMA decompression should definitely improve the performance.

I wrote and compiled the example in Green Hills MULTI IDE version 6.1.4. Then I used debugger Trace32 from Lauterbach, so I wrote cmm scripts which are included in the project.

So, everything depends on your tools - on your IDE/compiler and debugger. If you use another tools than described, you will need to port the project accordingly.

Regards,

Lukas

0 Kudos

2,361 Views
igor1024
Contributor I

Hi Lukas,

your answer is really helpful. Is there any chance that you have the example for sharing contest between cores?

Best regards,

Igor

0 Kudos

2,361 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Igor,

take a look at:

Example MPC5775K Semaphores S32DS 

It is written for MPC5775K but the principle is the same...

Regards,

Lukas

2,361 Views
chfakhtchfakht
Contributor III

I'm using diabCompiler and scons / makefiles for compilation , also trace32 from  Lauterbach

Thanks for your support

0 Kudos

2,361 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Well, I don't have diab compiler here, so I can't help. But you can re-use script files for Lauterbach.

Lukas

2,361 Views
chfakhtchfakht
Contributor III

ok, Can i call / start a core from another core ?

0 Kudos

2,361 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

See the example I mentioned earlier. There's a function which shows how to start other cores (z4b and z2):

void Core_Boot(void)

{

    /* Enable e200z4b and e200z2 cores in RUN0-RUN3, DRUN and SAFE modes */

    MC_ME.CCTL[2].R = 0x00FC;    /* e200z4b is active */

    MC_ME.CCTL[3].R = 0x00FC;    /* e200z2 is active */

   

    /* Set start address for e200z4b and e200z2 cores */   

    MC_ME.CADDR[2].R = E200Z4B_BOOT_ADDRESS | 1; /* e200z4b boot address + RMC bit */

    MC_ME.CADDR[3].R = E200Z2_BOOT_ADDRESS | 1; /* e200z2 boot address + RMC bit */   

  

    /* Mode change - re-enter the DRUN mode to start cores */

    MC_ME.MCTL.R = 0x30005AF0;         /* Mode & Key */

    MC_ME.MCTL.R = 0x3000A50F;        /* Mode & Key inverted */

                                       

    while(MC_ME.GS.B.S_MTRANS == 1);    /* Wait for mode entry complete */

    while(MC_ME.GS.B.S_CURRENT_MODE != 0x3);    /* Check DRUN mode entered */

}//Core_Boot

Lukas

2,361 Views
chfakhtchfakht
Contributor III

thanks i will try it,

So once the second core is started how can i use it to run my desired function.

0 Kudos

2,361 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

It's the same like the main core - the boot address in MC_ME.CADRR[n] points to entry point - to startup code. The startup code should initialize stack pointer, C environment (initialization of data pointers, variables...) and jump to main function. And here you can write whatever you want... See the source files of my example.

Lukas