Tuesday, August 19, 2014

LaunchPad Temp GUI @MSP430 Value Line LaunchPad (MSP-EXP430G2)

LaunchPad Temp GUI (if LaunchPad Temp GUI Can Not Exec, Install 32bits JRE) :
LaunchPad Temp GUI Application Using 32 bits javaw.exe :
System Environment -> 64 bits :
System Device Manager :
Device Side Source Code (Transmit Only, Without "Receive" Process) :

putty.exe log file :

ref link : http://www.badprog.com/electronics-msp430-using-the-temperature-demo-gui


Sunday, October 20, 2013











RTEMS – stm32F407 Discovery Board


  • Environment :
Host O.S. : Windows 7 64bits With stlink v2 Driver + VMWare Workstation 10.0.0 build 1.295980.
Guest O.S. : Ubuntu 13.10 Desktop 64bits.
  • PreInstall :
sudo apt-get update;sudo apt-get upgrade -y
sudo apt-get install -y autoconf automake autotools-dev build-essential git \
dpkg-dev g++ g++-4.6 libalgorithm-diff-perl libalgorithm-diff-xs-perl \
libalgorithm-merge-perl libdpkg-perl libgmp-dev libgmp3-dev libgmpxx4ldbl \
libltdl-dev libmpc-dev libmpfr-dev libstdc++6-4.6-dev libtimedate-perl \
libtool texinfo flex bison gawk expat libexpat-dev libncurses5-dev \
libusb-1.0.0-dev libsgutils2-dev
mkdir for source & build
br prefix : for arm-rtems4.11 BSP
bre prefix : for arm-rtemseabi4.11 BSP
$ mkdir ~/rtems
$ mkdir ~/rtems/source
$ mkdir ~/rtems/build
$ mkdir ~/rtems/build/b-autoconf
$ mkdir ~/rtems/build/b-automake
$ mkdir ~/rtems/build/br-binutil
$ mkdir ~/rtems/build/bre-binutil
$ mkdir ~/rtems/build/br-gcc
$ mkdir ~/rtems/build/bre-gcc
$ mkdir ~/rtems/build/br-gdb
$ mkdir ~/rtems/build/bre-gdb
$ sudo mkdir /opt/rtems-4.11
$ sudo chown -R $USER /opt/rtems-4.11
$ export PATH=/opt/rtems-4.11/bin:$PATH
  •  Install autoconf & automake :
$ mkdir b-autoconf
 $ cd b-autoconf/
 $ ../autoconf-2.69/configure --prefix=/usr
 $ make
 $ sudo make install
 $ cd ..
 $ rm -fr b-autoconf/
 $ mkdir b-automake
 $ cd b-automake/
 $ ../automake-1.12.2/configure --prefix=/usr
 $ make
 $ sudo make install
 $ cd ..
 $ rm -fr b-automake/
  • Build – Crosstool :
For BSP arm-rtems4.11
~/rtems/source/rtems$ export TARGET="arm-rtems4.11"
For BSP arm-rtemseabi4.11
~/rtems/source/rtems$ export TARGET="arm-rtemseabi4.11"

  • Build – O.S.  & test sample :
~/rtems/source$ git clone git://git.rtems.org/rtems.git rtems
configure & build :
~/rtems/source/rtems$ ./bootstrap
~/rtems/source/rtems$ cd ~/rtems/build/br-stm32
~/rtems/build/br-stm32$ ../../source/rtems/configure --target=${TARGET} --enable-rtemsbsp=stm32f4 --enable-tests=samples --prefix=/opt/rtems-4.11
~/rtems/build/br-stm32$make
~/rtems/build/br-stm32$make install

  • Build – st-util :
