Kinetis BSP_PE Cloning Issue

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

Kinetis BSP_PE Cloning Issue

Jump to solution
932 Views
Vagni
Contributor IV

I use CodeWarrior 10.1 SE with ProcessorExpert 5.1 and MQX 3.7.

I am trying to clone PSP_twrk60n512 and BSP_twrk60n512_PE libraries to the new libraries needed by my new MQX-based application on my new board with the Kinetis K20 cpu.

I am following both MQX User Guide and AN4287 for my porting pourpose.

 

I see PSP_twrk60n512 and BSP_twrk60n512_PE libraries relay on the MK60N512VMD100.h include file.

I copied the MK20N512VMD100.h include file for K20 cpu from the  {CW10.1}\MCU\ProcessorExpert\lib\Kinetis\iofiles folder to the {MQX 3.7}\mqx\source\psp\cortex folder. In this folder I modified the psp_cpudef.h in order to include the needed macroes for K20 cpu:

 

#define PSP_CPU_MK20N256        (PSP_CPU_NUM(PSP_CPU_ARCH_ARM, PSP_CPU_GROUP_KINETIS_K20, 0))

#define PSP_CPU_MK20X256        (PSP_CPU_NUM(PSP_CPU_ARCH_ARM, PSP_CPU_GROUP_KINETIS_K20, 1))

#define PSP_CPU_MK20N512        (PSP_CPU_NUM(PSP_CPU_ARCH_ARM, PSP_CPU_GROUP_KINETIS_K20, 2))

 

#define PSP_CPU_K20N512         PSP_CPU_MK20N512

 

because in the user_config.h include file in the  {MQX 3.7}\config\MyBoard folder I have defined:

 

#define MQX_CPU                 PSP_CPU_MK20N512

 

With those changes I got my new PSP library builded.

 

For the new BSP_PE I modified the ProcessorExpert original project, adding the K20 cpu component (and activating its configuration) and all the LDD emmbedded components needed by my application and regenerating the ProcessorExpert code.

But I get errors when I try to build my new BSP_PE library.

 

The first error I got ("MK20DZ10 memory map: There is already included another memory map.") was caused by redefinitions in the IO_Map.h include file generated by ProcessorExpert tool. Comparing this file with the same one in the BSP_twrk60n512_PE library I realized I had to modify in the IO_Map.h include file the MCU activation macroes in the same way:

 

#if !defined(MCU_MK20DZ10) && !defined(MCU_MK20N512VMD100)  /* Check if memory map has not been already included */

#define MCU_MK20DZ10

#define MCU_MK20N512VMD100

 

But then I got another error in the building: "XXX PDD library: Unsupported derivative is active."

I see that in all {embedded components}_PDD.h include file in the {CW10.1}\MCU\ProcessorExpert\lib\Kinetis\pdd\inc folder the test if supported MCU is active looks for the defined MCU_MK60DZ10 and MCU_MK60N512VMD100 macroes for K60, but only for the defined MCU_MK20DZ10 for K20.

Is this the cause of the building error?

Have I to modify all the {embedded components}_PDD.h include files to include K20 too?

 

Can you provide me a step-by-step procedure to port the PSP and BSP_PE libraries for TWR-K60N512 from Kinetis K60 cpu to another Kinetis cpu (K20, K10, ... ) ?

 

0 Kudos
1 Solution
338 Views
jimtrudeau
Senior Contributor I

Vagni,

 

What you are trying to do is non-trivial. The instructions would be very long for the forum. In the past few months we have run 2-4 hour hands-on classes at the FSL Technology forum and at FAE and Distributor FAE training sessions teaching how to do this. We have an app note in development that guides step by step through the process. It is not ready for consumption yet. But, I will contact you via email with some guidance.

 

Here's the general guidance - you are much better starting with a K20 BSP and getting that ready for PEx than to take a PEx-ready K60 and try to get that set up for K20. As you have discovered, there are all kinds of subtleties like memory maps and other processor-specific dependencies that will cause you headaches. Even still, turning the standard K20 BSP into something that is PEx aware has several very obscure settings that have to be set up properly. I'll cover that in a long email that hopefully will get you started.

View solution in original post

0 Kudos
2 Replies
339 Views
jimtrudeau
Senior Contributor I

Vagni,

 

What you are trying to do is non-trivial. The instructions would be very long for the forum. In the past few months we have run 2-4 hour hands-on classes at the FSL Technology forum and at FAE and Distributor FAE training sessions teaching how to do this. We have an app note in development that guides step by step through the process. It is not ready for consumption yet. But, I will contact you via email with some guidance.

 

Here's the general guidance - you are much better starting with a K20 BSP and getting that ready for PEx than to take a PEx-ready K60 and try to get that set up for K20. As you have discovered, there are all kinds of subtleties like memory maps and other processor-specific dependencies that will cause you headaches. Even still, turning the standard K20 BSP into something that is PEx aware has several very obscure settings that have to be set up properly. I'll cover that in a long email that hopefully will get you started.

0 Kudos
338 Views
jimtrudeau
Senior Contributor I

It's made even more difficult by the fact that there isn't a K20 BSP to get started with. :smileysad: I was assuming there was one, I didn't go look first. My mistake. There are BSP's built for the K40 and the K60 processors.

 

So, in terms of enablement, you are back where you started, meaning starting with a BSP designed for a different MCU. The suggestions I gave you were well meaning, but in the end useless. For that I apologize.

 

If you start with a BSP already modified to work with Processor Expert, such as {mqx installation}\mqx\build\cw10\bsp_twrk40x256_pe (or k60n512_pe), then you need to adapt that to your target Kinetis processor. There's another for the kwikstik, at least in my installation.

 

If you study the differences among these that should give you some clues about what needs to change. When you run into specific issues, Ask here, or file a formal SR with tech support.

0 Kudos