Skip to content

Eclipse IDE:A Workaround To Include a Link Folder

On my development host, I have an pretty old Eclipse IDE, version 3.7.2.

I am trying to import a folder as ‘link folder’ into a project. This target folder will be include in multiple projects uner Eclipse.  A link folder is better suit so that any modification on target folder(files) is only require to be perform once and it will reflect to all relevant projects.

A typical link folder would shown with a small arrow icon as shown below. Folder name Database, define, device would be the link folder. While Debug is not a link folder

LinkFolder

If we perform a right click on ‘define’ folder and select properties, resources, we would see the following:

LinkFolderResource

Above shown it is the a link folder and the location is respective with a symbol of PROJECT_LOC. Use of PROJECT_LOC would enable create a project that is independant of project location in file system. When we want to move the project to another location in the file system, we just need to change this PROJECT_LOC to resolve to the correct path.

In attempt to create a link folder, I use ‘New‘ -> ‘Folder‘ -> ‘Advanced‘ -> ‘Link to alternate location (Linked Folder)‘ -> ‘PROJECT_LOC/../define‘.

This give an error of : “Internal error: Must specify a URI scheme:define

I ended up create a workaround as below:

  1. Create a link folder with fix path
    1. New‘ -> ‘Folder‘ -> ‘Advanced‘ -> ‘Link to alternate location (Linked Folder)‘ -> ‘Browse‘ -> Select the target folder
  2. Change the link folder from dependant path to independant path
    1. Right click on link folder -> ‘Properties‘ -> ‘Resources‘ -> ‘Edit‘ -> Replace with ‘PROJECT_LOC/../define’

With above sequence, Eclipse will be able to find the headers file inside ‘define’ folder

 

Browsing Source Code Efficiently in Vim: ctags

I have been using vim for my development for several years. All these while I am settle with my F4 custom function, which will perform recursive search of the source code for a particular symbol, as shown below:

map <F4> :execute “vimgrep /” . expand(“<cword>”) . “/j **/*.c **/*.C **/*.h **/*.H” <Bar> cw<CR>

It works well and I have never further explore for better tools. Until recently there is a need for search of large source code. That’s where I bump into ctags. Ctags will preindex all the symbol. When using it to ‘jump’ to function definition is instant. Founding about this is like one of those moment I told myself – I should have know about this long time ago.

Quick setup of ctags

  1. Package install in ubuntu
    1. apt-get install exuberant-ctags
  2. ‘cd’ to source folder and perform indexing. A file name ‘tags’ will be generated end of this command
    1. ctags -R *
  3. Open any source file, for example
    1. vi ./Source/main.c
  4. ctags shortcut key:
    1. ctrl + ]  : To go to function definition, move the cursor to the function
    2. ctrl + t  : go back to location before performing ‘ctrl+]’

I am sure there have more command, but for now, the above 2 is good enough for me.

Building TI SensorTag Project With CCS Linux Under Ubuntu

ccsv6

*During the setup, sometimes when the errors message appear to be weird, a rebuild of project may help to remove such error.

Installation setup

  1. The Ubuntu using is 12.04.
  2. CCS installed path
    1. CCS installed path ~/program/ti-ccs/ccsv6
  3. BLE Stack: 2.01
    1. BLE stack installed path: ~/program/ti-ccs/ti/simplelink/ble_cc26xx_2_01_00_44423
  4. TI-RTOS
    1. TI RTOS installed path: ~/program/ti-ccs/tirtos_simplelink_2_13_00_06
    2. XDC tools installed path: ~/program/ti-ccs/xdctools_3_31_00_24_core

Import Project

  1. Launch CCS
  2. Right Click on Project Explorer empty area, then ‘Import’ –> ‘CCS Project’
  3. Browse to path : program/ti-ccs/ti/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/SensorTag/CC26xx/CCS
    1. Under ‘Discovered projects’, tick both ‘SensorTag’ and ‘SensorTagStack’
    2. Click ‘Finish’ to import project

Building SensorTag

