AnsweredAssumed Answered

Virtual com on KL26 using PEx

Question asked by Stefano Luschi on Dec 28, 2016
Latest reply on Jan 11, 2017 by Stefano Luschi

Dear Sirs,

 

i have two projects both based on kinetics kl26z256vll4 that needs an USB virtual com to connectd to a PC.

I just have developed a lot of FW using KDS 3.2 and processor expert for both.

Now i should integrate USB CDC.

I added FSL_USB_Stack from components and also KineticsSDK (SDK V2.0) but i have some problems:

1) in FSL_USB_CDC_Device i must select Kinetis KL26Z48 because it doesn't exist the right processor. Is it right?

2) the Init_USB_OTG has many errors:

      Component name (USB0) "The component is not supported for selected processor"

      Clock gate "No type specified"

      Module clock Source "No type specified"

3) I have an error in Watchdog_Reset

../Generated_Code/wdt_kinetis.c: In function 'Watchdog_Reset':
../Generated_Code/wdt_kinetis.c:42:2: error: assignment of read-only member 'SRS0'

so i comment the code raw. (just to see if the system is able to compile

4) having deselected "Inherited USB Init" in FSL_USB_Stack i have another linker error:

G:\Spintop\Tecnico\WKSPACE\PE2\KL46USBPE\Debug/../Generated_Code/USB1.c:161: undefined reference to `USB0_Init'

in these routine:

uint8_t USB1_Init(void)
{
uint8_t err;
void USB0_Init(void); /* no inherited init component, use Init function name from properties */

USB0_Init(); /* no inherited init component, call Init function name from properties */
/* Initialize the USB interface */
err = CDC1_Init();
if(err != ERR_OK) {
/* Error initializing USB Class */
return ERR_FAILED;
}
USB1_usb_int_en();
return ERR_OK;
}

I decide to comment in this way:

uint8_t USB1_Init(void)
{
uint8_t err;
//void USB0_Init(void); /* no inherited init component, use Init function name from properties */

//USB0_Init(); /* no inherited init component, call Init function name from properties */
/* Initialize the USB interface */
err = CDC1_Init();
if(err != ERR_OK) {
/* Error initializing USB Class */
return ERR_FAILED;
}
USB1_usb_int_en();
return ERR_OK;
}

 

Finally it compile everything but when debug i note that the system is halted at startup at this location:

DefaultISR:
ldr r0, =DefaultISR
bx r0

 

Please note that also McuLibConfig is configured as Kinetis SDK V2.0.

 

How to solve these problems?

 

Do you think that exist some libraries that only need to be included in the project in a similar way of LPC series?

 

 Best regards,

Stefano

Outcomes