Inline.

On Mon, Feb 24, 2014 at 6:45 PM, <[email protected]> wrote:

> Hi Ytai,
>
>           Actually I already flipped the USB cable. I put all my questions
> in detail as below.
>
> 1. On the Android library side, for the usb interface there are two mode
> being supported, ADB and Open accessory, right?
>
> For the ADB, android side works as USB device mode.
> For Open accessory, android side works as USB device mode. (can it support
> host mode? according to the information from android developer website, it
> just can support device mode. But your latest release note says, "Support
> for Android working in host 
> mode<https://github.com/ytai/ioio/wiki/IOIO-Over-OpenAccessory>,
> courtesy of Misha and Nadir (thanks!).". I am kind of confused)
>

There are actually 4 modes supported between the IOIO and Android (note
that USB host always supplies power and always on the "A" side of the
cable):

   1. ADB (legacy) - IOIO is the host, Android is the device.
   2. OpenAccessory - IOIO is the host, Android is the device. Available on
   most Android >4 and on some Android 2.3.4+ and 3+. Requires compiling your
   app with the IOIOLibAccessory library.
   3. Android with IOIO as device. Unlike what you might have read, this is
   very possible. It requires a host-capable (sometimes referred to as OTG)
   Android. Nexus 5 / 7 and Moto X are examples for ones that support that.
   Requires IOIOLibAndroidDevice to be compiled with your app.
   4. Bluetooth - IOIO acts as a USB host for a Bluetooth dongle.



>
>  2. Since CDC mode is supported in the firmware, what is CDC mode is used
> for? As I understand, the android library you are supplying does not
> support cdc.
>

As pointed above, your understanding is incorrect. However, CDC was
originally introduced for PC support. The IOIO can be used with a PC in one
of two modes:

   1. USB (CDC) - the IOIO acts as device.
   2. Bluetooth - same deal as above with the dongle.

In both modes the IOIO would appear as a virtual serial port on the PC and
the IOIOLibPc library would let you talk to it using the same API as you
use on the Android.


>
> 3. Is it a good idea to remove bootloader? With bootloader, I can not
> debug my firmware code. So I remove bootloader by modifying the related
> address of the firmware code. So when I flash the MCU, I just need to flash
> the firmware part. Before I have to combine the bootloader hex with the
> firmware hex, then flash it. Is it a good way to do it like this?
>

Not a good idea. In order to be able to debug:

   1. Change the configuration flags in main.c of the bootloader to disable
   all code protection.
   2. Add the bootloader project in the appropriate config (probably
   SPRK0020 in your case) as a "loadable project" to the app_layer_v1 project
   (IOIO0030 configuration). This will merge the hex file of the BL into the
   hex file of the app as well as cause MPLAB to read the symbols from both,
   which effectively means you can debug both as one monolithic app.
   3. Having said that, there's not a whole lot of usefulness to
   step-by-step debugging in embedded apps very often, since there are a lot
   of timing dependent things, but YMMV.
   4. There's also an option to build the app with the ENABLE_LOGGING flag
   that will cause it to spit stdout with a lot of debug info on UART2 / pin
   32. This is what I'm normally using for debugging.



>
> 4. Any macro need defined while compiling the firmware to enable open
> accessory mode? Now my problem is that using your released hex file
> ,  DevBoot-IOIO0401-App-IOIO0500 works. With myself compiling one, it is
> always recognized as CDC mode. Does it to do with I removing the booloader?
>

I have no idea what you did and what you're using. The are various
configurations to libusb with different subsets of the functionality. If
you leave things as they were, you'd get everything on the app (and only
CDC on the bootloader).


>
> Thanks and Regards,
> Jim
>
>
> On Monday, February 24, 2014 5:39:32 PM UTC+8, [email protected] wrote:
>>
>> Hi Ytai,
>>
>>            I am afraid I need your help. :)
>>
>>            I compiled the firmware myself with the firmware source code.
>> (I modified the program start address to get away of bootloader part.
>> because in this way, I can debug step by step)
>>
>>            When I connected the IOIO board running my firmware with my
>> samsung S3. It is recognized as CDC mode, not Openaccesory. (on S3, I
>> disabled the ADB) I am wondering how to make the USB interface recognized
>> as open accessory. I noticed some macro are related with USB mode. I am not
>> sure whether I should do some macro setting to make it work. On S3, I have
>> developed a test app to test with ioio board. It works fine with the hex
>> file of DevBoot-IOIO0401-App-IOIO0500.
>>
>>           Thanks.
>> Regards,
>> Jim
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "ioio-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/ioio-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to