Build Folder Path Modification

  1. Right click on ‘SensorTag’, select ‘Properties’
  2. Click on ‘Resource’ –> ‘Linked Resources’, change path below, you need to modify below absolute path according to your installation location:
    1. CC26XXWARE : /home/cheng/program/ti-ccs/tirtos_simplelink_2_13_00_06/products/cc26xxware_2_21_01_15600
    2. TI_RTOS_DRIVERS_BASE : /home/cheng/program/ti-ccs/tirtos_simplelink_2_13_00_06/packages
  3. Build and there should be some warning about as below:
    1. Invalid project path: Include path not foundSensorTagBuildInvalidPath

Invalid Project Path

  1. All above errors is due to name case is not match, we can perform one of the below method
    1. folder rename
    2. create link file (I use this in below)
  2. Browse to respective folder and start changing creating the symbolic link
    1. ln -s Include include
    2. ln -s cc26xxST CC26xxST
    3. ln -s CC26xx cc26xx
    4. ln -s Devices devices
    5. ln -s interfaces interfaces
  3. In menu bar ‘Project’ –> ‘Clean’
  4. In menu bar ‘Project’ –> ‘Rebuild All’
  5. Another error statingas as shown below
    1. cannot open source file “sensortag.h”
    2. SensorTagFileOpenFail
  6. To solve this:
    1. Browse to: ~/program/ti-ccs/ti/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/SensorTag/CC26xx/Source/Application
    2. ln -s sensorTag.h sensortag.h
    3. ln -s sensorTag.h SensorTag.h
  7. More error on naming
    1. Browse to: ~/program/ti-ccs/ti/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/SensorTag/CC26xx/Source/Application
    2. ln -s SensorTag_ConnCtrl.h sensortag_connctrl.h
    3. ln -s SensorTag_IO.h sensorTag_IO.h

Building SensorTagStack

Build Folder Path Modification

  1. Right click on ‘SensorTag’, select ‘Properties’
  2. Click on ‘Resource’ –> ‘Linked Resources’, change path below, you need to modify below absolute path according to your installation location:
    1. CC26XXWARE : /home/cheng/program/ti-ccs/tirtos_simplelink_2_13_00_06/products/cc26xxware_2_21_01_15600
    2. TI_RTOS_DRIVERS_BASE : /home/cheng/program/ti-ccs/tirtos_simplelink_2_13_00_06/packages
  3. After rebuild, there will be errors on:
    1. ble/SensorTag/CC26xx/CCS/SensorTagStack/../../IAR/Stack/CC2650/../../../../../../tools/LibSearch/libSearch.exe: Command not found

Wine Setup (running LibSearch.exe and Boundary.exe)

  1. Below Window executables is being use during build process, in Linux, we have to use wine to run these executables
    1. libSearch.exe
    2. Boundary.exe
  2. Refer to internet on wine installation as well as wine-mono
  3. Preparation
    1. Ensure LibSearch.exe is at: ~/program/ti-ccs/ti/simplelink/ble_cc26xx_2_01_00_44423/Projects/tools/LibSearch
    2. Ensure Boundary.exe is at: ~/program/ti-ccs/ti/simplelink/ble_cc26xx_2_01_00_44423/Projects/tools/Boundary
  4. Right click Project ‘SensorTagStack’ –> ‘Properties’
    1. ‘Build’ –> ‘Steps’
    2. Change Pre-build steps to:
      1. wine “${ORG_PROJ_DIR}/../../../../../../tools/LibSearch/libSearch.exe” ${ORG_PROJ_DIR}/buildConfig.opt ${ORG_PROJ_DIR}/../../../../../../tools/LibSearch/parameters.xml ${ORG_PROJ_DIR}/../../../../../Libraries/CC26xx/IAR/ ${ORG_PROJ_DIR}/../../Lib/CC2650Stack.a FlashROM
    3. Change Post-build steps to:
      1. “${CG_TOOL_HEX}” -order MS –memwidth=8 –romwidth=8 –intel -o “${ProjName}.hex” “${ProjName}.out”
        mono “${ORG_PROJ_DIR}/../../../../../../tools/Boundary/Boundary.exe” -prj “ccs” -chip “CC2640” -lcf “${ORG_PROJ_DIR}/../../../../../common/cc26xx/CCS/cc26xx_ble_stack.cmd” -map “${PROJECT_LOC}/${ConfigName}/${ProjName}.map” -xml “${ORG_PROJ_DIR}/../../../../../../tools/Boundary/BoundaryConfig.xml” -cc “${ORG_PROJ_DIR}/../../../CCS/Config/ccsCompilerDefines.bcfg” -lnk “${ORG_PROJ_DIR}/../../../CCS/Config/ccsLinkerDefines.cmd”
  5. ‘Project’ –> ‘Build Project’
  6. Errors on:
    1. cannot open source file
    2. SensorTagOpenFileFail2
    3. After perform a ‘Project clean’ and project rebuild everything works

