Author Topic: USB communication with Pc host  (Read 5054 times)

Offline Javier

  • Newbie
  • *
  • Posts: 16
    • View Profile
USB communication with Pc host
« on: April 02, 2018, 01:24:41 AM »
Hi,

In a project I'm going to need USB communication to update de application and read/write the application configuration from a PC (Java applicaton, JNA/JNI/Swig).

Also, I need, eventually, to use SDcard to logging, for example to store the sensors data

I'm configuring uTasker project to demo purpose with the FRDM-K64F.

Then, I should to use this define?

Code: [Select]
#define USE_USB_MSD

Best regards

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: USB communication with Pc host
« Reply #1 on: April 02, 2018, 06:52:29 PM »
Javier

For USB device you need to enable "USB_INTERFACE"
"USE_USB_MSD" will then enable USB-MSD to SD card (or internal file system), in which case you will also need to enable "SDCARD_SUPPORT".
At the same time you can enable "USE_USB_CDC" to have also virtual COM, which is a general purpose bulk device as composite together with the USB-MSD which you may be able to use for other purposes.
"#define USB_CDC_COUNT             1" is the default for a single VCOM, but this can also be increased to get more such
The option "USB_SIMPLEX_ENDPOINTS" allows bulk endpoints to shared the same pipe for in and out directions and with this one USB-MSD and 6 VCOMs are possible on the Kinetis FS interface (without it is one USB-MSD and 4 VCOMs).
Possible you could alternatively use "USE_USB_HID_RAW" which is also quite a generic method for the configuration requirement.

Regards

Mark

Offline Javier

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: USB communication with Pc host
« Reply #2 on: April 05, 2018, 09:51:20 AM »
Amazing.

Works pretty fine.

Code: [Select]
SD-card V2 - High Capacity                                                                                                                             
Disk D mounted

And open Nautilus to show the sdcard content.

Best regards