Wednesday, June 1, 2011

June 1 Blinky

The blog is being neglected in favor of:
  • a local wiki for an organized how-to
  • dropbox for sharing
  • more concentration the diditacs
Main ideas, test results and status will still be published here.
My Netbook is back, but laptop died completely. Thankfully due to Dropbox no files have been lost. So setting up and redoing tests with current hg.

Made the mistake of agreeing to get my own id, when the original id owner came back. The copying of files means much of the  lab PC enviroment has to be reinstalled.

Current hg lms does not compile.  Minimum updates were passed on in early May, but not put in hg yet.

Feb.16 version still blinks nicely, but the same lms_main.c used with the current forte hg, does not. It is recognized as an eCos device by windows after being flashed.

It has been strongly suggested that making certain cMake variables smaller would fix this, but this quick pat answer can't true (even if it did get some to laugh).

Because:
  • If the compiled source is too large then an .elf  file is not created
  • All the forte files are smaller in the May version
Making all cMake parameters smaller to save space will be a help with applications:
Keeping them initially the same repeated the Feb. test case.
Feb.16 forte blinks with the following:
FORTE_CommunicationInterruptQueueSize  = 1
FORTE_EventChainEventListSize = 16
FORTE_EventChainExteranlEvenListSize = 5
FORTE_IPlayerRecvBufferSize = 256
FORTE_STRINGDICTINITIALMAXNROFSTRINGS = 120
FORTE_STRINGDICTINITIAL = 1000

Wednesday, May 11, 2011

May 11 Back to Dev Env / Testing

At about this time my new Netbook Disk Drive got a problem.... so started over about 5/28

Again need to document current test environment that works.

After move to CMake (see Jan.29 hg cMake set-up)

Using GNUARM 4.1.1 in C:\GNUARM4_1_1





Testing on Laptop using Lab PC to double-check.

0.  Is the LMS seen right (=right device drivers found)? OK

  • As HW bootable device (=firmware update)
    • to be flashed with forte.bin or lego system or lejos or other firmware options.
  • As eCos device 
    • ready to test 
    • ready to send/ run a 61499 application via forte


1. Flashing the LMS firmware



  • Via Samba v2.10_cdc  - OK
    • notice with v2.10 LMS shows up as a com port and under device driver Ports no longer under Universal Serial Ports
    • Step summary: unlock, don't lock. If worked at all will be seen as eCos device now
  • Via OpenOCD
    • TODO: Need .cfg files . Must edit to match installed files <-- HERE
2. Test

  • Blinky
    • observe  (HERE - NOT Blinking ??? eCos copy? -O2 vs -O0? etc.)
    • check via OpenOCD
      • To test with OpenOCD must be compiled with -O0 not -O2, but this makes the code larger
      • Compiling with -O0 to prepare for OpenOCD testing gets a link problem that it is too large (-O2 links)!!!    CHECK eCos VERSION using
  • AVR
    • via OpenOCD check for:
      • sensor inputs
      • motor status
      • button status
  • IEC61499 Applications
    • 1 LED
    • multiple LEDs
    • sensor input
    • motors on/off












May 10 Code Clean-up / Design updates

LMS code is moving up from forte with exporter ver. 3 to ver. 4
Additionally the code is being cleaned-up from c code that works to c++ code in forte.
A set-


LMS is no longer in arch/ecos directory but in its own directory with other FBs under modules:
  • src/modules/lms: FBs and device interface code
    • open: where does platform_i2c.c /.h go?
  • src/modules/lms/lms_hw: has ecos and hw interface code
  • src/modules/lms/lms_ecos : lms ecos specific
Here is a working draft UML class diagram with design / transformation to C++
The avr controller and port manager are not yet LMS_DEV class member.
If only 1 instance of a class was currently wanted, all methods were made static.












Tuesday, May 10, 2011

May 10 Code Clean-up / Design updates

LMS code is moving up from forte with exporter ver. 3 to ver. 4

