Tuesday, February 15, 2011

Feb. 15,16 OpenOCD

OpenOCD bat file details
 Created dropbox dir with openocd bat files as backup
 Goal: get openocd working on my laptop
 Status: 
   Trying to change the lab PC openocd bat files so openocd can flash from a fixed location


Questions:
  • Can the arm sectors be unlocked from OpenOCD or just via SAM-BA?
    • yes
      • flash protect 0 0 15 off
  • Can .cfg files on Lab PC be used on Laptop
    • So far - no, but lab pc can be in local directory
    • lab pc is openOCD 3 and Laptop openOCD 4

Bat files examined in detail:
openocd - FLASH.bat
.cfg files will be copied here as backup, but real files used.

Not currently used:
arm-elf-objcopy
-->Copies a binary file, possibly transforming it in the process
Option
--gap-fill               Fill gaps between sections with

Files used:
D:\AA_local\eclipseWork\forte_lms_neu\bin\lms\src\forte 
-- created by ???
D:\AA_local\eclipseWork\forte_lms_neu\bin\lms\src\forte.bin
-- created from forte file

arm-elf-size D:\AA_local\eclipseWork\forte_lms_neu\bin\lms\src\forte
To see size of data downloaded to know if too big for LMS 

openocd.exe

Options:
-v display version
-f flash

C:\openocd\trunk3\src\openocd.exe -v

C:\openocd\trunk3\src\openocd.exe -f C:\openocd\trunk3\testing\examples\SAM7S256Test\prj\SAM7S256_flash.cfg -d2

.cfg files 
Here are the real instructions to open 

Monday, February 14, 2011

Feb. 13,14 Code Review 1

Code Review was done via SkyPe.
The comments have been organized by topics, not time.


cMake compile of hg + 1103 code

[10:37:33 PM] Carolyn Oates: for cmake you copied everything from arch/ecos/lms unchanged into modules'/lms?
[10:37:40 PM] Alois Zoitl: nope
[10:37:51 PM] Alois Zoitl: I moved it to modules/lms/lms_hw
[10:38:04 PM] Alois Zoitl: I thought a little seperation might be nice
[10:38:09 PM] Carolyn Oates: No cmake...txt changes
[10:38:28 PM] Alois Zoitl: yes added subdirectory and added additional cmake.txt there


[11:07:23 PM] Carolyn Oates: lms_main goes in plain lms dir?
[11:11:20 PM] Carolyn Oates: filenames should all be lower case?
[11:11:27 PM] Alois Zoitl: yes and yes
[11:11:46 PM] Carolyn Oates: So I need to rename Buttons to buttons
[11:22:01 PM] Carolyn Oates: Do the .h files need to be listed in the CMakeLists.txt file?
[11:22:30 PM] Alois Zoitl: I'm not sure. However for building distributins afterwards it would be better I gues
[11:27:10 PM] Carolyn Oates: Does your code have #include "../../arch/ecos/lms/buttons.h" in it?
[11:27:38 PM] Alois Zoitl: no changed it to "lms_hw/buttons.h"


2/14 note: avr_ctl, buttons, sensors now start with lowercase letter and end with cpp
 Other files must stay .c files

////
follow the coding rules
10:15:31 PM] Alois Zoitl: How about having a baseclass for all sensor port fbs e.g. CSensorPortFB : public CFunctionBlock{...};
[10:15:43 PM] Alois Zoitl: and put there the port management


[10:26:17 PM] Alois Zoitl: please don't start functions with uppercase letters


////


2/14 note: LED on/off and initialization are ready inline functions in the FB.
Need to change lms_main to use these functions.

[11:44:04 PM] Alois Zoitl: I'll be gone for today. Had a look on the i2c files in ecos they are somewhat different. so we should currently stay with the ones we have.

10:23:46 PM] Carolyn Oates: LMS_LTLED_INIT and LMS_RS485 are init functions
[10:24:06 PM] Carolyn Oates: LMS_LT_LED_ON /OFF are led fns that do something
[10:25:30 PM] Carolyn Oates: The LMS_ functions should go in an LED.h except LMS_RS485... its initialized the Port in general.

[10:26:24 PM] Carolyn Oates: so lms_RsvSensorPort  and LMS_RS485_PORT_INIT() belong together
[10:26:45 PM] Alois Zoitl: there should also be a unrsv function

10:28:58 PM] Alois Zoitl: it is just needed to support the an INIT-
[10:30:42 PM] Alois Zoitl: no it means that you want to deinitialize the FB
[10:30:48 PM] Alois Zoitl: i.e., QI false

[11:39:46 PM] Carolyn Oates: isnt this backwards?
[11:39:48 PM] Carolyn Oates:   if (pa_nInputPortPin < NXT_SENSOR_PORTS_MAX)
    return PORT_NUMBER_UNDEFINED; // Port doesn't exist
[11:40:43 PM] Alois Zoitl: yep



Open Question: 
2/14 latest comment - avr_ctl content is ok.
Anything else in avr code other than sensor code that is:

[10:16:44 PM] Alois Zoitl: currently your separation feels for me not very natural as it seperates things that belong together
[10:16:48 PM] Alois Zoitl: e.g., avr code
[10:16:56 PM] Alois Zoitl: and isolates other stuff




What is the event sent to the application?
[10:35:52 PM] Alois Zoitl: there is the nice clean recsource feature we used in the demo with the students   


[10:55:52 PM] Carolyn Oates: Off the top of your head - any idea what misc.h an miscxx.c are?
[10:58:12 PM] Carolyn Oates: Asked without looking... Having looked I think its Alex's and Dominik's debug via usb print.


[11:05:57 PM] Carolyn Oates: Did you compile with or without boot blinky?
[11:06:18 PM] Alois Zoitl: without but that should't be an issue afik
[11:06:51 PM] Carolyn Oates: Does it compile files not needed?



Friday, February 11, 2011

(Short-term) Future Task (Wishlist)

Very near future: SIGCSE
Before SIGCSE work out what is feasible and what could be a problem:


Racket on KIPR BotBall
- Want to demo to Racket group March 9 
Greenfoot connection to Forte/4DIAC for simulations
- Want to discuss with Greenfoot author
LMS Forte 
- Would like to be able to demo to individuals when asked specfics


March:
[Online access to student statistics for distance learning school]
   
By end of June:
LMS Forte:

- More HW FBs (need larger blocks of time)
  like Tacho motor; Sonar (I2c);
        LCD; Sound on board (if possible)
4DIAC/forte Applications formalization
- Lego Segway
- Line Follower with Timed Events instead of E_DELAY


Summer: 
NXTBee and distributed applications

Feb.11 More Project Notes

Blinky works under hg version with smaller ecos
next:- avr with led, motor and light sensor support.


next steps:
- code review
--- stable version
--- cleaned-up version
--- lab version


Blinky support functions:
- void InitLed(void);
- delay( x)


Fix (must be pushed into hg!!!!!)
Warning about Strings  need in Stringdict.h
to add include:
#include







Feb. 10 Next Step- Boot blinky in new forte

Just project notes today:
Moved into Dropbox folders.


cmake process is repeatable.


Next step move code from summer into project.
Change lmsmain.cpp so boot blinky works


What are .cdl files? eCos related

Tuesday, February 8, 2011

Feb.8 SAM-BA again

For SamBa 2.10 on Vista use  com port LMS connected to with usb to serial driver.
For SamBa 2.9 on XP use Atm6124 TestBoard USB driver
Flashes under Vista now, 
eCos is much smaller .Only flashes 9 sectors now instead of 14 or 15..

Monday, January 31, 2011

Jan.29 hg cMake set-up

Q:\Carolyn\hg4\forte\2010\forte1103WS\FORTE   last good autoconf workspace

Get forte source
  •  First check-out from hg 
    • http://fordiac.hg.sourceforge.net/hgweb/fordiac/forte/
Put forte source under eclipse
  • create WS directory
  • Import into Eclipse the hg clone directory as an existing project 
    • Check copy source into eclipse project (optional)
Copy built ecos under eclipse
  • create directories bin/lms and copy the ecos include and lib directories into it.
  • create bin/lms/src directory


Generate Makefiles using Cmake
  • Install cMake
  • Open cMake Gui 
  • For source directory enter the Eclipse project directory.
  • For build directory, enter the top level binary directory (usually pathto/bin)
  • Configure
    • Press configure button
    • From the dropdown for: Specify the generator for this project
      • Choose: UNIX Makefiles
    • For cross compiler use first 
      • choose toolchain  with UNIX makefiles and press configure

      • Operation System: eCos
      • Compilers for C:     arm-elf-gcc 
        • and for C++:  arm-elf-g++
          • Need to include path if not installed under cygwin
      • path to target  
        • Usually same as path to build binaries
        • This has to be changed when ever workspace / file location changes
    • then
      • clear cache (will not clear the toolchain default)
      • choose options and press configure.
    • enter the text file with the options like below and press configure
INCLUDE(CMakeForceCompiler)

# this one is important
SET(CMAKE_SYSTEM_NAME eCos)

# specify the cross compiler
CMAKE_FORCE_C_COMPILER(arm-elf-gcc GNU)
CMAKE_FORCE_CXX_COMPILER(arm-elf-g++ GNU)

# where is the target environment 
SET(CMAKE_FIND_ROOT_PATH  C:/Users/Carolyn/Desktop/DistCntl/lms/forte012811WS/FORTE/bin/lms)

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)




    • Chose options wanted and press configure
      • Check LMS - (A system must be checked.)
      • Check FBDK, but uncheck IP
      • Check FBs needed (none in example)
      • Uncheck all 3 real data types (not available in LMS)
    • Press generate
    • In Eclipse make all
      • (Note: under cygwin in lms/bin dir - make forte also works)
    • Generate forte.bin separately or as part of flashing bat file
      • arm-elf-objcopy --gap-fill 0xFF -O binary forte.elf forte.bin
        • Notice now .elf  before no extension
    • Ready to flash and test on LMS