~/rtems/source$ git clone git://github.com/texane/stlink.git stlink
~/rtems/source$ cd stlink
~/rtems/source/stlink$ sudo cp 49-stlinkv*.rules /etc/udev/rules.d/.
~/rtems/source/stlink$ sudo udevadm control --reload-rules
~/rtems/source/stlink$ ./autogen.sh
~/rtems/build/b-stlink$ ./configure --prefix=/opt/rtems-4.11
~/rtems/build/b-stlink$ make
~/rtems/build/b-stlink$ make install

  • Flush sample file (ex : hello[ps]) to stm32F407 Discovery Board :
...$ arm-rtemseabi4.11-objcopy -O binary hello.exe hello.bin
...$ st-flash write hello.bin 0x08000000
Screen Capture :

[ps]
Open407V-D With Extension Board Uart 3 pin def :
Tx : PC10
Rx : PC11
RTEMS Hello.exe :
Using UART 3, Pin Define :
Tx : PD8
Rx : PD9

RTEMS Source Builder For Debian / Ubuntu :
https://ftp.rtems.org/pub/rtems/people/chrisj/source-builder/source-builder.html#_ubuntu

Thursday, September 06, 2012

VS2010 Build VS2012 Project Error ~ error MSB8008

Using VS2010 to open VS2012 Project.

Build Error Msg
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(518,5): error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.

Build FAILED.


Solution :
step 1 : Remove *.suo files.
step 2 : Remove *.vcxproj.filters and *.vcxproj.user files.
step 3 : Remove Build History (Both Debug & Release).
step 4 : Edit (ProjectName).vcxproj file :
    Remove all "v110" section and save file.
step 5 : Reopen (SolutionName).sln and rebuild solution.

The Key Point Is :
"step 4 : Edit (ProjectName).vcxproj file :
    Remove all "v110" section and save file."

Tuesday, July 03, 2012

Pandaboard ES

1. Adapter Power 不能使用 1A, 會不定時 reset or show error message. (即使不接任何 USB, HDMI, Ethernet,單單 SD Card & Pandaboard ES 1A 就不夠了)
2. HDMI 是 Ether / USB 旁邊那個.
native gcc compiler :

Monday, November 08, 2010

int 在 Stack 所占的空間

Test Code :
// VarWidth.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include
using namespace std;

int AddFunc(int x, int y) {
int a = 0, b = 0, c = 0;

cout << "x addr : " << &x << endl;
cout << "y addr : " << &y << endl;

cout << "a addr : " << &a << endl;
cout << "b addr : " << &b << endl;
cout << "c addr : " << &c << endl;

__asm{
mov eax, dword ptr[esp+4]
mov ebx, dword ptr[esp+8]
add eax, ebx
}
return 0;
}

int main(int argc, char* argv[])
{
int iRet = 0;
int x = 1, y = 2;
iRet = AddFunc(x, y);
// printf("Hello World!\n");
return 0;
}


Default 情況下 :









若是直接用 esp + offset Access Variable 的話, V$.net Debug Version 會用掉 12 Bytes, 如果 Debug / Release 都只要 4 Bytes 的話可以 follow 這一篇 : http://www.eggheadcafe.com/software/aspnet/29178215/an-int-that-is-4-bytes-in-native-and-12-bytes-in-net-huh.aspx

Wednesday, June 23, 2010

ARM SAM3U-EK F.W. Download, 2010/06/23

昨天將 Atmel SAM3U-EK Board Firmware Upgrade To 1.1 (原 1.0) 後, MP3 Player 似乎還是不能 Play SD 的 Media File(Flash 的 Media 可以 Play), 不過用 USB 連線後 PC Side 倒是可以認到 SAM3U-EK 有兩個 Partition, 而且都可以 Access (R/W), 經由 Uart 也可以 Run DM Code(Unstable! Just Runnable Only),Atmel 原廠的 DM Code 實在是太過精簡了, 除了 Thermal, Back-light, 幾乎沒啥可玩.
Upgrade F.W. 方式記錄一下 :
1. PC Side 要先安裝 SAM-BA (目前裝的是 v2.9)
2. SAM3U-EK Side Power Up 前 Short JP1, Then Power Up(此時 LCD Panel 不會 Show 東西), Power Up 後再 Open JP1.
3. 接上 USB (PC<->SAM3U-EK), PC Side 會自動 Identify USB Device And Install Driver.
4. 開啟 SAM-BA Program, Then Follow Instruction 就可以了 (就是要 Access Flash 前要 Select Enable Access Flash And Run Once)
5. Select 要燒錄的 F.W. (.bin Format), Then Send To Flash.
6. Plug Out USB And Power Off Then Power On Again.
就這樣囉, 不過 DM Code 要燒兩塊 Flash, Follow F.W. 中的 Readme File 操作就行了.