Additionally the code is being cleaned-up from c code that works to c++ code in forte.





Two shells scripts were created to take of pre- and post- build (make all)  tasks:



  • setup_lms.sh 
    • allocates bin/lms and bin/lms/src
    • copies lms ecos include and lib directories in bin directory
  • finish_lms.sh 
    • creates forte.bin






LMS is no longer in arch/ecos directory but in its own directory with other FBs under modules:

  • src/modules/lms: FBs and device interface code
    • open: where does platform_i2c.c /.h go?
  • src/modules/lms/lms_hw: has ecos and hw interface code
  • src/modules/lms/lms_ecos : lms ecos specific
Here is a working draft UML class diagram with design / transformation to C++

The avr controller and port manager are not yet LMS_DEV class member.
If only 1 instance of a class was currently wanted, all methods were made static.
























Tuesday, April 26, 2011

Apr.25 Status: LMS upgrade to FORTE 4 export

Goal: LMS FBs under Forte ide and rte with ver.4 FB exporter / most current versions.
  • Need a good 4diac-ide with current ver.4 FB exporter
  • Converting the LMS FBs that worked under ver.3 FB exporter to current versions
    • LMS HW interface code (avr, etc) 
      • change from c to c++ for LMS HW interface code
        • convert #define s 
        • sensor classes
    • forte code standards
4diac-ide: Need to get good version with version 4 exporter
Open Question: There were hand changes to LMS code in hg repository.
Is there a working 4diac-ide whose FB exporter will include these changes?


FB (hand) changes:
  • type names 
  • QI /QO now QI( ) and QO( )
  • others unknown???