A New Perspective About Social Entreprenuership

It was an inspiring session attending sharing session with Tony Meloto, who is the founder of Gawad Kalinga (GK). His organization, Gawad Kalinga (GK) is a movement that builds integrated, holistic and sustainable communities in slum areas and remote rural communities with a vision to end poverty for 5 million Filipino families by 2024. The organization focuses on health, environment and enterprise development issues.

The main key points of the sharing session as:

  1. Create values that other stakeholder can benefit from. Find ways to create an win-win situation. The example given my Tony is request land owner for donation of 20% of the land not as charity, but a way to allow Tony work on the lands by planting crops, thereby increasing the land values. This ultimately beneficial to land owner who has 80% of the land with land price increase
  2. Do not search for funding using charity as the reason, instead ask what values you can bring in to potential donors. What values the social activities other can benefit from, thereby enable other voluntarily funding.
  3. Getting the best people from the top society to help on the lowest society, bringing them up thereby increase the qualities of the society as a whole.
  4. You cannot do it alone.
  5. Radical optimism
  6. Community is a number games. We get the the largest number to show effectiveness of the social activity.
  7. Doable, visible, quantifable, sustainable, replicable.

Changes Between STM32F030 Discovery Vs STM32F072 Nucleo

The difference between on board control for these 2 boards as below:

STM32F030/STM32F072

LED

LD3: PC9
LD4: PC8
LD2: PA5

Button

B1(User): PA0
B1(User): PC13

A quick guide in changing MCU target device under Keil MDK.

In step 4, ensure the correct debugger is selected.

F030_to_F072

Keil uVision on STM32F030 : Fixing Error: Flash Download failed – “Cortex-M0”

Recently bump into below error when I want to run my program in STlink/V2 debugger. The Build output pane is showing below message:

No Algorithm found for: 08000000H - 08000877H
Erase skipped!
Error: Flash Download failed  -  "Cortex-M0"

Error MessageIn order to fix this problem, bring up ‘Cortex-M Target Driver Setup’ window using steps below:

  1. Click on menu bar ‘Project’
  2. Options for Target, this will bring up ‘Options for Target’ window
  3. Click on ‘Debug’ tab
  4. In the debugger device selection, click on ‘Settings’, this will bring up ‘Cortex-M Target Driver Setup’
  5. Click on ‘Flash Download’ tab
  6. In ‘Download Function’, select ‘Erase Full Chip’
  7. Below are the snapshot of the above selection steps

FixProblemMethod

Then I perform ‘Flash Download’ by

  1. In menu bar, click Flash
  2. Select ‘Download’

Above steps only require to perform once, then I can enter start/stop debugging session. ‘Flash Download’ steps probably is not require, but since I have perform those steps, I just added it here.

Ubuntu 12.04 : Updating Plugins In Firefox – Flash player, Java

Recently update to latest firefox and discovered flash player and java as been blocked due to some vulnebility in the install tools. After spending some time finally manage to get the correct command to update those plugins

Flash player

sudo apt-get –reinstall install flashplugin-installer

Java

sudo apt-get install oracle-java9-installer

Reference links is here.