Porting CodeWarrior project to KDS: any suggestions?

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

Porting CodeWarrior project to KDS: any suggestions?

1,141 Views
lucaognibene
Contributor II

Hello everybody!

 

I'm currently working with CW 10.5 with a MCU Kinetis K60 (MK60DN256ZVLL100 precisely) and I planned to move to KDS.

In my project I'm using Processor Expert and various "complex" components such USB stack (Freescale V4.1.1), SDCard and FatFS (from the great Erich Styger :-)  ).

 

In my porting experiments I solved a few problems regarding compiler/assembler (eg. the GCC Assembler wants __asm__("op") instead of asm("op"), compiler search paths, etc ) and don't use space in project folder names (this leads to file not found).

 

I proceeded this way:

- I started a new KDS project with the same characteristics of the original CW project (MCU, PE-based project).

- I added and set the same PE components in KDS, copying the same parameters components have in CW.

  I noticed a couple of fields more in the USB_DEVICE_STACK: Synchronization Type and a doubled Max Packet Size field (inside Configuration Descriptor).

  Moreover another Referenced_Component that wasn't there in CW: CS (CriticalSection - what's this?): it's needed by TimeOut and GenericTimeDate components used by FatFS.

 

I'm currently stuck on compiler problems on the USB stack sources.

I noticed that the PDD files from CW and KDS are different, but I'm not aware of what this implies (if someone can explain what these files are for).

 

In another experiment I hoped, somehow, that since the same MCU, once I include the Generated_Code from CW, everything would run correctly into KDS, but it's not (expected PE generated files would just set hardware registers directly).

 

If you have any clues/suggestions let me know.

    Luca O.

Labels (1)
0 Kudos
5 Replies

694 Views
BlackNight
NXP Employee
NXP Employee

Hi Luca,

CS (Critical Section) is a special component who can create critical sections (thus the name :-) ). See

If you do not have that component, you probably not using the latest components set which are on GitHub (see Processor Expert Component *.PEupd Files on GitHub | MCU on Eclipse). If you have both *.PEupd files installed, you should have what you need. Keep in mind that CodeWarrior and KDS are using different folders (on Windows) where the components are installed (see CDE Hacking: Where is my stuff? A dissection… | MCU on Eclipse):

  • CodeWarrior uses C:\ProgramData\Processor Expert\CWMCU_PE5_00
  • KDS uses C:\ProgramData\Processor Expert\PEXDRV_PE5_3

So you probably have imported the *.PEupd files in only one tool chain: you need to import the components in both tool chains.

And it is correct that 'in general' the generated code is the same (for the same CPU). However, the startup code/linker files are differenct between KDS and CW, so you would need to be aware of this at least.

I hope this helps,

Erich

0 Kudos

694 Views
lucaognibene
Contributor II

Thanks for the fast reply Erich!

Well, at the moment in CW I'm not using the lastest PE components: since the project is working right now I don't want to introduce possible problems in this "beta" stage : -)  Once everything is really stable, I'll try upgrading.

Instead I imported the lastest "beans" from GitHub on KDS: much probably that's the reason I got CriticalSection component in KDS (thanks for the links).

Maybe for a proper porting to KDS I should use exactly the same outdated components used in CW: in this case I don't know how to deinstall the new ones just loaded.

And yes, I noticed that the linker files are different between CW and KDS: this leads to more headaches since I made some modifications to the CW .lcf file for making USB and FNET work.

Are you aware of any incompatibilities between the Freescale USB stack V4.4.1 and PE components in KDS?

Should I switch to USB V5.0 beta? (far different in structure - I know USB "bare metal" and MQX have been joined)

BTW, my project is bare metal, no OS on it.

Thanks again for info!

    Luca O.

0 Kudos

694 Views
BlackNight
NXP Employee
NXP Employee

Hi Luca,

to use the same components for both IDE's simply have the C:\ProgramData\Processor Expert\PEXDRV_PE5_3 and C:\ProgramData\Processor Expert\CWMCU_PE5_00 the same.

You can remove the folder and then re-install the components. There is a way to remove individual components, but not that straight forward unless you use CDE.

I'm using not the USB_DEVICE_STACK: I have created my own USB components (as you probably are aware) based on the V4.1.1 stack. I have not used the V5.0 for K60, so I cannot comment.

Erich

0 Kudos

695 Views
lucaognibene
Contributor II

Ok, thanks!
I try a few experiments and I'll tell the results.

Regarding the USB_DEVICE_STACK, I've seen you created the FSL_USB_STACK (or named similary, right?), but I got this project from another (now ex) colleague, and I have to deal with the present (working) implementation.

I don't want to add too many variables to the already quite complex situation, so it's better to stick to the working basis and make changes when I'm in a stable situation.

Thanks for suggestions: now the whole thing it's a bit clearer.  :-)

Luca O.

0 Kudos

695 Views
BlackNight
NXP Employee
NXP Employee

Hi Luca,

yes, it is the FSL_USB_Stack component.

Erich

0 Kudos