今天一直找 SAM3U-EK 的 Bootstrap Document, 喵了一下, 和之前用的 Mxx 公司的有點像, 一樣是 Init USB And Then Wait Download And...., 接下來就是要驗證了, 要找個 sample Code And Tool Build 一下看能不能 Run.

1. Sample Code : 基於 Atmel SAM3U4E 的 CoOS 示例, 有 IAR / MDK / GCC 三種版本, 實在不想再裝 Realview, IAR 之前玩過, Gilbert And Checko 都說是非主流, 就剩 GCC Ver 囉.
Link : http://www.coocox.org/CN/EXAMPLE/ATMEL_GCC.htm

2. Compiler : 嘗鮮一下, 用 coocox 提供的 CoBuilder.
Link : http://www.coocox.org/CN/CooCox_Builder.htm

用 CoBuilder Build Sample Code 可以直接 Build 過, Build 完後會生成一個 xxx.bin, 然後用 Upgrade SAM3U-EK F.W. 方式將 Build 出的 Binary File 燒到 Flash 0, 可以正常執行.

目前對 Atmel SAM3U-EK Survey 結果 :
1. H.W. : 目前還欠些 Component, Ex : Ethernet, Keyboard, 要自己兜的話要得花時間, 而且這顆是 Cortex M3 Only, 沒有 MMU, MPU Only.
2. S.W. : 沒有 MMU 加上 RAM 又不大, Task Switch 又不想自己搞, 剩下就是要找個夠小又夠穩的 OS 了, coocox / uCOS / FreeRTOS.

Tuesday, December 23, 2008

CSR C3 F.W. And Trim With Agilent N4010A, 2008/12/24

C3 F.W. And Trim 總算 Released 了, 紀錄如下 :

1. 原 Query Frequency Offset Command : "DIAG:HW:DAP:READ:BT:FOFF?" 原廠 FAE LEI_YANG 釋疑如下 :

The command "DIAG:HW:DAP:READ:BT:FOFF?" is a diagnostic command for debug only. We strongly recommend to use "FETCh:FOFF?" to replace it.
Yang Lei
WiNet Application Engineer
Mobile Broadband Division
China Communications Operation
Agilent Technologies
Tel : +86(10)64396940
Fax: +86(10)64397666
TN: 658-6940
Email: lei_yang@agilent.com

? 不能用 "DIAG:HW:DAP:READ:BT:FOFF?" Get Frequency Offset, 但用 "FETCh:FOFF?" 卻 Always Get Last Test Result, N4010A 並沒有再 "Run/Resume" 一次, 向原廠 FAE LEI_YANG 求助 Ans : 以 "INIT" Command 讓 N4010A "Run/Resume" 一次, 而 Command And Command 間可用分號串聯 :
Old Command : "DIAG:HW:DAP:READ:BT:FOFF?"
New Command : "INIT;FETCH:FOFF?"

PS : DIAG 並非 SCPI Standard Command, 而且 Agilent 方面也沒有 Document, 更不建議用.

至此對 Agilent N4010A Command 方面已可讓 Test Func Work Fine. 但有些不足的是, 在丟 "INIT;FETCH:FOFF?" N4010A Panel 並沒有自動跳到 "Result" Page, 向原廠 FAE LEI_YANG 求助 Ans : Command "DIAG:KEY 72" Is Equal Panel "Result" Button. 所以用 Agilent N4010A Test BT Trim Result Frequency Offset 部份 OK.


