Table of Contents

BSI 로 부터 받은 2005 년 5 월 3 일 현재 최신 버전인 '7710_EVAL.zip' 을 기준으로 설명한다.
압축을 풀고, 디렉토리 이름을 '7710ref' 로 변경한다. 본격적으로 들어가기 전에, 컴파일 환경은 다음과 같다.

기본 디렉토리 c:\stm\
ST RTOS 2.1.2

7710ref 의 구조

BSI 로 부터 받은 7710ref(Brick 소스라고 했음)은 7020 때의 Brick 소스 같은 형태가 아니다. 7020 Brick 소스가 HD 셋톱박스의 Full 기능을 구현한 소스였다면, 이번에 받은 7710ref 는 각각의 모듈 디바이스별로 테스트할 수 있는 테스트 코드만 들어있다.

디렉토리의 구조는 아래의 표와 같다.

이름 설명
bin 컴파일 환경설정을 위한 .bat 파일들이 들어있다
config 보드 초기화를 위한 .cfg 파일들이 들어있다
docs 각 디바이스별로 .pdf 파일들이 들어있다
include 각 디바이스에서 참조하는 .h 파일들이 들어있다
lib src 컴파일 후에 자동으로 생성되는 library 디렉토리
make gmake 설정 디렉토리
singappl 7710 Demo 소스
src 각 디바이스 별 소스 디렉토리
testapps 테스트 프로그램

그게 보면, 5517ref 와 크게 다르지 않다. 여기서 가장 주의 깊게 볼 것은 singappl 이다. 현재 확실하지는 않지만, 7020 brick 소스에 가장 가까운 프로그램인 것 같다.
우선 가장 먼저할 일은 7710ref 의 library 를 만드는 일이다. src 디렉토리를 전체 컴파일 해야 하는데, 우선 적절한 컴파일 환경을 만들어 주어야 한다.
c\stm\7710ref\bin 아래에 setup.bat 파일이 있다. 아래와 같이 수정해 주어야 한다.

@echo off
rem Perform the following steps when modifying this file to setup the build
rem environment:
 
rem 1. Set the following variable to point to the top level of the 7710 tree.
rem    NOTE: Use forward slashes and do not include a trailing slash.
 
set STi7710ROOT=C:/stm/7710ref      ---> 현재 경로에 맞게 수정!!
 
rem 2. Set the following variable to point to the location of your own
rem    targets.cfg file.
rem    NOTE: Use forward slashes and do not include a trailing slash.
rem    NOTE: This is the location of the targets.cfg shipped with the release
rem          which has no targets defined. If you provide your own, remember
rem          to delete the targets.cfg from this location.
 
set DVD_TARGET_PATH=%STi7710ROOT%/config/platform
 
rem 3. Add the location of the 7710 bin directory to the front of your
rem    path.
rem    NOTE: Use backward slashes and do not include a trailing slash.
 
set PATH=%STi7710ROOT%/bin;%PATH%
 
 
echo Using 7710 root: %STi7710ROOT%
set DVD_MAKE=%STi7710ROOT%/make
set DVD_ROOT=%STi7710ROOT%/src
set DVD_EXPORTS=%STi7710ROOT%/lib
 
rem See the release notes for descripton of these build options
set DVD_TRANSPORT=stpti4
set DVD_PLATFORM=mb391
set DVD_SERVICE=DVB
set DVD_FRONTEND=7710
set DVD_BACKEND=7710
set DVD_DEPENDS=yes
 
rem tuner driver settings for 299, 360, 297/297J tuners    
 
----> 이 세팅들은 BRICK BOARD 에서 사용된 TUNER 에 대한 설정이다. 어짜피 나중에는 BRICK 보드의 TUNER 를 사용하지 않을 것이기 때문에, 이 옵션을 수정해야 할 것이다.
 
set DVD_STTUNER_USE_SAT=YES
set DVD_STTUNER_USE_TER=YES
set DVD_STTUNER_USE_CAB=YES
set DVD_STTUNER_BUILD_299=YES
set DVD_STTUNER_BUILD_DUAL299STEM=YES
set DVD_STTUNER_BUILD_360=YES
set DVD_STTUNER_DRV_CAB_EXTTUNERS=YES
set DVD_STTUNER_DRV_CAB_STV0297=YES
set DVD_STTUNER_DRV_CAB_STV0297J=YES
set DVD_STTUNER_BLOCK_SYNC_MODE_SELECT=YES
 
