porting FRDM KL27Z64 demo project to KL27Z32

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

porting FRDM KL27Z64 demo project to KL27Z32

Jump to solution
617 Views
PO220
Contributor IV

Hi

I'm using a KL27Z32 for full speed usb.

In the attached project I try to port the usb_device_cdc_vcom FRDM_KL27Z (kl27z64) demo project to a KL27Z32 project

 

The project compiles but usb don't works :

in usb_device_class.c

if ((NULL != s_UsbDeviceCommonClassStruct[count].handle) &&
            (controllerId == s_UsbDeviceCommonClassStruct[count].controllerId))
        {
            USB_OSA_EXIT_CRITICAL();
            return kStatus_USB_Error;
        }

return USB_error.

 

USB Stack User's Guide describe a method to Porting to a new plateform but since KSDK 2.1 I can not make it work.

Before I could import an example with import => existing ...

175354_175354.JPGbefore.JPG

But since 2.1 KSDK, projects no longer compile with this method with a lot of error

175364_175364.JPGerror.JPG

 

Now to import a project I have to go through file=>new=>kinetis SDK 2.0 project

175365_175365.JPGnow.JPG

but I can not change platform with this method

 

What is it missing in my test Z32 project ?

or

How to use the demo for KL27Z64 with a KL27Z32 ?

 

Thank you in advance

Original Attachment has been moved to: test-kl27z32-bm-demo-vcp-usb.zip

Labels (1)
0 Kudos
1 Solution
398 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi PO220

In this case you only want to change to a MCU that has less flash, this mean that all the features and registers will be the same, your flash size is the one that will change in the linker file. Please download the SDK_2.1_MKL27Z32xxx4 in Welcome to MCUXpresso | MCUXpresso Config Tools 

Clone the usb project that you want: Go to file->new->kinetis SDK 2.x project, assigned a name to your project and select the SDK folder that you downloaded. go to Boards->FRDM-KL27Z board->Examples and select the usb that you want to clone. then in propierties of you clone project go to Settings->Cross ARM C Compiler->Preprocessor and change the CPU_MKL27Z64VLH4 to the what that you want (for example CPU_MKL27Z32VLH4). Do the same with Cross ARM C ++ Compiler->Preprocessor.

After this, in your project folders, go to settings and delete the MKL27Z64xxx4_flash.ld file and copy and paste the MKL27Z32xxx4_flash.ld file located in {SDK_2.1_MKL27Z32xxx4}\devices\MKL27Z644\gcc. please note that this part is the one that will change your flash memory size.

With this settings your MCU should change. Please take care that all defines in board.h are considering the frdm board that uses CPU_MKL27Z64VLH4.


Hope this information helps you
Have a great day,
Jorge Alcala

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

2 Replies
399 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi PO220

In this case you only want to change to a MCU that has less flash, this mean that all the features and registers will be the same, your flash size is the one that will change in the linker file. Please download the SDK_2.1_MKL27Z32xxx4 in Welcome to MCUXpresso | MCUXpresso Config Tools 

Clone the usb project that you want: Go to file->new->kinetis SDK 2.x project, assigned a name to your project and select the SDK folder that you downloaded. go to Boards->FRDM-KL27Z board->Examples and select the usb that you want to clone. then in propierties of you clone project go to Settings->Cross ARM C Compiler->Preprocessor and change the CPU_MKL27Z64VLH4 to the what that you want (for example CPU_MKL27Z32VLH4). Do the same with Cross ARM C ++ Compiler->Preprocessor.

After this, in your project folders, go to settings and delete the MKL27Z64xxx4_flash.ld file and copy and paste the MKL27Z32xxx4_flash.ld file located in {SDK_2.1_MKL27Z32xxx4}\devices\MKL27Z644\gcc. please note that this part is the one that will change your flash memory size.

With this settings your MCU should change. Please take care that all defines in board.h are considering the frdm board that uses CPU_MKL27Z64VLH4.


Hope this information helps you
Have a great day,
Jorge Alcala

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

398 Views
PO220
Contributor IV

thanks

0 Kudos