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

    Monday, February 28, 2011

    Feb.28 Debugger notes

    [again: just dev notes]
    Goal: Get at least 1 (gdb with ARM7) debugger working on laptop
    Sideline: Flashing LMS


    OpenOCD is what has been used. Looking for something easier to install and perhaps better
    • OpenOCD
      • used on lab PC ver.0.3 with patch (compiled) 
      • However neither 0.3 with patch (both compiled and from lab PC) nor 0.4 (installed) work
        • Possibly cygwin component not installed, but so far no clear documentation to check
        • Have not found any .cfg command documentation.
          • TCL in .cfg files may have changed between 0.3 and 0.4
    • Segger

    SEGGER J-Link Commander V4.22c ('?' for help)
    Compiled Jan 18 2011 11:40:21
    Updating firmware:  J-Link ARM V8 compiled Dec 16 2010 20:21:29
    Replacing firmware: J-Link ARM V8 compiled Dec  1 2009 11:42:48
    Waiting for new firmware to boot
    New firmware booted successfully
    DLL version V4.22c, compiled Jan 18 2011 11:40:08
    Firmware: J-Link ARM V8 compiled Dec 16 2010 20:21:29
    Hardware: V8.00
    S/N: 268000496
    OEM: SEGGER-EDU
    Feature(s): FlashBP, GDB
    J-Link>


    Options to Flash LMS HW:

    • SAM-BA v2.10_cdc (works Lab PC (XP) & laptop (Vista))
    • OpenOCD with flash cfg (works Lab PC (XP))
    • Segger J-Flash


    Wednesday, February 23, 2011

    Feb. 23 Notes before flying

    Blog is back to a place to keep notes
    C:\Users\Carolyn\Dropbox\LMS\LMS  has the code review cleaned up code


    be sure have the right working small eCos!! 
    Backed up:


    Lab PC:
    working off of G: = my usbstick
    G:\BootBlinkyTests\BootBlinkyTests\hgforte0216_blinkyWS24
    Test 1: Blinky (again)
    G:\BootBlinkyTests\BootBlinkyTests\
    [manual clean deletes everything in bin\lms except ecos dirs (lib & include) and leave an empty src dir.
    src
    ws24
    openocd bat
    - flash fast works
    - openocd works
    - cd to dir with forte.elf and forte.bin works
    - arm-elf-insight forte.elf
    (remember for target chose: choose Remote/TCP)
     connect to target
     monitor reset;  monitor halt
    set breakpoints
    WORKS


    ....................
    Laptop:
    working off of F: = my usbstick
    F:\BootBlinkyTests\BootBlinkyTests\hgforte0216_blinkyWS24L

    Friday, February 18, 2011

    Feb.18 OpenOCD on Laptop


    This is just in notes form. (Formatted later when works here or in another entry.)
    2/23 Update 1:
    If path is set correctly, then trunk3 version of openocd appears to work.
    Need to test with JTAG installed.


    Additionally reinstalled cygwin with additional development tools.

    2/22
    In http://forum.sparkfun.com/ many have same error and no replies:  
    Command handler execution failed.   
    Seems like a catch all error message. Turning on debug did help see where its failing, but it fails at the 3rd line so not much help.


    So tried IRCchat channel... Yes the .cfg commands changed between 0.3 and 0.4(which had started doing, but nothing that helped so far.)
    So I will try and compile the trunk3 source code and see if that works... and look at /read up on 0.4 while it compiles.



    Also looking at the debug output from trunk3 on lab PC may help to see where the changes occur.


    2/18
    Just copying Openocd files over to laptop didn't work
    Installed openOCD 4

    Currently trying to get the .cfg files to work correctly.
    Just using v.3 (+jtag patch)  copied into a directory does not work.
    And meant openOCD 4 had to be reinstalled.
    Example .cfg files are only in git.

    "Warning: You must install OpenOCD first before connecting your USB JTAG adapter to the PC."

    I hope that means connecting not installing the JTAG.
    [reinstalled (again) with JTAG unplugged]


    Hope this JTAG bug does not affect JLINK, too.
    https://sourceforge.net/apps/trac/openocd/ticket/31


    Differences between Trunk3 0.3+patch(built) and 0.4(installed)
    Directories Trunk3 has but installed v4 doesn't:

    • Trunk3 built (3.0+patch):   
      • autom4te.cache; 
      • contrib; 
      • doc; 
      • ecosflash; 
      • src; 
      • tcl; 
      • testing; (has .cfg files  in subdirs)
      • tools;

    Copied into 4.0 (from Trunk3): testing; tcl

    • Program files installed (4.0) but not in Trunk3:
      • bin; 
      • board;  (has .cfg files)
      • drivers; 
      • interface; (has .cfg files)
      • source; 
      • target; (has .cfg files)






    Tuesday, February 15, 2011

    Feb.15,16 Testing env notes

    cMake via gui does not seem consistent
    • The same configuration seems to work sometimes and not others.
    • Need to find what pattern will set all the variables corrently.
    • In the meantime can change manually to the values in the screenshot from the cMake instructions in Jan. blog entry
    cMake ECOS_SYSTEM_TARGET_LIBRARY
    Should it be:
    just the directory lms/bin/lib
    or lms/bin/lib



    LMS Flashing via OpenOCD:
    Pattern when get error during flash process :
    Cause of error: trying to change .cfg and forte.bin locations and didn't get it right.
    • When openOCD-flash.bat gets an error 
      • the sectors seem to have been locked somehow 
      • and must be unlocked via SAM-BA
    • The jtag lost connection once - pattern that caused it is not clear
    • The device is no longer recognized by windows at all... have to go into boot mode again.
    Question: Is there a way in OpenOCD to unlock the sectors everytime?

    Using Eclipse with Dropbox files:

    If files are shared on multiple computers - slow due to syncing.
    In Eclipse the filenames have an extra dropbox unknown to Windows and make has problems.