rem enable audio wa
set ST_7710_CUT1_WORKAROUND=1
 
 
rem set the following for 299/6K NIM tuner
set TESTAPP_TUNER_TYPE=STTUNER_TUNER_STB6000
 
 
rem video memory injection settings
rem set TESTAPP_VID_INJECTION=MEMORY
rem set TESTAPP_VID_FILENAME=susie.m1v
 
 
rem set TESTAPP_TSIN_CONFIG=TSIN0_NORMAL (OR) TESTAPP_TSIN_CONFIG=TSIN1_NORMAL
rem If this variable is not set, TSMERGER will operate in bypass mode. Affects all tests using tsmerger.
set TESTAPP_TSIN_CONFIG=TSIN1_NORMAL
 
 
rem set epld for stem mode to use db499, not set if db580 nim will be used
set TESTAPP_EPLD_DB499=1
 
 
rem set DEBUG to 1 as default to support boot from flash / will be investigated later.
set DEBUG=1
 
 
rem set TESTAPP_SWITCH_HD_MODES=1
rem If this variable is set, HD format will be periodically switched between 1080I, 720P & 480P in testapp1
rem Otherwise, output will be set to TESTAPP_HD_FORMAT format
 
 
rem set DVD_APPLIC=TESTTOOL
rem set DVD_REF=%STi7710ROOT%/testapps/testapp1
 
 
goto Done
 
echo This setup.bat file must be edited to reflect the installation location
echo in order to work. Please read the instructions in the setup.bat file.
 
echo This script is being run as:
echo %0%
 
:Done

수정했으면, c\stm\ST20R2.1.2\bin 아래에서 ST20.bat 파일을 c\stm\7710ref\bin 으로 복사한다. 이제 컴파일 해보자!

>cd stm\7710ref\bin
>setup.bat
>ST20.bat
>cd ..
>cd src
>gmake

약간의 시간후에 에러없이 컴파일 되었다면, library 가 생성되었을 것이다.(stapi_stpti4.lib)

Test Program 컴파일하기

총 6 개의 test program 이 있는 데, 각각 프로그램 마다 테스트 디바이스가 다르다. 일단 컴파일해보자!!
testapp3 를 컴파일하다가 에러가 발생했을 것이다. 바로 앞에서 만든 library 에 testtool 이 빠져있기 때문이었다. src\makefile 에 testtool 을 추가하고, 다시 library 를 만들면 된다.
testapp6 에서 에러가 날 것이다. 다름 아닌, zenteklib 때문이다.

config 디렉토리 구조

config 디렉토리는 보드가 부팅하기 위한 초기 설정값들을 가지고 있다. 제대로 된 보드 초기화가 안된다면, pti 고 hdmi 고 간에 말짱 도루묵이다.
DAC5000 과 비교해봤을 때, 파일명과 구조가 바뀌었다.
앞에서 살펴봤던, 7710ref 의 경우 config 디렉토리를 보면, 아래 표와 같다.

이름 설명
board tesp application 과 각 디바이스 드라이버에서 참조 하는 config 디렉토리
board_ssb singappl 에서 참조 하는 config 디렉토리
chip application 에서 참조할 수 있도록 sti7710.h 파일 포함
platform DCU 의 target 을 지정할 수 있고, 컴파일을 위한 .mak 파일 포함

여기서 주의깊게 볼 것은 바로 board 와 board_ssb 인데, 이 것들의 하위 디렉토리를 보면, 각각 같은 이름의 .cfg 파일이 있는 것을 알 수 있다.
또한 설정 값들이 조금씩 다른데, 그것은 아마도 각각의 다른 보드에서 테스트하던 설정 값들인 것 같다.

일단 나는 board_ssb 를 기준으로 할 것이다. 이 두 디렉토리의 설정값들을 비교해 볼때, 다른 점은

  1. LMI 속도
  2. SDRAM 세팅 및 클럭 타이밍
  3. 메모리 맵(EXTERNAL, NONCACHE) 사이즈

이다.