2022/12/1

Ti mmwave : developement with EVB.

大概是要先從Out of Box Demo User Guide開始。
然後其中 Build 完,Exceute the Lab 有兩個 Mode:Deloyment, Debug
Debug 就是 CCS Debug Mode.
然後就 Link 到:using ccs debug 這個說明。

Ti mmwave EVM 用 debug mode 時,EVM 要燒一個 stub program,在 sdk 中有提供: ccsdebug
這個 stub program 啟動後就是一個 for loop,等待把 program load 到 ram 里 run
--- 所以不是真的的 JTAG debug (?)

所以build 完 project,不管要不要用 debug mode 來 run,都要先燒錄(bin 或 ccsdebug 的差別而已)。
EVM 要切換 flash Mode,燒完後切回 function mode。
每個板子的切換方式寫在: evm setup operational mode

CCS Debug Mode 要用到 ICE,就是 XDS110,這個在 AWR8642AOP EVM 上沒有(因為板子很小),需要接上 MMWAVEICEBOOST 板才行。
就是EVM Setup Operatiional Mode的 "AOP With mmWaveICBoost Attached"

CCS 的 JTAG debug mode 是在 "View -- Target Configurations" 中設置的,不是跟著 project。
自己要為要接的 EVM new 一個 configuration (*.ccxml),他沒有內建好的。
New Configurtation,給名子。選 XDS110 USB Debug Probe connection。
勾選 AWR6843AOP,
Save 後就可以選 Test Connection..下面就是AWR6843AOP + ICEBoost board 的 log..
[Start: Texas Instruments XDS110 USB Debug Probe_0]

Execute the command:

%ccs_base%/common/uscif/dbgjtag -f %boarddatafile% -rv -o -S integrity

[Result]


-----[Print the board config pathname(s)]------------------------------------

C:\Users\CHARLE~1.CHA\AppData\Local\TEXASI~1\
    CCS\ccs1210\0\0\BrdDat\testBoard.dat

-----[Print the reset-command software log-file]-----------------------------

This utility has selected a 100/110/510 class product.
This utility will load the adapter 'jioxds110.dll'.
The library build date was 'Sep 20 2022'.
The library build time was '12:28:44'.
The library package version is '9.9.0.00040'.
The library component version is '35.35.0.0'.
The controller does not use a programmable FPGA.
The controller has a version number of '5' (0x00000005).
The controller has an insertion length of '0' (0x00000000).
This utility will attempt to reset the controller.
This utility has successfully reset the controller.

-----[Print the reset-command hardware log-file]-----------------------------

The scan-path will be reset by toggling the JTAG TRST signal.
The controller is the XDS110 with USB interface.
The link from controller to target is direct (without cable).
The software is configured for XDS110 features.
The controller cannot monitor the value on the EMU[0] pin.
The controller cannot monitor the value on the EMU[1] pin.
The controller cannot control the timing on output pins.
The controller cannot control the timing on input pins.
The scan-path link-delay has been set to exactly '0' (0x0000).

-----[Perform the Integrity scan-test on the JTAG IR]------------------------

This test will use blocks of 64 32-bit words.
This test will be applied just once.

Do a test using 0xFFFFFFFF.
Scan tests: 1, skipped: 0, failed: 0
Do a test using 0x00000000.
Scan tests: 2, skipped: 0, failed: 0
Do a test using 0xFE03E0E2.
Scan tests: 3, skipped: 0, failed: 0
Do a test using 0x01FC1F1D.
Scan tests: 4, skipped: 0, failed: 0
Do a test using 0x5533CCAA.
Scan tests: 5, skipped: 0, failed: 0
Do a test using 0xAACC3355.
Scan tests: 6, skipped: 0, failed: 0
All of the values were scanned correctly.

The JTAG IR Integrity scan-test has succeeded.

-----[Perform the Integrity scan-test on the JTAG DR]------------------------

This test will use blocks of 64 32-bit words.
This test will be applied just once.

Do a test using 0xFFFFFFFF.
Scan tests: 1, skipped: 0, failed: 0
Do a test using 0x00000000.
Scan tests: 2, skipped: 0, failed: 0
Do a test using 0xFE03E0E2.
Scan tests: 3, skipped: 0, failed: 0
Do a test using 0x01FC1F1D.
Scan tests: 4, skipped: 0, failed: 0
Do a test using 0x5533CCAA.
Scan tests: 5, skipped: 0, failed: 0
Do a test using 0xAACC3355.
Scan tests: 6, skipped: 0, failed: 0
All of the values were scanned correctly.

The JTAG DR Integrity scan-test has succeeded.

[End: Texas Instruments XDS110 USB Debug Probe_0]
test Connection OK,就可以 "Launch Configuration",然後就會出現 Debug View。裡面出現 ICE chain 上的 device : XDS110/Cortex_R4, XDS110/C674X
在要用到的 device 上一一做 "connect" 後,ICE 就ready 了。

Load to Run 的動作不是自動的,不是你開了那一個 project,按下 Run - Load 之後就會 Load 那個 program。
Run -- Load 後,會開啟 file/projecrt explorer 要你找要 load 的 xer4f 檔。

2022/11/17

antenna geometry . xWR6843AOP

SDK 和 example/labs 中,有用來描述 TX/RX 相對位置的資料。
xWR6843AOP 的 TX/RX 排列是
    R4R2
    R3R1
T1  

