Closed kftang closed 6 years ago
I like about half. Extra git commands are good (even better than "git add ." is "git add -A", btw).
I think I prefer the original Error 1 wording (line 194): make sure a Launchpad is connected, then make flash. That seemed more reasonable; is there a particular reason you changed this?
The screen commands: why do you find it beneficial to detach the session? If the most common use case is flash -> uart -> change code -> flash again (at least, most likely for those using this readme), shouldn't it be better to kill the screen session directly, rather than just push it to the background and leave it to be killed later?
So for the error 1 part, originally i did not realize that it was normal to get error 1 after make flash. I tried to change it to be a little more clear that that is normal but I may not have done a good job of that.
As for the screen commands, I think people were getting errors about the uart being busy so if you detach and reconnect, you can avoid those issues.
Another git command: "git add -u" adds all tracked files that have been edited. For screen, I would suggest detailing both options and letting people use what works for them.
Ok. Honestly, I can't figure out a way to make a pull request on a pull request, so here's what I might add:
Rasware is a generic robotics library project for the EK-LM4F120XL Stellaris Launchpad, built on top of StellarisWare. It is intended to be used for UT RAS's Robotathon competition as well as general purpose robotics projects. Authored by the IEEE - Robotics and Automation Society Student Branch at the University of Texas at Austin. For documentation, see Rasware's Github wiki.
Settings -> Collaborators
and add each team member as a collaboratorThe remainder of the instructions will depend on what type of system you're running.
Download a copy of the latest Ubuntu LTS .iso from here:
64-bit: ftp://ftp.utexas.edu/pub/ubuntu-iso/16.04.3/ubuntu-16.04.3-desktop-amd64.iso
32-bit: ftp://ftp.utexas.edu/pub/ubuntu-iso/16.04.3/ubuntu-16.04.3-desktop-i386.iso
Click finish, let the machine install, then log in!
If VMWare complains about VT-x not being enabled, you'll need to go through your BIOS and enable VT-x. There should in instructions in the dialog box.
Player -> Removable Devices -> Luminary Micro ICDI
and select Connect
.Before we do anything else, run this in your terminal if you're running Marericks or newer (macOS 10.9+) and haven't already done this:
xcode-select --install
Install Homebrew: link (Installation instructions are at the bottom of the page.)
Install OpenOCD through Homebrew in a terminal.
brew install openocd
Install the Cross Compiler Toolchain for Embedded ARM Devices through Homebrew as well:
brew cask install gcc-arm-embedded
On macOS devices belong to the wheel
group, so in order to access the devices on your Mac (like the Launchpad) you also need to be part of the wheel
group. Put the following in a terminal to see what groups you're part of:
groups
If wheel
was one of the groups listed, you're good to go and can skip the next step.
If not, add yourself to the wheel
group:
sudo dscl . append /Groups/wheel GroupMembership $(whoami)
These instructions are written for use in a terminal (xterm, gterm, kterm, tty1, etc.) and assume that you have already installed, and are familiar with, your favorite text editor. If you have not found a favorite text editor, I recomend you take a look at Vim, Emacs, and SublimeText3.
sudo pacman -S git base-devel openocd screen arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-newlib
sudo apt-get install git build-essential openocd screen gcc-arm-none-eabi gdb-arm-none-eabi libnewlib-arm-none-eabi
Create a directory to work in. This is where we will place everything.
mkdir ras
cd ras
Use git to clone Rasware, replacing "username" with your Git username in the URL. Make sure you've forked Rasware already! This makes a copy of Rasware on your computer.
git clone https://github.com/username/Rasware.git
Uncompress the file, compile StellarisWare, and move it to /usr/local/lib
.
tar vfx StellarisWare.tar.bz2
cd StellarisWare
make
cd ..
sudo mv StellarisWare /usr/local/lib
rm StellarisWare.tar.bz2
To avoid needing root access to communicate with the lm4f, you will need to copy the lm4f rule to the udev directory.
wget https://raw.githubusercontent.com/ut-ras/Rasware/master/RASLib/51-lm4f.rules
sudo mv 51-lm4f.rules /etc/udev/rules.d
Trigger udev for the new rules to come into effect.
sudo udevadm control --reload
sudo udevadm trigger
Plug in a Stellaris Launchpad. you should now see the file /dev/lm4f
.
Compile RASLib by using the make program.
cd Rasware/RASLib
make
cd ..
cd RASTemplate
make
cd ..
cd RASDemo
make
We have created an example project to demonstrate Rasware running on a Launchpad.
Compile RASDemo.
cd Rasware/RASDemo
make
To flash RASDemo to the board, we use make with different arguments.
make flash
You may get an "Error 1" the first time you run this. This is (for whatever reason) fairly usual. In this case, simply make flash
again. If this doesn't help, next make sure your USB device is connected, powered on, and forwarded to your VM if necessary. If you see "shutdown command invoked," press the reset button. This will start the program on your launchpad. To forward your LaunchPad's USB connection to the VM: In the VM, select Player -> Removable Devices -> Luminary Micro ICDI
and select Connect
.
Else, if at this point an error message is printed that includes "Error erasing flash with vFlashErase packet", run the following command twice and press the board's reset button:
openocd -f $(find /usr -path */scripts/board/*tm4c123* 2>/dev/null) -c init -c halt -c "flash write_image erase RASDemo.out" -c verify_image RASDemo.out -c halt -c shutdown
You should now be able to use make flash
normally until you flash from Keil again. Keil seems to break things. Thank you to Kevin George for this workaround.
If a launchpad is plugged in, it should be accessible at a special file in /dev
(/dev/lm4f
on Linux, /dev/tty.usbmodem[board's serial id]
on macOS - run the detect-board script in the RASLib folder if you're curious). You can use make to create a terminal over UART.
make uart
You should now be presented with the RASDemo menu. Feel free to mess around and look into RASDemo's source code to see how it is done. To exit press C-a k y
, or control-a followed by a k
and y
. Note, however, that if you get some kind of error about the UART being busy, you might instead exit by pressing C-a d
, or control-A followed by a d
. This will detach the LaunchPad's UART from your current console. To get back to the LaunchPad, in your console run screen -r
.
If you don't want to do all of the above steps each time, you can run everything with one command.
make run
However, please note opening the console may give an error if the command was already run before and was detached with C-a d
. If this happens, try running screen -r
in console.
Before you start, you should configure git with both your username and email.
git config --global user.name "User Name"
git config --global user.email "your@email.here"
Git will keep track of any changes to your directory. You can use the status command to show the state of git.
git status
To track a file, you can use the add command.
git add filename
Optionally, to track all files, you can add all using a dot.
git add .
You can now use the commit command to create a commit containing all of the modifications of the files you git add
ed. It will open an editor for writing a commit message. If saved, the commit will be created.
git commit
Optionally, you can place your commit message inline by passing a message parameter.
git commit -m "Commit message"
To move your local changes to the server, use the push command.
git push origin master
OK I changed the error 1 part, added git add -u -A and options for screen.
Good enough; let's put it in!
Detach instead of killing the screen so you can go back to it easily
git add .
for easier addinggit commit -m "message"
for easier commits