GithubHelp home page GithubHelp logo

at-wat / samba Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 3.0 659 KB

Automatically exported from code.google.com/p/samba

License: GNU General Public License v2.0

Makefile 1.95% C 93.76% Assembly 3.24% CMake 1.05%

samba's Introduction

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

samba (SAM-BA) is a SAM Boot Agent for
Atmel AT91SAM microcontrollers.
It is interfaces with SAM-BA firmware in microcontrollers
and allow SRAM and Flash programming, view registers etc.

samba uses sambaflasf programm. sambaflash is a small program
for AT91SAM7 microcontrollers (FirmWare) designed to help
flash programming.
sambaflash provided in sambaflash subdirectory.
The contents of this directory are provided only for reference. There is no
need to compile this application as it is already a part of samba.
See README in the sambaflash subdirectory for detail.

Optional dependency:
	readline: samba commandline supports history if readline is provided

Notes:

samba can communicate with microcontroller over
serial or USB ACM interface. For communicating
over USB ACM interface You need "USB Communications Device Class Driver"
configured in kernel. You can use instruction below to prepare kernel.
This instruction is extracted from Sam_I_Am:
	Copyright 2006 by Andrew Sterian All Rights Reserved.
	http://claymore.engineer.gvsu.edu/~steriana
	mailto: [email protected]
Also You can use patch in the kernel-2.6 subdirectory.

=============================================================================
USB Communications Device Class Driver

The SAM-BA documentation indicates that it configures the AT91SAM7S microcontroller as
a USB Communications Device Class device.
Thus, the Linux acm (for 2.4 kernels) or cdc-acm (for 2.6 kernels) should be usable.
No instructions for the 2.4 kernel acm driver are available yet.
For the 2.6 kernel cdc-acm driver, the driver source code must be patched
and the kernel module recompiled in order to recognize the microcontroller.
The first step is to modify the cdc-acm.c file in the kernel source tree
(e.g., /usr/src/linux-2.6.14.3/drivers/usb/class/cdc-acm.c) to add the
following three lines marked with '+' signs:

{ USB_DEVICE(0x0482, 0x0203), /* KYOCERA AH-K3001V */
      .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
    + { USB_DEVICE(0x03EB, 0x6124), /* Atmel AT91SAM7S microcontrollers (SAM-BA) */
    + .driver_info = NO_UNION_NORMAL,
    + },
      /* control interfaces with various AT-command sets */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,

Next, recompile the kernel and ensure that the cdc-acm driver is compiled as a module.
The new kernel has to be installed and booted. The new kernel module can then be installed with (as root):

	modprobe cdc-acm

When you plug in the microcontroller device, you should be able to communicate with it
using a filename of /dev/usb/acm/0, or /dev/ttyACM0, or other names depending on your distribution.
You can try to find the right name on your system using the same type of command used to find
the usbserial devices from the previous section: 

	find /dev -inum `ls -liR /dev | fgrep "166," | head -1 | sed -e "s/^ *//" | cut -d" " -f1`

The major device number for the cdc-acm module is 166.
If this special file has not been created, you can create it yourself (as root):

	mkdir -p /dev/usb/acm
	chmod -R a+rx /dev/usb
	mknod /dev/usb/acm/0 c 166 0
	mknod /dev/usb/acm/1 c 166 1
	mknod /dev/usb/acm/2 c 166 2
	chmod -R a+rwx /dev/usb/acm

The above allows anyone on the system access to these devices.
You may want to modify your chmod commands for alternative access arrangements if you are running a multi-user system.
=============================================================================

Author: Yury Ovcharenko <[email protected]>

samba's People

Contributors

at-wat avatar seiga-k avatar

Watchers

 avatar  avatar

samba's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.