Wednesday, June 8, 2011

June Unoffical Open Requests for hg changes

This blog entry is a summary of open "unoffical" requests for forte hg changes, that should not be forgotten because they have a user / developer impact.

Unofficial, because 
  • LMS is only partly in hg
  • The requests only affect usability. Usability issues are low priority.
Request: So wstring and iso flags appear together in the Cmake gui,
it would be nice if FORTE_UNICODE_SUPPORT
was renamed to FORTE_USE_UNICODE_SUPPORT

The following hg updates would be helpful:
1. setup_lms.sh - change the default eCos path to LMSecosDir from """
Reason: If setup_lms.sh is accidently run without changing the path then system lib directory will be copied into bin/lms and must be deleted. Better error is just that the directory doesn't exist.
2.  .cproject with finish_lms make entry- Under the make menu finish_lms needs to added (setup_lms.sh as example). 
3. Add buildsupport/toolchain.txt to hg.
Reason: Have to copy it in each time from somewhere.

June 9 Space for AVR

Last step to complete lms_main is adding a call to init the avr interface.
This requires more lms code be included, which in turn made lms overflow the available memory.

To fit in the LMS:
#1. More in the Exclude FBs list: Added FBs  and forte types that were excluded with working lms forte ver.0.3
Except for WSTRING this was easy looking at the old makefile.am 
Arrays were also turned off.

**This alone saved enough space to fit in the Lego.

Observation:
In the working lms forte v.0.3  with autoconf, the makefiles used flags to turn off the major options it didn't need. BUT used a kind of include FBs list.
Currently forte v0.4 with cmake now uses an exclude FBs list.

#2. Alios added a cMake flag to turn off use of iso values and wstring as a new option for Strings
Request: So wstring and iso flags appear together in the Cmake gui,
it would be nice if FORTE_UNICODE_SUPPORT
was renamed to FORTE_USE_UNICODE_SUPPORT

**This (also) alone saved enough space to fit in the Lego.
    Loader list change: forte_wstring and unicode_utils are now excluded.
    Looking at the size of the object files (.o) for forte data types wstring is one of the largest.

    Bottom Line: Went from using more than 15 sectors down to 14 sectors !

    Next tests: Verify working with OpenOCD
    Next steps: Finish enviroment installs of:
      * eCos driver
      * OpenOCD under Eclipse (needs Yagarto)
    LMS CPP code left to add & test:  FBs

    Current list of forte types and FBs excluded:
    forte_sint forte_dint forte_udint forte_usint forte_dword forte_forte_word forte_byte  forte_struct 
    E_D_FF E_R_TRIG E_MERGE E_DEMUX E_SPLIT E_SR



    Yagarto documentation solved the "unused" libusb driver mystery.
    • This driver is a generic driver for the JLink.
    • Related there are cygwin issues with more recent JLink firmware versions, making using Yagarto, which is not cygwin dependent more interesting.




    Monday, June 6, 2011

    June 7 hg Blinky and environment

    C++ cleaned up version is there, but initially didn't work so adding it to the hg code increments.



    Non-workingTests:
    with avr:  compiles, links, but flash gives memory overflow
    Next: See if more FBs can be added to the exclude FB list.
    Concern: Can exclude unneeded FBs but will need space for LMS FBs / application!

    Working Tests:
    1. hg compiles and see LMS as an eCos device
    2. "blinky" : LED blinks,.but no avr communication
    A. no LMS_DEV started
    B. LMS_DEV started
    status: needed a FB exclude list to be small enough to link with 15 sectors
    3. with clean C++ code lms_main.cpp

    Open question:
    Why did the May 28 hg version only need 10 sectors and June hg needs 15 +sectors?
    Still not clear what caused it not to blink before.

    The following hg updates would be helpful:
    1. setup_lms.sh - change the default eCos path to LMSecosDir from """
    Reason: If setup_lms.sh is accidently run without changing the path then system lib directory will be copied into bin/lms and must be deleted. Better error is just that the directory doesn't exist.
    2.  .cproject with finish_lms make entry- Under the make menu finish_lms needs to added (setup_lms.sh as example). 
    3. Add buildsupport/toolchain.txt to hg.
    Reason: Have to copy it in each time from somewhere.

    (for thought)
    4. finish_lms.sh and .openOCD cfg files may not really belong directly under forte directory, but should also not be lost (since they are in the hg) when a distclean (currently manual) is done by deleting bin/lms/src or as in the past deleting bin/lms. 

    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.