2. CSR BC3 Trim : BC3, BC4 有 Host Based 之差異, BC3 Cold / Warm Reset 須 Wait (Sleep) 1~2 Sec For Core Boot, 剛開始一直用 Debug Mode Step By Step Run, 此類 Timing Issue 不會浮現, Release 時卻一直卡住, BC3 Cold /Warm Reset 需 Sleep (Wait For Boot), BC4 不用.


3. nFore Said, BT ColdBoot OK 後會從 UART 吐版本, 但在 F.W. Download And MAC Write 後做(Use API, Help Notes Equal ColdBoot) ColdBoot 後卻是 "Sometimes" 才吐版本(Use Serial Monitor), 所以需要自行 Query (Use "(b)" Command).


4. BC3 在 BootMode 非 1 And F.W. Download And Coldboot OK 之時不可 Open PC Side COM Port, 於此時間 Open PC Side COM Port 自己所遇到的情況是 Sometimes Open OK and Sometimes Fail, 但如果是 Fail, COM Port 會被 "暫時" Lock, 和 小 P 所遇到的 Uart 亂丟東西雖徵狀有異, 但可能是相同原因所導致.


5. 原 Code 在 F.W. Download 後 SetTimer 後即 close spi handle And Coldboot Module, 這樣會造成 UART Data 尚未 Read(Send 也未知...), PC Side UART 未 Closehandle, BT Module 即 Coldboot. 移除該段 Code 後解決 PC UART Read / Send But BT Module Be Coldboot 問題.


6. SCPI Command 修正如下 :
SCPI Init Command :
"*CLS",
"INST:SEL 'RFA'",
"SENS:BAND 1300000",
"SENS:POW:RANG 5",
"SENS:FREQ:CENT 2441",
"SENS:SWE:TIME .00300",
"INIT" -->> "DIAG:KEY 72" 於此時做 Frequency Offset Test ("INIT") 並無意義, 改成將 Panel LCD 切換至 Result ("DIAG:KEY 72")

SCPI Get Frequency Offset Command :
"DIAG:HW:DAP:READ:BT:FOFF?" -->> "INIT;FETCH:FOFF?" 先做 Test And Then Get Frequency Offset Value.


7. 以 "FETCH:APOW" Command 可 Get DB Value. 先前試遍了 "DIAG..." 開頭的 Command 均 Fail.


8. Debug 過程 UART 一直陸續有問題, 除 Open UART Timing 外, Agilent IO Control 也是元兇之一, 在開啟 Agilent IO Control AP 同時用 Layer 0 的 UART Monitor Tool 可以看到 Agilent IO Control AP 開的時候對每個 UART 都做了 Open / Close (Send?) 動作, 如果是剛好(機率極高) 在不可 Open UART 時 Open UART...., BT F.W. & Trim AP 就會受影響 (Uart 已被 Agilent IO Control Open UART 時搞死), 無法 Open / Read Version BT F.W. Version, 整個程式結果也就不正確了.


9. Search Algorithm : 一開始用 Binary Search 似乎 OK, 但若加進從 Agilent N4010A 的 Frequency Offset Value 再配合 Frequency Offset Table, Worst Case 應在 5 times 可得知 Trim Fail, 4 times 即可 Trim OK.


10. 今日版本已將 Log (S.F. Format) 產生出, 後續修改 :
(1) Trim Value Search Algorithm
(2) Hard Coding -> Variable & There Are Default(Use "define") Value And Can Get From XML
(3) BT MAC & S.F. Issue.

Trim Value Search Algorithm 應該比較簡單, 但要長時間量測.
Hard Coding 則要配合 BT MAC & S.F. 一起改.

mount nullfs (null file system) @FreeNAS for jail

在 FreeNAS / jail 中要 mount Host 的 folder 須在 Host 上執行 mount (nullfs), mount point 即是 jail folder 相對應的 node.