ppt slides


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

ppt slides

  1. 1. 498 Proposals, Sitsang
  2. 2. Proposals <ul><li>The big problems were: </li></ul><ul><ul><li>Perspective </li></ul></ul><ul><ul><ul><li>You know a lot about what you are doing. Don’t assume the reader does too. </li></ul></ul></ul><ul><ul><ul><li>Provide a high-level overview of the system from a technical viewpoint. </li></ul></ul></ul><ul><ul><ul><ul><li>A diagram can be really handy. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Indication of interface can be useful too (CAN or whatever) </li></ul></ul></ul></ul><ul><ul><ul><li>One group had a glossary, not a bad idea. </li></ul></ul></ul><ul><ul><li>Organization </li></ul></ul><ul><ul><ul><li>Have an outline. Make it clear to the reader you have a structure so they can find stuff. </li></ul></ul></ul><ul><ul><ul><li>This is especially true for the executive summary. </li></ul></ul></ul>
  3. 3. Proposal <ul><li>(Problems continued) </li></ul><ul><ul><li>Consistent level of detail </li></ul></ul><ul><ul><ul><li>Lots of detail on some parts with none on others was fairly common. </li></ul></ul></ul><ul><ul><ul><li>More details somewhere is fine, but let the reader know why. </li></ul></ul></ul><ul><ul><li>Writing </li></ul></ul><ul><ul><ul><li>Keep the sentence structure simple. </li></ul></ul></ul><ul><ul><ul><li>Do a good job proof-reading. </li></ul></ul></ul><ul><ul><ul><li>Use consistant terms </li></ul></ul></ul><ul><ul><ul><ul><li>Eg. It is either a “system” or a “subsystem” </li></ul></ul></ul></ul><ul><ul><li>Executive Summaries </li></ul></ul><ul><ul><ul><li>Often missed major points. </li></ul></ul></ul><ul><ul><ul><li>Make a list of the 3-5 things you want to get across and be sure you do that. </li></ul></ul></ul><ul><ul><ul><li>Be organized here. Depending on the nature of the proposal no one may read past this if it sucks. </li></ul></ul></ul>
  4. 4. Proposal <ul><li>Good stuff </li></ul><ul><ul><li>2 groups covered information in a level of detail that I could understand their projects well. </li></ul></ul><ul><ul><ul><li>Other group never gave me a high-level picture. </li></ul></ul></ul><ul><ul><li>2 groups had good solid technical writing </li></ul></ul><ul><ul><ul><li>Other had complex sentence structure and related grammar errors. </li></ul></ul></ul>
  5. 5. Project Deadlines <ul><li>10/10 </li></ul><ul><ul><li>Today </li></ul></ul><ul><li>10/19 </li></ul><ul><ul><li>Milestone 1 </li></ul></ul><ul><ul><ul><li>All “proof of concept” stuff done. You should have all of your hardware. </li></ul></ul></ul><ul><li>11/9 </li></ul><ul><ul><li>Milestone 2 </li></ul></ul><ul><ul><ul><li>Project should be working on the breadboard. Maybe a few glitches or additional features to add </li></ul></ul></ul><ul><li>12/5 </li></ul><ul><ul><li>Formal Demo to class (suit, tie etc.) </li></ul></ul><ul><li>12/7 </li></ul><ul><ul><li>Design expo </li></ul></ul><ul><li>12/12 </li></ul><ul><ul><li>Project report </li></ul></ul>
  6. 6. Sitsang <ul><li>Admin </li></ul><ul><ul><li>Lab will be up by Thursday night. </li></ul></ul><ul><ul><li>Will be due by Nov 14 th </li></ul></ul><ul><ul><li>Second lab will be due by Dec 1 st , up by Oct 24 th </li></ul></ul>
  7. 7. Sitsang: What is it? <ul><li>It is a StrongARM based board with tons of I/O (Ethernet, USB, joystick, buttons, accelerometer, color touch-screen LCD, Flash memory, CF socket, etc.) </li></ul><ul><li>It runs Linux by default. </li></ul><ul><li>It comes with qpe as the windowing enviornment. </li></ul>
  8. 8. Sitsang: What will we do with it? <ul><li>We’ll have you: </li></ul><ul><ul><li>Install a bootloader </li></ul></ul><ul><ul><li>Install a file system (to flash) </li></ul></ul><ul><ul><li>Install an OS (to flash) </li></ul></ul><ul><ul><li>Write programs that directly use the Unix device interface </li></ul></ul><ul><ul><ul><li>Frame buffer, LCD backlight, accelerometer. </li></ul></ul></ul><ul><ul><li>Modify the OS drivers </li></ul></ul><ul><ul><ul><li>Lab 2, will involve changing the OS. </li></ul></ul></ul>
  9. 9. Issues for lab 1 <ul><li>Protocols, wires and more </li></ul><ul><ul><li>There are two bootloaders for the board </li></ul></ul><ul><ul><ul><li>Redboot is simple, works, and what comes with the board. </li></ul></ul></ul><ul><ul><ul><li>Uboot is more complex and powerful, but doesn’t work entirely. </li></ul></ul></ul><ul><ul><ul><ul><li>There is a lab 0 you can look at if you want to mess with the bootloader. </li></ul></ul></ul></ul><ul><ul><li>We will simply install the pre-built Redboot bootloader. </li></ul></ul><ul><ul><ul><li>You use a program called Jflash (from Intel) over a parallel port to JTAG interface. </li></ul></ul></ul><ul><ul><ul><li>Not fast. </li></ul></ul></ul>
  10. 10. Bootloader <ul><li>Once you have the bootloader installed you can talk to it via a serial interface </li></ul><ul><ul><li>Again to JTAG. </li></ul></ul><ul><ul><li>Still not fast, but good enough for command-line interface. </li></ul></ul><ul><li>Works just like any other command line interface </li></ul>
  11. 11. Redboot commands <ul><li>fconfig </li></ul><ul><ul><li>Prompts you for information like </li></ul></ul><ul><ul><ul><li>Bootscript </li></ul></ul></ul><ul><ul><ul><li>Local and server IP address </li></ul></ul></ul><ul><ul><ul><li>GDB connection port </li></ul></ul></ul><ul><ul><ul><ul><li>For doing remote debugging </li></ul></ul></ul></ul><ul><ul><ul><li>Etc. </li></ul></ul></ul>
  12. 12. Redboot commands: load <ul><li>Copies into SDRAM from over the network. </li></ul><ul><ul><li>load [-r] [-v] [-h <host>] [-m <tftp|xmodem|ymodem>] [-b <base address>] <file name> </li></ul></ul><ul><ul><li>-r indicates raw data (not sure what no –r would be!) </li></ul></ul><ul><ul><li>-m specifies protocol </li></ul></ul><ul><ul><li>-b where to start putting it </li></ul></ul><ul><ul><li><file name> what file to get </li></ul></ul><ul><ul><li>-h specifies host to get it from. </li></ul></ul><ul><ul><ul><li>Uses fconfig host by default. </li></ul></ul></ul>
  13. 13. Redboot commands: load (continued) <ul><li>We use tftp (trivial file transfer protocol). </li></ul><ul><ul><li>CAEN doesn’t support this, so we have our own linux machine serving the needed files. </li></ul></ul><ul><ul><li>You CAN upload to our server too. </li></ul></ul><ul><ul><ul><li>Of course, CAEN doesn’t support a client either… </li></ul></ul></ul><ul><li>The Sitsang seems to have problems with our network. </li></ul><ul><ul><li>It _often_ drops the transfer. I had to try a fair number of times to get it to work. </li></ul></ul><ul><ul><li>-v gives you a good hint if things are going to work or not. </li></ul></ul><ul><ul><li>Found changing ports helped oddly. </li></ul></ul>
  14. 14. Redboot comands: fis commands <ul><li>Init </li></ul><ul><ul><li>put flash into an initialized state </li></ul></ul><ul><li>List </li></ul><ul><ul><li>display current usage of flash </li></ul></ul><ul><li>Unlock </li></ul><ul><ul><li>unlock a section of flash memory </li></ul></ul><ul><li>Erase </li></ul><ul><ul><li>erase a section of flash memory </li></ul></ul><ul><li>Create </li></ul><ul><ul><li>create a new section in flash memory </li></ul></ul><ul><li>Load </li></ul><ul><ul><li>load a section of flash memory into SDRAM </li></ul></ul><ul><li>Go </li></ul><ul><ul><li>Jump to a specific address to continue execution </li></ul></ul>
  15. 15. Redboot commands: fis command arguments <ul><li>Many of the sub-commands use the same flags. Common flags are listed below: </li></ul><ul><ul><li>-b </li></ul></ul><ul><ul><ul><li>Specify an address in SDRAM </li></ul></ul></ul><ul><ul><li>-f </li></ul></ul><ul><ul><ul><li>Specify a flash memory address </li></ul></ul></ul><ul><ul><li>-l </li></ul></ul><ul><ul><ul><li>Length of data to modify </li></ul></ul></ul><ul><li>Many of the fis commands are really slow (hey, you’re talking to flash!) </li></ul>
  16. 16. Examples: <ul><li>fis unlock -l 0x02800000 -f 0x00200000 </li></ul><ul><ul><li>Unlock 0x200000 bytes of memory </li></ul></ul><ul><ul><li>Takes a while (1 minute?) </li></ul></ul><ul><li>fis create JFFS2 -b 0xa0200000 -l 0x02800000 -f 0x00200000 </li></ul><ul><ul><li>Copy 0x200000 bytes of memory into flash </li></ul></ul><ul><ul><li>Takes a long while. </li></ul></ul>
  17. 17. You will… <ul><li>Need to use the bootloader to </li></ul><ul><ul><li>Download the file system & kernel </li></ul></ul><ul><ul><ul><li>“ load” using tftp </li></ul></ul></ul><ul><ul><li>Write them to flash </li></ul></ul><ul><ul><ul><li>Via the fis commands </li></ul></ul></ul><ul><ul><li>Start linux </li></ul></ul><ul><ul><ul><li>The first time this takes a LONG time. </li></ul></ul></ul><ul><ul><ul><li>Just wait. </li></ul></ul></ul>
  18. 18. So you’ve got linux… <ul><li>Now we can start the real part of the lab. </li></ul><ul><ul><li>It is helpful to do the previous stuff because: </li></ul></ul><ul><ul><ul><li>It removes some of the magic </li></ul></ul></ul><ul><ul><ul><li>If you need to change the file system or (more likely) linux you can. </li></ul></ul></ul><ul><ul><ul><li>You have a slightly better understanding as to what’s going on. </li></ul></ul></ul><ul><ul><li>We want to finish writing a simple game. </li></ul></ul><ul><ul><ul><li>Uses the accelerometer as input </li></ul></ul></ul><ul><ul><ul><li>Plays game on the board. </li></ul></ul></ul><ul><ul><ul><li>We provide a working version so you can see what it is to do. </li></ul></ul></ul>
  19. 19. Linux devices <ul><li>/dev/**** contains a bunch of devices on any linux system. </li></ul><ul><ul><li>/dev/ttyS0 is the serial port, etc. </li></ul></ul><ul><li>In general when you read from a device it supplies you with a bunch of data. </li></ul><ul><ul><li>For example, our accelerometer will dump an X and a Y value, each 32 bits. So you get 64 bits. </li></ul></ul><ul><ul><li>You can open the file for reading and grab stuff that way. </li></ul></ul><ul><ul><ul><li>Ideally you dump it into a data structure you can deal with. </li></ul></ul></ul>
  20. 20. <ul><li>#include<stdio.h> </li></ul><ul><li>#include<fcntl.h> </li></ul><ul><li>main(int argc, char * argv[]) </li></ul><ul><li>{ </li></ul><ul><li>int i=0; </li></ul><ul><li>struct me { </li></ul><ul><li>unsigned int x; </li></ul><ul><li>unsigned int y; </li></ul><ul><li>} tmp; </li></ul><ul><li>int fd; </li></ul><ul><li>fd=open(&quot;/dev/acce&quot;, O_RDONLY); </li></ul><ul><li>read(fd, &tmp, sizeof(struct me)); </li></ul><ul><li>printf(&quot;X=%u, Y=%u &quot;,tmp.x, tmp.y); </li></ul><ul><li>close(fd); //close device file </li></ul><ul><li>} </li></ul>
  21. 21. But it gets worse. <ul><li>Sometimes you have to deal with VERY complex data structures. </li></ul>
  22. 22. <ul><li>#include<linux/fb.h> </li></ul><ul><li>#include<fcntl.h> </li></ul><ul><li>#include<stropts.h> </li></ul><ul><li>#include<sys/ioctl.h> </li></ul><ul><li>#include<stdio.h> </li></ul><ul><li>main() </li></ul><ul><li>{ </li></ul><ul><li>struct fb_fix_screeninfo fb_f; </li></ul><ul><li> if( ioctl (fb,FBIOGET_FSCREENINFO,&fb_f) <0) </li></ul><ul><li>{ </li></ul><ul><li>printf (&quot;OPPS: No fixed screen info &quot;); </li></ul><ul><li>exit(1); </li></ul><ul><li>} </li></ul><ul><li>printf (&quot;ID String: %s &quot;,fb_f.id); </li></ul><ul><li>printf (&quot; Length of frame buffer mem </li></ul><ul><li>%u &quot;,fb_f.smem_len); </li></ul><ul><li>... </li></ul>
  23. 23. Figuring this stuff out is hard <ul><li>You need to find the right include file </li></ul><ul><ul><li>There is also often documentation somewhere. </li></ul></ul><ul><li>For the frame buffer, you need a way to read and write the memory </li></ul><ul><ul><li>We use a function called mmap. </li></ul></ul><ul><ul><li>It basically lets you have access to certain I/O registers (big ones for fb). </li></ul></ul><ul><ul><li>Handles all of the timing and related magic for you. </li></ul></ul>