Since recently laptops and netbooks work and stop working fairly often (so they don't get lost)
here is the (detailed) current list of open code items:

1.
Warning ..\src\modules\lms\lms_ecos  has no CMakeLists.txt
Impact: No make all created by CMake configure and generate
Work-around: Created a do nothing ..\src\modules\lms\lms_ecos\CMakeLists.txt file
HG? wait for now. Discuss because will need a CMakelists.txt in this directory


2.
Error: cannot find LMS FBs because they are not there yet.
Impact: make all fails quickly
Work-around: Commented out LMS FBs in ..\src\modules\lms\lms_ecos\CMakeLists.txt
specifically:
# forte_add_sourcefile_hcpp(LED LT M_PWR OFF SOUND TOUCH)
HG? wait for now since they will be added


3.
Error: cc1plus: error: unrecognized command line option "-fno-threadsafe-statics"
Impact: make all fails quickly
Work-around: delete -fno-threadsafe-statics from forte_add_definition( with the compile/link options
HG?  Ask (why is it there) but think option needs to be deleted or a specific arm-elf is needed.
     Its in the Feb version that worked - so why is it a problem now?


4.
Warning:
[0m[ 57%] [32mBuilding CXX object src/CMakeFiles/forte.dir/arch/ecos/ecostiha.cpp.o
C:/Users/Carolyn/Desktop/DistCntl/forteLMS_04a/src/arch/ecos/ecostiha.cpp:47: warning: unused parameter 'pa_nPriority'
C:/Users/Carolyn/Desktop/DistCntl/forteLMS_04a/src/arch/ecos/ecostiha.h:47: warning: unused parameter 'alarm'
C:/Users/Carolyn/Desktop/DistCntl/forteLMS_04a/src/arch/ecos/ecostiha.h:47: warning: unused parameter 'data'
Impact: Hope none - POSIX also gets this
HG? - n/a


5.
Warning:
[0m[ 59%] [32mBuilding CXX object src/CMakeFiles/forte.dir/modules/lms/lmsmain.cpp.o
In file included from C:/Users/Carolyn/Desktop/DistCntl/forteLMS_04a/src/modules/lms/lmsmain.cpp:23:
C:/Users/Carolyn/Desktop/DistCntl/forteLMS_04a/src/modules/lms/../../arch/ecos/ecoscppinit.cpp:33: warning: missing initializer for member `__tm::__tm_isdst'
C:/Users/Carolyn/Desktop/DistCntl/forteLMS_04a/src/modules/lms/../../arch/ecos/ecoscppinit.cpp:33: warning: missing initializer for member `_reent::_atexit'
C:/Users/Carolyn/Desktop/DistCntl/forteLMS_04a/src/modules/lms/../../arch/ecos/ecoscppinit.cpp:33: warning: missing initializer for member `_reent::_atexit0'
C:/Users/Carolyn/Desktop/DistCntl/forteLMS_04a/src/modules/lms/../../arch/ecos/ecoscppinit.cpp:33: warning: missing initializer for member `_reent::_sig_func'
C:/Users/Carolyn/Desktop/DistCntl/forteLMS_04a/src/modules/lms/../../arch/ecos/ecoscppinit.cpp:33: warning: missing initializer for member `_reent::__sglue'
C:/Users/Carolyn/Desktop/DistCntl/forteLMS_04a/src/modules/lms/../../arch/ecos/ecoscppinit.cpp:33: warning: missing initializer for member `_reent::__sf'
Impact: Need to evaluate after including current lmsmain code
HG? not now




Current workspace:
LT C:\Users\Carolyn\Desktop\DistCntl\forteLMS_04a\aforteLMS_04aWS

Monday, April 25, 2011

Apr.16, 25 Plan; Progress

Would be nice to for some of LMS FBs to be in fordiac 1.0.
Specifically:  LED; LT; M_PWR; OFF; SOUND; TOUCH;
that worked under Forte 3.0+, but not yet under 4.0

In summer and/or in WS11 we can test out the tutorials at the latest.

Plan
1. fordiac posix and lms running
   Want both so if lms doesnt work I know if its forte in general or not - easier to know where to look.
   Will have lms setup sh for cmake - Any chance it can be checked in?
   I'm in the middle of this one. Everything seems fine.
Status: 4/16 both compile in the same workspace
CMake :
° Posix set-up worked as is.  
° LMS using CMake GUI needed lms path entered, but works
° Open: Should setup shell scripts or cmake toolchain file?
    2. Get the LMS HW FB working again under current fordiac.
       There have been lots of updates in March so expect it to work and if not will see if it work in Posix and check forte code.
       This should be checked in after another code review (when you get back)

    3. LMS motor by degrees FB
       LMS Sonar FB (I2C)


    In parallel:
    List of exercises to be used by the tutorials.
    The execises can be used a part of tutorials, alone, or abandoned.
    * What is your current first intro for students?

    Current Workspace location
    C:\Users\Carolyn\Desktop\DistCntl\forteLMS_04a


    Note: Netbook Harddrive problems - all lost - sent back for repair.
    D:\DistCntl\forte\forteLMS\src\modules\lms\CMakeLists.txt
    D:\DistCntl\forte\fortePOSIX\src\modules\lms\CMakeLists.txt
    D:\DistCntl\forte\forteLMS\src\modules\lms\CMakeLists.txt

    Feb: backup Workspace location:
    E:\Backups\Feb28\Dropbox\LMSwork\CodeCleanUpVersions\forte0216BlinkyAVR\src\modules\lms
    clone to:
    D:\,,,Feb

    Tuesday, March 1, 2011

    Mar.1 eCos related errors and causes

    [again: just dev notes]
    Found that using GNU 3.4 with current CYGWIN seems to work best.
    Error:
    /cygdrive/c/Local/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld: address 0x1402a0 of forte.elf section .rodata is not within region rom
    Cause:
    using large older LMS eCos


    Error:

    collect2: ld returned 1 exit status
    CMakeFiles/forte.dir/core/stringdict.cpp.o: In function `CStringDictionary::getInstance()':
    C:/Users/Carolyn/dev/DistCtl/fordiacWk/lms4/src/core/stringdict.cpp:16: undefined reference to `atexit'
    Cause:
    wrong eCos