T3  T2
一格是1/2波長。
所以在sdk : antenna_geometry.c 中...
以tx, rx左上角為0.0。右,下為正。單位是 1/2 波長...
ANTDEF_AntGeometry gAntDef_IWR6843AOP = {
     .txAnt = {
                {0, 0},
                {2, 2},
                {0, 2}
       },
     .rxAnt = {
                {1, 1},
                {1, 0},
                {0, 1},
                {0, 0}
              }
};
而在 labs source 中,用 antGeometry0.1 來描述 tx,rx 的排列。
但是是用 virtial antenna 的方式..
因為 T1.T2.T3的排列方式。RX 可以視為:
R04 R02
R03 R01
R12 R10 R08 R06
R11 R09 R07 R05
定義:
  • antGeometry0: azimuth offset of all available virtual antennas
  • antGeimetry1: elevation offset of all available virtual antennas
然後以左上為原點,左上為正
antGeometry0 -1 -1  0 0 -3 -3 -2 -2 -1 -1  0  0
antGeometry1 -1  0 -1 0 -3 -2 -3 -2 -3 -2 -3 -2
:::

2022/11/14

bookmark : progress , check cp. progress

作者說明怎嘛做:
It simply scans /proc for interesting commands, 
and then looks at directories fd and fdinfo to find opened files and seek positions, and reports status for the largest file.

It's very light, and compatible with virtually any command.
apt install 就有了...

2022/11/10

Code Composer 12.1.0 in Linux, build project.

CCS 安裝就 download linux 版 tar.gz,解開後 執行 *.run 這個 script。
就會安裝。

裝完,點 icon 啟動,到 reosurce explorer。
到 automotive toolbox 右邊 ':', Install
會裝 SDK..
之後會重開。
然後就可以選需要的 example project 的 import to IDE.

build IDE 的化,會 fail,因為一堆 sdk/packages/scripts/ImageCreator/ 下的 tool 都是用 exe 呼叫。
到 project -- properties --- build -- steps -- post-build-step 去看,都是用 exe。
然後到 ImageCreator 去看,除了 out2rprc 只有 exe 之外,其他都有兩個檔,一個沒有 .ext 是給 linux 用。有 exe 給 windows 用。
out2rprc 用 file 看是 .NET,所以依照說明 apt install mono-runtime 之後,就可以 run 了。
所以修改剛剛 post-build-step 的每個,除了 out2rprc.exe 之外,其他的 .exe 附檔名都刪掉。
這樣就 build OK 了。

mmwave sdk , algorithm 與 主程式的關聯

mmwave sdk 的 example (labs sample) 的 source code,trace 主程式不太容易看到 對 chirp/frame 處理的code。
里如怎麼決定 algorithm, 哪裡會去執行 fft, aoa , cfar 的 code..

trace overhead_mount_occupy 這個 example 中,object detection hardware 的 code,找到 DPC_ObjectDetection_execute 這個 function。
就是做 處理的地方,然後它被放在DPM_ProcChainCfg 這個 structure 里。

從這個 structure 來找...應該是 interface 吧...
sdk/packages/ti/control/dpm/dpm.h
typedef struct DPM_ProcChainCfg_t
{
    DPM_ProcChainInitFxn                      initFxn;
    DPM_ProcChainStartFxn                     startFxn;
    DPM_ProcChainExecuteFxn                   executeFxn;
    DPM_ProcChainIoctlFxn                     ioctlFxn;
    DPM_ProcChainStopFxn                      stopFxn;
    DPM_ProcChainDeinitFxn                    deinitFxn;
    DPM_ProcChainInjectDataFxn                injectDataFxn;
    DPM_ProcChainChirpAvailableCallbackFxn    chirpAvailableFxn;
    DPM_ProcChainFrameStartCallbackFxn        frameStartFxn;
}DPM_ProcChainCfg;
這個 interface 是給誰用的?
從 member executeFxn 來找找看,他是被 DPM_execute( ) 呼叫:
int32_t DPM_execute (DPM_Handle handle, DPM_Buffer* ptrResult)
    ...
    ptrDPM = (DPM_MCB*)handle;
    ...
    retVal = ptrDPM->procChainCfg.executeFxn (ptrDPM->dpcHandle, ptrResult);
所以呼叫 DPM_execute 時,準備好的參數: handle. 就包含了將要 run 的 function (algorithm)


拿 overhead_mount_occupancy 的 mss 來看。這個 structure 在哪裡宣告。

在 project source 的 src/common/dpc/objdetrangehwa/src/objdetrangehwa.c 中,先把這個 functiontable(interface): gDPC_ObjDetRangeHWACfg 的內容 implement好,把表填好
DPM_ProcChainCfg gDPC_ObjDetRangeHWACfg =
{
    DPC_ObjectDetection_init,            /* Initialization Function:         */
    DPC_ObjectDetection_start,           /* Start Function:                  */
    DPC_ObjectDetection_execute,         /* Execute Function:                */
    DPC_ObjectDetection_ioctl,           /* Configuration Function:          */
    DPC_ObjectDetection_stop,            /* Stop Function:                   */
    DPC_ObjectDetection_deinit,          /* Deinitialization Function:       */
    NULL,                                /* Inject Data Function:            */
    NULL,                                /* Chirp Available Function:        */
    DPC_ObjectDetection_frameStart       /* Frame Start Function:            */
};
在 mss_main.c 的 initTask( ) 時,放在要給 DPM 的 parameter, handle structure 中,
然後呼叫 DPM_init( ) 初始化,並且把這個 structure 放到 objDetDpmHandle 中:
    dpmInitCfg.ptrProcChainCfg  = &gDPC_ObjDetRangeHWACfg;
    ...
    gMmwMssMCB.objDetDpmHandle = DPM_init (&dpmInitCfg, &errCode);
然後在後來 create 的 Task : mssDPMTask( ) 中,呼叫 DPM_execute 時,傳入這個structure 做 parameter.
static void mmwDemo_mssDPMTask(UArg arg0, UArg arg1)
{
    ...
    while (1)
    {
       ...
       errCode = DPM_execute (gMmwMssMCB.objDetDpmHandle, &result);