GSoC-2014 Arduino like Library using StarterWare - Project Proposal

Hi All!
I am in the process of drafting my proposal for the project, and should be able to finish it in sometime soon now :smiley:

I am mentioning the major features that I plan to implement, I hope to get some assistance and reviews on the same.

  1. Create an Arduino-like library using StarterWare.
    I plan to develop an library which would utilize the StarterWare Library for accessing the hardware. To begin with, StarterWare provides functions for talking to ADCs, GPIOs, etc and would use this to implement basic functionalities for the GPIO library. Using these functions from Startware, we create the following:
    analogRead (using ADCs)
    analogWrite (using PWM)
    digitalRead, digitalWrite (using GPIOs)
    This completes the basic functions that are needed for the work ahead.

Next, we need to develop techniques for these host applications to do the bootload and then establish the USB-serial connection to see output messages.
I plan to use the Linux-USB based boot ( https://github.com/ungureanuvladvictor/BBBlfs ) The host PC would run a bootloader to remotely bootload the device over usb.

For the connection between BBB and host-pc, I plan to have a UART based serial communication, with the host running a serial terminal application like hyperterminal. With this the user can check the working of the functions of our library in good detail.

Next, after GPIO, I plan to add support for devices such as Keyboard and Mouse using this library. This completes the basic functionality of the library.

Now moving to advanced functions. Using the PWM access provided by Starterware, we now add support drivers for Servo motors. Basic speed control for a DC Motor can also be achieved using the ADCs.

We now move to setting up the communication aspects of the library. Here, I plan to add support for SPI, as this enables both two-way and a fast connection mechanism, whose speed and success efficiency is quite satisfactory for major project applications. After SPI, I move to implement a basic function for connecting to Ethernet. This will help connect the library over internet, and a possible future implementation could be a web-page interacting via an app to the BBB, and we could see outputs of the functions of the library on this page.

As an extension, we can add support for some sensors (as suggested by Jason) like adding support for bluetooth and Xigbee connectivity. Also some other basic sensors for visual and ir. We could add GPS support but I am not sure if it is possible as a part of this project.
This completes the library.

  1. Create Support for BeagleBone Black on Energia.
    We would create applications using our library on energia and hence introduce support for a new board (AM335X of the BBB). Also instead of using the CCSv5 IDE for starterware, we would use it on gcc (linaro toolchain) and hence it would make this project even more suitable for the open source community.

The end result would be to create a Makefile structure (similar to http://elinux.org/Userspace_Arduino) but for support through Energia. Thus, we would have given a loading functionality for our library.

  1. Basic Documentation for Library
    The project would also involve creating basic documentation about the HowTos of the library and code samples. I could make a github repo for the documentations, as suggested by Victor MV. This would make the project complete and hence would be extremely helpful for the whole of our community.

This is what I plan to achieve as a part of the project. It would be great to have comments and reviews from the community.

Regards,
Naman Govil
(electrobuz)

Hi All!
I am in the process of drafting my proposal for the project, and should be able to finish it in sometime soon now :smiley:

I am mentioning the major features that I plan to implement, I hope to get some assistance and reviews on the same.

  1. Create an Arduino-like library using StarterWare.
    I plan to develop an library which would utilize the StarterWare Library for accessing the hardware. To begin with, StarterWare provides functions for talking to ADCs, GPIOs, etc and would use this to implement basic functionalities for the GPIO library. Using these functions from Startware, we create the following:
    analogRead (using ADCs)
    analogWrite (using PWM)
    digitalRead, digitalWrite (using GPIOs)
    This completes the basic functions that are needed for the work ahead.

Next, we need to develop techniques for these host applications to do the bootload and then establish the USB-serial connection to see output messages.
I plan to use the Linux-USB based boot ( https://github.com/ungureanuvladvictor/BBBlfs ) The host PC would run a bootloader to remotely bootload the device over usb.

For the connection between BBB and host-pc, I plan to have a UART based serial communication, with the host running a serial terminal application like hyperterminal. With this the user can check the working of the functions of our library in good detail.

Black does not have a UART to PC interface, only a USB client interface. You can start with a USB to serial adapter, but for this to be broadly usable, a USB serial gadget implementation is needed.

Next, after GPIO, I plan to add support for devices such as Keyboard and Mouse using this library. This completes the basic functionality of the library.

With Beagle as host? Or emulating them as a client like I believe Arduino does?

I don’t see these as critical, but others can speak up.

Now moving to advanced functions. Using the PWM access provided by Starterware, we now add support drivers for Servo motors. Basic speed control for a DC Motor can also be achieved using the ADCs.

We now move to setting up the communication aspects of the library. Here, I plan to add support for SPI, as this enables both two-way and a fast connection mechanism, whose speed and success efficiency is quite satisfactory for major project applications. After SPI, I move to implement a basic function for connecting to Ethernet. This will help connect the library over internet, and a possible future implementation could be a web-page interacting via an app to the BBB, and we could see outputs of the functions of the library on this page.

As an extension, we can add support for some sensors (as suggested by Jason) like adding support for bluetooth and Xigbee connectivity. Also some other basic sensors for visual and ir. We could add GPS support but I am not sure if it is possible as a part of this project.
This completes the library.

  1. Create Support for BeagleBone Black on Energia.
    We would create applications using our library on energia and hence introduce support for a new board (AM335X of the BBB). Also instead of using the CCSv5 IDE for starterware, we would use it on gcc (linaro toolchain) and hence it would make this project even more suitable for the open source community.

The end result would be to create a Makefile structure (similar to http://elinux.org/Userspace_Arduino) but for support through Energia. Thus, we would have given a loading functionality for our library.

  1. Basic Documentation for Library
    The project would also involve creating basic documentation about the HowTos of the library and code samples. I could make a github repo for the documentations, as suggested by Victor MV. This would make the project complete and hence would be extremely helpful for the whole of our community.

This is what I plan to achieve as a part of the project. It would be great to have comments and reviews from the community.

Regards,
Naman Govil
(electrobuz)

Thanks for your thoughts. I believe this could be useful.

I have been looking at this a bit more myself and have started to wonder if just starting with the uboot code might be better than using StarterWare. Bringing in the StarterWare library could even be done, but it could never go upstream due to the binary copyright banner issue of the StarterWare BSD license. It could be a long-lived fork or all StarterWare usage could be avoided or eventually eliminated, though I am somewhat doubtful if upstream uboot would want the Arduino API.

The make structure of U-Boot-Arduino would be a bit more complicated, but it is pretty much already done with the exception of an ino source type.

  Hi All!
I am in the process of drafting my proposal for the project, and should be
able to finish it in sometime soon now :smiley:

I am mentioning the major features that I plan to implement, I hope to
get some assistance and reviews on the same.

1. Create an Arduino-like library using StarterWare.
I plan to develop an library which would utilize the StarterWare Library
for accessing the hardware. To begin with, StarterWare provides functions
for talking to ADCs, GPIOs, etc and would use this to implement basic
functionalities for the GPIO library. Using these functions from Startware,
we create the following:
analogRead (using ADCs)
analogWrite (using PWM)
digitalRead, digitalWrite (using GPIOs)
This completes the basic functions that are needed for the work ahead.

Next, we need to develop techniques for these host applications to do
the bootload and then establish the USB-serial connection to see output
messages.
I plan to use the Linux-USB based boot (
https://github.com/ungureanuvladvictor/BBBlfs ) The host PC would run a
bootloader to remotely bootload the device over usb.

For the connection between BBB and host-pc, I plan to have a UART based
serial communication, with the host running a serial terminal application
like hyperterminal. With this the user can check the working of the
functions of our library in good detail.

Black does not have a UART to PC interface, only a USB client interface.
You can start with a USB to serial adapter, but for this to be broadly
usable, a USB serial gadget implementation is needed.

    I see. We could establish our own serial communication using a USB to

serial adapter in this case.

Next, after GPIO, I plan to add support for devices such as Keyboard and
Mouse using this library. This completes the basic functionality of the
library.

With Beagle as host? Or emulating them as a client like I believe
Arduino does?
        We could make them clients just like in an Arduino. It makes for a
simple and working solution, we could use the same.
I don't see these as critical, but others can speak up.

Now moving to advanced functions. Using the PWM access provided by
Starterware, we now add support drivers for Servo motors. Basic speed
control for a DC Motor can also be achieved using the ADCs.

We now move to setting up the communication aspects of the library.
Here, I plan to add support for SPI, as this enables both two-way and a
fast connection mechanism, whose speed and success efficiency is quite
satisfactory for major project applications. After SPI, I move to implement
a basic function for connecting to Ethernet. This will help connect the
library over internet, and a possible future implementation could be a
web-page interacting via an app to the BBB, and we could see outputs of the
functions of the library on this page.

As an extension, we can add support for some sensors (as suggested by
Jason) like adding support for bluetooth and Xigbee connectivity. Also some
other basic sensors for visual and ir. We could add GPS support but I am
not sure if it is possible as a part of this project.
This completes the library.

2. Create Support for BeagleBone Black on Energia.
We would create applications using our library on energia and hence
introduce support for a new board (AM335X of the BBB). Also instead of
using the CCSv5 IDE for starterware, we would use it on gcc (linaro
toolchain) and hence it would make this project even more suitable for the
open source community.
The end result would be to create a Makefile structure (similar to
http://elinux.org/Userspace_Arduino) but for support through Energia.
Thus, we would have given a loading functionality for our library.

3. Basic Documentation for Library
The project would also involve creating basic documentation about the
HowTos of the library and code samples. I could make a github repo for the
documentations, as suggested by Victor MV. This would make the project
complete and hence would be extremely helpful for the whole of our
community.

This is what I plan to achieve as a part of the project. It would be
great to have comments and reviews from the community.

Regards,
Naman Govil
(electrobuz)

Thanks for your thoughts. I believe this could be useful.

I have been looking at this a bit more myself and have started to wonder
if just starting with the uboot code might be better than using
StarterWare. Bringing in the StarterWare library could even be done, but it
could never go upstream due to the binary copyright banner issue of the
StarterWare BSD license. It could be a long-lived fork or all StarterWare
usage could be avoided or eventually eliminated, though I am somewhat
doubtful if upstream uboot would want the Arduino API.

The make structure of U-Boot-Arduino would be a bit more complicated,
but it is pretty much already done with the exception of an ino source
type.

  This raise some serious concerns about the project. :frowning: Are we planning
to scrap it and removing the possibility of using Starterware due to the
copyrights issue? If this is the case, what else can we do in this project?

             If this is the case, can I make this project about creating

support for this library through energia, as mentioned in point 2. I
                 believe this is also something that could be worth
pursuing, and once we have created the Arduino functions and the loading
                 functionality, we could merge that into the Energia tree
and have them put it into their software releases.

             Is the rest of the proposal for various aspects of the library
satisfactory? Or should I remove/add other features?

A hardware adapter is only good for initial development. Perhaps check out:

http://elinux.org/U-boot_musb_gadget_support

http://processors.wiki.ti.com/index.php/StarterWare_USB

I will look up for the hardware adapter and possibly come up with another way for it.
But it will be great if you could share some views on the following:

This raise some serious concerns about the project. :frowning:
Are we planning to scrap it and removing the possibility of using Starterware due to the copyrights issue? If this is the case, what else can we do in this project?
If this is the case, can I make this project about creating support for this library through energia, as mentioned in point 2. I believe this is also something that could be worth pursuing, and once we have created the Arduino functions and the loading functionality, as you suggested, we could merge that into the Energia tree and have them put it into their software releases.

Is the rest of the proposal for various aspects of the library satisfactory? Or should I remove/add other features?

As from the start, I was planning and drafting my proposal considering Starterware, now I am a bit unclear about what we want the goal for this project now. Any suggestions here?

I will look up for the hardware adapter and possibly come up with another way for it.
But it will be great if you could share some views on the following:

This raise some serious concerns about the project. :frowning:
Are we planning to scrap it and removing the possibility of using Starterware due to the copyrights issue? If this is the case, what else can we do in this project?

I think using the combined projects at first is fine to generate something useful. I just want feedback from other potential mentors.

If this is the case, can I make this project about creating support for this library through energia, as mentioned in point 2. I believe this is also something that could be worth pursuing, and once we have created the Arduino functions and the loading functionality, as you suggested, we could merge that into the Energia tree and have them put it into their software releases.

Is the rest of the proposal for various aspects of the library satisfactory? Or should I remove/add other features?

Still needs more details.

As from the start, I was planning and drafting my proposal considering Starterware, now I am a bit unclear about what we want the goal for this project now. Any suggestions here?

Anyone else have thoughts?

Can we extend this project into first, the creation of the arduino-like library with the functionalities that I have mentioned before, including another api: an interface for accessing SD cards/MMCs on BeagleBone Black?
And then, creating the makefile structure for providing loading functionality of the library in Energia.
Does having support in energia sound interesting enough?

Can we extend this project into first, the creation of the arduino-like library with the functionalities that I have mentioned before, including another api: an interface for accessing SD cards/MMCs on BeagleBone Black?

Top-posting makes it very difficult for me to understand the context. I highly encourage you to avoid it. For the idea of doing U-boot-Arduino or StarterWare-Arduino, starting with the Arduino functions makes the most sense. I’m not sure why you spike out accessing SD cards here. Certainly including library support for accessing the cards makes sense.

The BeagleBone Black will boot images off of uSD cards. Until you have another boot mechanism, dropping the executables onto a uSD card is a reasonable way to boot them. I believe working in conjunction with the BBBlfs (or other) USB-based bootloader will provide the best experience for the user. Ultimately, this should be tied into the Energia project to provide a seemless Arduino-like experience.

And then, creating the makefile structure for providing loading functionality of the library in Energia.
Does having support in energia sound interesting enough?

Doing a Userspace Arduino style Makefile would seem like the first-phase and then move it into Energia. Staring with integrating it into Energia could be fine too, but it should be easy to isolate this code.

Hi All!
I have uploaded my proposal for the project. Kindly review it and provide me with comments so that I could improve upon it.
Mentors: The link to the proposal is this: https://www.google-melange.com/gsoc/proposal/review/student/google/gsoc2014/namang/5707702298738688

Hey All,
Copying the Implementation Plan and Timeline of the proposal here.

Motivation for Proposal / Goal:

The goal would be to create a arduino-like library utilizing the BeagleBone Black and the StarterWare O/S independent library for accessing the hardware. Without having to access the hardware through an operating system, developers will be able to fine-tune the system to achieve optimal resource management of the CPU, peripherals and memory. Then, we would move on to integrate the library with energia and ultimately provide a booting mechanism to have support for BeagleBone Black (AM335) on energia. The project would also include basic documentation and generation of code samples for various functionality of the library, such as GPIO, SPI, Serial, Ethernet, etc. This would make the project thorough and ready for use by various developers in the community.

Project Deliverables:

A library which would contain basic functions for GPIO, PWMs, Serial Communication, Ethernet, etc.
Userspace Arduino like MakeFile structure for providing loading facility in Energia.
By the end, we will have a reliable method to load this library and would have successfully created support for AM335 in Energia.

Implementation Details:

The implementation can be divided into 3 major parts.

Part 1: Development of Arduino-compatible functions

Here, I plan to develop a library which would utilize the StarterWare Library for accessing the hardware. To begin with, StarterWare provides functions for talking to ADCs, GPIOs, etc and would use this to implement basic functionalities for the GPIO library.

There can be two major ways of using Starterware: using the CCSv5 IDE or via the GCC Command line. I have chosen to go with GCC so as to improve open source support for this library. We will use the Linaro toolchain for the same.

Set-up Requirements for BeagleBone Black are:

The mini USB port (Connector P3) has to be connected to the host. This mini USB-to-serial connection is used for displaying messages on the serial console on the host, if the port is properly selected.
A serial terminal application (like Tera Term / HyperTerminal / Minicom) should be running on the host.
The host serial port is configured at 115200 baud, no parity, 1 stop bit and no flow control.
Ethernet port on board connected to a port on the LAN.
A microSD card is required. MMC/SD booting on beaglebone board essentially means booting via a microSD card.
These are some of the functions from Startware we will be using for accessing GPIO:

GPIOModuleEnable()
GPIODirModeSet()
GPIOPinWrite()
Hence, we create the following functions of our library:

analogRead (using ADCs)

analogWrite (using PWM)

digitalRead, digitalWrite (using GPIOs)

This completes the basic functions that are needed for the work ahead.

Next, we need to develop techniques for these host applications to do the bootload and then establish the USB-serial connection to see output messages.

I plan to use the Linux-USB based boot (https://github.com/ungureanuvladvictor/BBBlfs ) The host PC would run a bootloader to remotely bootload the device over usb.

Now moving to advanced functions. The enhanced high resolution PWM (EHRPWM) is capable of generating complex pulse width waveforms with minimal CPU overhead.

Some of the useful functions for this are:

PSCModuleControl()
EHRPWMPinMuxSetup()
And for specifying the PWM duty cycle for output EPWMxA and/or output EPWMxB and the time at which switching events occur, we use the API’s EHRPWMTLoadCMPA() & EHRPWMTLoadCMPB()

Using the PWM access provided by Starterware, we now add support drivers for Servo motors. Basic speed control for a DC Motor can also be achieved using the ADCs.

We now move to setting up the communication aspects of the library. Here, I plan to add support for SPI, as this enables both two-way and a fast connection mechanism, whose speed and success efficiency is quite satisfactory for major project applications.All the required APIs are listed in the include/spi.h.

After SPI, I move to implement a basic function for connecting to Ethernet. This will help connect the library over internet, and a possible future implementation could be a web-page interacting via an app to the BBB, and we could see outputs of the functions of the library on this page.

After this, we can also include support for Keyboard, mouse (as external clients) in the library.

Part 2: Create Support for AM335X on Energia

We plan to create applications using our library on energia and hence introduce support for a new board (AM335X of the BBB). For this, we will need to add a new Third Party Hardware.

Support for third-party hardware can be added to the hardware directory of the sketchbook directory. We would need to include board definitions (which appear in the board menu), core libraries, bootloaders, and programmer definitions. To achieve this, we first create the hardware directory, then unzip the third-party platform into its own sub-directory.

The end result would be to create a Makefile structure (similar to http://elinux.org/Userspace_Arduino) but for support through Energia. Thus, we would have given a loading functionality for our library.

Part 3: Basic Documentation for Library

The project would also involve creating basic documentation about the HowTos of the library and code samples. I plan to make a github repo for the documentations. This would make the project complete and hence would be extremely helpful for the whole of our community.

The major highlights of this implementation (and How is it useful) are:

Arduino-like: The library will be very easy to understand and use.
Energia support for BBB: As an end result we would have created a successful support structure for BeagleBone Black (AM335) on energia, complete with a loading methodology. And hence, will be pretty useful for BeagleBoard community.
Documentation: Having a git-repo with all the necessary documentations will enhace usability.
Tentative Project Timeline:

Start - May 19

Begin implementation on the decided API structure, finalised after discussion with mentors. Can include design modification along the way.

May 19th - May 25th

Familiarisation with existing tools and code structure based on Starterware.

May 25th - June 5th

Implement GPIO functions for digitalRead/Write, analogRead/Write.

June 6th - June 14th

Implement PWM functions to create Motor support (DC Motor and Servo Motor)

June 15th - June 23rd

Implement core functions for serial communication (SPI). Completed initial design of the library and ready for Mid-term evaluations. Up for reviews and modifications.

June 24th - July 3rd

Make modifications in API and complete the library with functionalities for I/O clients.

July 4th - July 14th

Begin work on MakeFile structure for Energia and add Third Party hardware.

July 15th - July 16th

Get reviews from #userspace-arduino.

July 17th - July 25th

Fixing makefile structure based on reviews, improving code infrastructure.

August 25st - August 10th

Provide documentation for the API so as to enhance usability.

August 18th

Pencils Down!

Please provide feedback :slight_smile:

Hey All,
Copying the Implementation Plan and Timeline of the proposal here.

Motivation for Proposal / Goal:

The goal would be to create a arduino-like library utilizing the BeagleBone
Black and the StarterWare O/S independent library for accessing the
hardware. Without having to access the hardware through an operating system,
developers will be able to fine-tune the system to achieve optimal resource
management of the CPU, peripherals and memory. Then, we would move on to
integrate the library with energia and ultimately provide a booting
mechanism to have support for BeagleBone Black (AM335) on energia. The
project would also include basic documentation and generation of code
samples for various functionality of the library, such as GPIO, SPI, Serial,
Ethernet, etc. This would make the project thorough and ready for use by
various developers in the community.

Sounds good.

Project Deliverables:

A library which would contain basic functions for GPIO, PWMs, Serial
Communication, Ethernet, etc.
Userspace Arduino like MakeFile structure for providing loading facility in
Energia.

Makefile, not MakeFile. This makes me worry you aren't familiar with Makefiles.

By the end, we will have a reliable method to load this library and would
have successfully created support for AM335 in Energia.

Implementation Details:

The implementation can be divided into 3 major parts.

Part 1: Development of Arduino-compatible functions

Here, I plan to develop a library which would utilize the StarterWare
Library for accessing the hardware. To begin with, StarterWare provides
functions for talking to ADCs, GPIOs, etc and would use this to implement
basic functionalities for the GPIO library.

There can be two major ways of using Starterware: using the CCSv5 IDE or via
the GCC Command line. I have chosen to go with GCC so as to improve open
source support for this library. We will use the Linaro toolchain for the
same.

Set-up Requirements for BeagleBone Black are:

The mini USB port (Connector P3) has to be connected to the host. This mini
USB-to-serial connection is used for displaying messages on the serial
console on the host, if the port is properly selected.
A serial terminal application (like Tera Term / HyperTerminal / Minicom)
should be running on the host.
The host serial port is configured at 115200 baud, no parity, 1 stop bit and
no flow control.

I'd like to remove the dependency to have the USB-to-serial connection
in the final code. It is fine to use it for development and understood
that sketches which use Serial functions, but you have to assume
end-users won't have it in most cases. Consider having a USB serial
gadget and sending data across that.

Ethernet port on board connected to a port on the LAN.
A microSD card is required. MMC/SD booting on beaglebone board essentially
means booting via a microSD card.

I don't understand the purpose of the above statement.

These are some of the functions from Startware we will be using for
accessing GPIO:

GPIOModuleEnable()
GPIODirModeSet()
GPIOPinWrite()
Hence, we create the following functions of our library:

analogRead (using ADCs)

analogWrite (using PWM)

digitalRead, digitalWrite (using GPIOs)

How are the above functions 'Hence' from the GPIO access functions?
analogRead at least *must* use the hardware ADCs. analogWrite should
use the hardware PWMs when available for a pin, though supporting all
the pins via software is nice.

This completes the basic functions that are needed for the work ahead.

Next, we need to develop techniques for these host applications to do the
bootload and then establish the USB-serial connection to see output
messages.

k. Just make it clear earlier how the USB-serial adapter is being used
earlier (for development and specific calls to Serial).

The serial gadget wouldn't be used for boot. That is used as part of
the running application.

I plan to use the Linux-USB based boot
(GitHub - ungureanuvladvictor/BBBlfs: Flash your BeagleBone Black via USB ) The host PC would run a
bootloader to remotely bootload the device over usb.

Now moving to advanced functions. The enhanced high resolution PWM (EHRPWM)
is capable of generating complex pulse width waveforms with minimal CPU
overhead.

Some of the useful functions for this are:

PSCModuleControl()
EHRPWMPinMuxSetup()
And for specifying the PWM duty cycle for output EPWMxA and/or output EPWMxB
and the time at which switching events occur, we use the API's
EHRPWMTLoadCMPA() & EHRPWMTLoadCMPB()

Using the PWM access provided by Starterware, we now add support drivers
for Servo motors. Basic speed control for a DC Motor can also be achieved
using the ADCs.

Motor control doesn't use ADCs. This makes me worry if you know what ADCs are.

We now move to setting up the communication aspects of the library. Here, I
plan to add support for SPI, as this enables both two-way and a fast
connection mechanism, whose speed and success efficiency is quite
satisfactory for major project applications.All the required APIs are listed
in the include/spi.h.

After SPI, I move to implement a basic function for connecting to Ethernet.
This will help connect the library over internet, and a possible future
implementation could be a web-page interacting via an app to the BBB, and we
could see outputs of the functions of the library on this page.

After this, we can also include support for Keyboard, mouse (as external
clients) in the library.

Can you put a timeline on all the above milestones? Nevermind, I see it below.

Part 2: Create Support for AM335X on Energia

We plan to create applications using our library on energia and hence
introduce support for a new board (AM335X of the BBB). For this, we will
need to add a new Third Party Hardware.

Support for third-party hardware can be added to the hardware directory of
the sketchbook directory. We would need to include board definitions (which
appear in the board menu), core libraries, bootloaders, and programmer
definitions. To achieve this, we first create the hardware directory, then
unzip the third-party platform into its own sub-directory.

The end result would be to create a Makefile structure (similar to
http://elinux.org/Userspace_Arduino) but for support through Energia. Thus,
we would have given a loading functionality for our library.

I suggest you get early feedback from Robert Wessels
(robertinant (robertinant) · GitHub) on this.

> Hey All,
> Copying the Implementation Plan and Timeline of the proposal here.
>
> Motivation for Proposal / Goal:
>
> The goal would be to create a arduino-like library utilizing the
BeagleBone
> Black and the StarterWare O/S independent library for accessing the
> hardware. Without having to access the hardware through an operating
system,
> developers will be able to fine-tune the system to achieve optimal
resource
> management of the CPU, peripherals and memory. Then, we would move on to
> integrate the library with energia and ultimately provide a booting
> mechanism to have support for BeagleBone Black (AM335) on energia. The
> project would also include basic documentation and generation of code
> samples for various functionality of the library, such as GPIO, SPI,
Serial,
> Ethernet, etc. This would make the project thorough and ready for use by
> various developers in the community.

Sounds good.

>
>
>
> Project Deliverables:
>
>
>
> A library which would contain basic functions for GPIO, PWMs, Serial
> Communication, Ethernet, etc.
> Userspace Arduino like MakeFile structure for providing loading facility
in
> Energia.

Makefile, not MakeFile. This makes me worry you aren't familiar with
Makefiles.

No I meant Makefile, typo.

> By the end, we will have a reliable method to load this library and would
> have successfully created support for AM335 in Energia.
>
>
> Implementation Details:
>
> The implementation can be divided into 3 major parts.
>
> Part 1: Development of Arduino-compatible functions
>
> Here, I plan to develop a library which would utilize the StarterWare
> Library for accessing the hardware. To begin with, StarterWare provides
> functions for talking to ADCs, GPIOs, etc and would use this to implement
> basic functionalities for the GPIO library.
>
> There can be two major ways of using Starterware: using the CCSv5 IDE or
via
> the GCC Command line. I have chosen to go with GCC so as to improve open
> source support for this library. We will use the Linaro toolchain for the
> same.
>
> Set-up Requirements for BeagleBone Black are:
>
> The mini USB port (Connector P3) has to be connected to the host. This
mini
> USB-to-serial connection is used for displaying messages on the serial
> console on the host, if the port is properly selected.
> A serial terminal application (like Tera Term / HyperTerminal / Minicom)
> should be running on the host.
> The host serial port is configured at 115200 baud, no parity, 1 stop bit
and
> no flow control.

I'd like to remove the dependency to have the USB-to-serial connection
in the final code. It is fine to use it for development and understood
that sketches which use Serial functions, but you have to assume
end-users won't have it in most cases. Consider having a USB serial
gadget and sending data across that.

> Ethernet port on board connected to a port on the LAN.
> A microSD card is required. MMC/SD booting on beaglebone board
essentially
> means booting via a microSD card.

I don't understand the purpose of the above statement.

> These are some of the functions from Startware we will be using for
> accessing GPIO:
>
> GPIOModuleEnable()
> GPIODirModeSet()
> GPIOPinWrite()
> Hence, we create the following functions of our library:
>
> analogRead (using ADCs)
>
> analogWrite (using PWM)
>
> digitalRead, digitalWrite (using GPIOs)

How are the above functions 'Hence' from the GPIO access functions?
analogRead at least *must* use the hardware ADCs. analogWrite should
use the hardware PWMs when available for a pin, though supporting all
the pins via software is nice.

>
> This completes the basic functions that are needed for the work ahead.
>
> Next, we need to develop techniques for these host applications to do
the
> bootload and then establish the USB-serial connection to see output
> messages.

k. Just make it clear earlier how the USB-serial adapter is being used
earlier (for development and specific calls to Serial).

Oh yes, I will add the part where we will be using USB-serial adapter for

development purposes.

The serial gadget wouldn't be used for boot. That is used as part of
the running application.

>
> I plan to use the Linux-USB based boot
> (https://github.com/ungureanuvladvictor/BBBlfs ) The host PC would run a
> bootloader to remotely bootload the device over usb.
>
> Now moving to advanced functions. The enhanced high resolution PWM
(EHRPWM)
> is capable of generating complex pulse width waveforms with minimal CPU
> overhead.
>
> Some of the useful functions for this are:
>
> PSCModuleControl()
> EHRPWMPinMuxSetup()
> And for specifying the PWM duty cycle for output EPWMxA and/or output
EPWMxB
> and the time at which switching events occur, we use the API's
> EHRPWMTLoadCMPA() & EHRPWMTLoadCMPB()
>
> Using the PWM access provided by Starterware, we now add support drivers
> for Servo motors. Basic speed control for a DC Motor can also be achieved
> using the ADCs.

Motor control doesn't use ADCs. This makes me worry if you know what ADCs
are.

Please do not take me for such an idiot. I meant giving power (1/0) to the

motor through the pin.

>
> We now move to setting up the communication aspects of the library.
Here, I
> plan to add support for SPI, as this enables both two-way and a fast
> connection mechanism, whose speed and success efficiency is quite
> satisfactory for major project applications.All the required APIs are
listed
> in the include/spi.h.
>
> After SPI, I move to implement a basic function for connecting to
Ethernet.
> This will help connect the library over internet, and a possible future
> implementation could be a web-page interacting via an app to the BBB,
and we
> could see outputs of the functions of the library on this page.
>
> After this, we can also include support for Keyboard, mouse (as external
> clients) in the library.

Can you put a timeline on all the above milestones? Nevermind, I see it
below.

Any comments on the timeline?

>
>
>
> Part 2: Create Support for AM335X on Energia
>
> We plan to create applications using our library on energia and hence
> introduce support for a new board (AM335X of the BBB). For this, we will
> need to add a new Third Party Hardware.
>
> Support for third-party hardware can be added to the hardware directory
of
> the sketchbook directory. We would need to include board definitions
(which
> appear in the board menu), core libraries, bootloaders, and programmer
> definitions. To achieve this, we first create the hardware directory,
then
> unzip the third-party platform into its own sub-directory.
>
> The end result would be to create a Makefile structure (similar to
> http://elinux.org/Userspace_Arduino) but for support through Energia.
Thus,
> we would have given a loading functionality for our library.

I suggest you get early feedback from Robert Wessels
(https://github.com/robertinant) on this.

I didnt find him on the IRC. How do you suggest I do this? I had mailed him
initially, if you remember (I cc'd you too). He has'nt replied.
Though I took the opinion of Alexander Hiam, he seemed pretty confident of
the proposal.

Hey All,
Copying the Implementation Plan and Timeline of the proposal here.

Motivation for Proposal / Goal:

The goal would be to create a arduino-like library utilizing the BeagleBone
Black and the StarterWare O/S independent library for accessing the
hardware. Without having to access the hardware through an operating system,
developers will be able to fine-tune the system to achieve optimal resource
management of the CPU, peripherals and memory. Then, we would move on to
integrate the library with energia and ultimately provide a booting
mechanism to have support for BeagleBone Black (AM335) on energia. The
project would also include basic documentation and generation of code
samples for various functionality of the library, such as GPIO, SPI, Serial,
Ethernet, etc. This would make the project thorough and ready for use by
various developers in the community.

Sounds good.

Project Deliverables:

A library which would contain basic functions for GPIO, PWMs, Serial
Communication, Ethernet, etc.
Userspace Arduino like MakeFile structure for providing loading facility in
Energia.

Makefile, not MakeFile. This makes me worry you aren’t familiar with Makefiles.

No I meant Makefile, typo.

By the end, we will have a reliable method to load this library and would
have successfully created support for AM335 in Energia.

Implementation Details:

The implementation can be divided into 3 major parts.

Part 1: Development of Arduino-compatible functions

Here, I plan to develop a library which would utilize the StarterWare
Library for accessing the hardware. To begin with, StarterWare provides
functions for talking to ADCs, GPIOs, etc and would use this to implement
basic functionalities for the GPIO library.

There can be two major ways of using Starterware: using the CCSv5 IDE or via
the GCC Command line. I have chosen to go with GCC so as to improve open
source support for this library. We will use the Linaro toolchain for the
same.

Set-up Requirements for BeagleBone Black are:

The mini USB port (Connector P3) has to be connected to the host. This mini
USB-to-serial connection is used for displaying messages on the serial
console on the host, if the port is properly selected.
A serial terminal application (like Tera Term / HyperTerminal / Minicom)
should be running on the host.
The host serial port is configured at 115200 baud, no parity, 1 stop bit and
no flow control.

I’d like to remove the dependency to have the USB-to-serial connection
in the final code. It is fine to use it for development and understood
that sketches which use Serial functions, but you have to assume
end-users won’t have it in most cases. Consider having a USB serial
gadget and sending data across that.

Ethernet port on board connected to a port on the LAN.
A microSD card is required. MMC/SD booting on beaglebone board essentially
means booting via a microSD card.

I don’t understand the purpose of the above statement.

These are some of the functions from Startware we will be using for
accessing GPIO:

GPIOModuleEnable()
GPIODirModeSet()
GPIOPinWrite()
Hence, we create the following functions of our library:

analogRead (using ADCs)

analogWrite (using PWM)

digitalRead, digitalWrite (using GPIOs)

How are the above functions ‘Hence’ from the GPIO access functions?
analogRead at least must use the hardware ADCs. analogWrite should
use the hardware PWMs when available for a pin, though supporting all
the pins via software is nice.

This completes the basic functions that are needed for the work ahead.

Next, we need to develop techniques for these host applications to do the
bootload and then establish the USB-serial connection to see output
messages.

k. Just make it clear earlier how the USB-serial adapter is being used
earlier (for development and specific calls to Serial).

Oh yes, I will add the part where we will be using USB-serial adapter for development purposes.

The serial gadget wouldn’t be used for boot. That is used as part of
the running application.

I plan to use the Linux-USB based boot
(https://github.com/ungureanuvladvictor/BBBlfs ) The host PC would run a
bootloader to remotely bootload the device over usb.

Now moving to advanced functions. The enhanced high resolution PWM (EHRPWM)
is capable of generating complex pulse width waveforms with minimal CPU
overhead.

Some of the useful functions for this are:

PSCModuleControl()
EHRPWMPinMuxSetup()
And for specifying the PWM duty cycle for output EPWMxA and/or output EPWMxB
and the time at which switching events occur, we use the API’s
EHRPWMTLoadCMPA() & EHRPWMTLoadCMPB()

Using the PWM access provided by Starterware, we now add support drivers
for Servo motors. Basic speed control for a DC Motor can also be achieved
using the ADCs.

Motor control doesn’t use ADCs. This makes me worry if you know what ADCs are.

Please do not take me for such an idiot. I meant giving power (1/0) to the motor through the pin.

Please DO take me for an idiot, at least in the sense that I like things spelled out for me. Do you mean PWMs instead of ADCs? Do you mean some sort of H-bridge or FET? I still don’t know what you mean by “Basic speed control for a DC Motor can also be achieved by using the ADCs”. There aren’t any on-board DACs, if that is what you meant.

We now move to setting up the communication aspects of the library. Here, I
plan to add support for SPI, as this enables both two-way and a fast
connection mechanism, whose speed and success efficiency is quite
satisfactory for major project applications.All the required APIs are listed
in the include/spi.h.

After SPI, I move to implement a basic function for connecting to Ethernet.
This will help connect the library over internet, and a possible future
implementation could be a web-page interacting via an app to the BBB, and we
could see outputs of the functions of the library on this page.

After this, we can also include support for Keyboard, mouse (as external
clients) in the library.

Can you put a timeline on all the above milestones? Nevermind, I see it below.

Any comments on the timeline?

Only the ones below.

Part 2: Create Support for AM335X on Energia

We plan to create applications using our library on energia and hence
introduce support for a new board (AM335X of the BBB). For this, we will
need to add a new Third Party Hardware.

Support for third-party hardware can be added to the hardware directory of
the sketchbook directory. We would need to include board definitions (which
appear in the board menu), core libraries, bootloaders, and programmer
definitions. To achieve this, we first create the hardware directory, then
unzip the third-party platform into its own sub-directory.

The end result would be to create a Makefile structure (similar to
http://elinux.org/Userspace_Arduino) but for support through Energia. Thus,
we would have given a loading functionality for our library.

I suggest you get early feedback from Robert Wessels
(https://github.com/robertinant) on this.

I didnt find him on the IRC. How do you suggest I do this? I had mailed him initially, if you remember (I cc’d you too). He has’nt replied.
Though I took the opinion of Alexander Hiam, he seemed pretty confident of the proposal.

Not sure. I can try to forward to his TI e-mail address from my TI e-mail address.