Development Notes

Repository File Structure

devry Main project directory
devry/build Scratch area for compiling
devry/build/binutils binutils sh1 build dir
devry/build/gcc GCC sh1 cross compiler build dir
devry/buidl/rockbox Rockbox compile
devry/buidl/rockbox2 Another Rockbox compile
devry/bin Tools and programs
devry/bin/elf32 Linux 32bit binary tools
devry/bin/elf64 Linux 64bit binary tools
devry/bin/cygwin Cygwin binary tools
devry/src Source code sources
devry/src/travis Code Travis has been playing with
devry/src/octave Octave source code
devry/src/rockbox-cvs Rockbox source code cvs head
devry/src/rockbox-2.5 Rockbox source code at version 2.5
devry/src/rockbox-devel Rockbox source code cvs head for devel branch - includes simulator
devry/rockbox Project rockbox code
devry/download Downloaded files

Building binutils

cd download
wget -c ftp://ftp.gnu.org/pub/gnu/binutils/binutils-2.16.1.tar.bz2
cd src
tar -xvzf ../download/rockbox-2.5.tar.gz
mkdir ../build/binutils
cd ../build/binutils
../../../src/binutils-2.16.1/configure --target=sh-elf --prefix=/vol/dump/devry/bin/elf32
make
make install
make clean  # this would be waisted space svn

Building GCC

cd download
wget -c ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.3.6/gcc-3.3.6.tar.gz
export PATH=/vol/dump/devry/bin/elf32/bin:$PATH
cd src
tar -xvzf ../download/gcc-core-3.3.6.tar.gz
tar -xvzf ../downlaod/newlib-1.14.0.tar.gz
cd gcc-3.3.6
ln -s ../newlib-1.14.0/newlib newlib
cd ..
mkdir ../build/gcc
cd ../build/gcc
../../../src/gcc-3.3.6/configure --target=sh-elf --enable-languages=c --prefix=/vol/dump/devry/bin/elf32
make
make install
make clean  # this would be waisted space svn

GDB Build

cd src
tar -xvzf ../download/gdb-6.1.1.tar.gz
mkdir build/gdb
cd build/gdb
../../src/gdb-6.1.1/configure --target=sh-elf --prefix=/vol/dump/devry/bin/elf32 
make
make install
make clean  # this would be waisted space svn

Missing Convbdf Build Error

I get this error when trying to build rockbox.

make[1]: /home/devry/rockbox/tools/convbdf: Command not found
make[1]: *** [/home/devry/build/rockbox/firmware/sysfont.o] Error 127
make: *** [all] Error 2

Go into the rockbox tools directory. Type make.

$ make
+ make
cc -O -ansi -g   -c -o scramble.o scramble.c
cc -O -ansi -g   -c -o iriver.o iriver.c
cc -g  scramble.o iriver.o   -o scramble
cc -O -ansi -g   -c -o descramble.o descramble.c
cc -g  descramble.o iriver.o   -o descramble
cc -O -ansi -g   -c -o iaudio.o iaudio.c
cc -g  iaudio.o   -o iaudio
cc -O -ansi -g  -g  sh2d.c   -o sh2d
cc -DAPPLICATION_NAME=\"bmp2rb\" -g bmp2rb.c -o bmp2rb
cc -g rdf2binary.c -o rdf2binary
cc -g convbdf.c -o convbdf
cc -DHAVE_LCD_CHARCELLS -D__CONFIG_H__ -I../firmware/export generate_rocklatin.c ../firmware/drivers/lcd-player-charset.c -o generate_rocklatin
cc -g mkboot.c -o mkboot
tools done

This is sorta messy. Don't commit these files to the repository as they are not platform independant.

Missing rockbox source

I ran into an issue where the generated make file was using my home directory as the default location. Not sure why I am getting this, as this did not happen before.

Edit the Makefile and fix the paths.

Here is an example error I recieved before fixing the scamble path.

make[1]: /home_auto/talin/tools/scramble: Command not found
make[1]: *** [/home/devry/build/rockbox/ajbrec.ajz] Error 127
make: *** [all] Error 2

Downloading the source

wget -c http://www.rockbox.org/download/rockbox-2.5.tar.gz
wget -c ftp://ftp.gnu.org/pub/gnu/binutils/binutils-2.16.1.tar.bz2
wget -c ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.3.6/gcc-3.3.6.tar.gz
wget -c ftp://ftp.gnu.org/pub/gnu/gdb/gdb-6.1.1.tar.bz2

Rockbox UI testing

The dump files for the UISimulator in Rockbox is located at:

devry/build/rockbox/archos/

Put plugins here:

devry/build/rockbox/archos/.rockbox/rocks

Rockbox Plugins:

  • To add an additional Target subdirectory, edit “devry/rockbox/apps/plugins/Makefile” and add to $(SUBDIRS)
  • To add a single file to build, edit SOURCES and add the file to the list.
  • Plugins can only be a single c file. Will have to use include if you want multiple files.

Rockbox Architecture

Software Architecture Hierarchy

Volume control:

vol = rb->global_settings->volume;
rb->sound_set(SOUND_VOLUME, vol);
rb->global_settings->volume = vol;

Get Register:

left_val = rb->mas_codec_readreg(0xC) / (MAX_PEAK / (LCD_HEIGHT/2-2));
right_val = rb->mas_codec_readreg(0xD) / (MAX_PEAK / (LCD_HEIGHT/2-2));

Set Register:

int (*mas_codec_writereg)(int reg, unsigned int val);
int (*mas_codec_readreg)(int reg);
void* plugin_get_buffer(int *buffer_size);
void* plugin_get_audio_buffer(int *buffer_size);
lcd_setfont(FONT_SYSFIXED);
lcd_getstringsize("X", &lcd_char_weight, &lcd_char_height);
lcd_setmargins(0, 8);
sleep(milliseconds);
ata_set_led_enabled(false);
mpeg_init_recording();
sound_set(SOUND_VOLUME, global_settings.volume);

Global Settings:

global_settings.rec_mic_gain;
global_settings.volume;
global_settings.bass;
global_settings.treble;  
global_settings.rec_frequency,
global_settings.rec_quality,
global_settings.rec_source,
global_settings.rec_channels,
global_settings.rec_editable,
global_settings.rec_prerecord_time
global_settings.rec_left_gain
global_settings.rec_right_gain

Registers:

0xC - left volume
0xD - Right volume

Global Variables:

HZ

Max fireware size:

error: max firmware size is 200KB!

Buttons:

/* Recorder specific button codes */
#define  BUTTON_ON            0x0001
#define  BUTTON_OFF           0x0002
#define  BUTTON_PLAY          0x0004
#define  BUTTON_UP            0x0010
#define  BUTTON_DOWN          0x0020
#define  BUTTON_F1            0x0100
#define  BUTTON_F2            0x0200
#define  BUTTON_F3            0x0400
#define  BUTTON_RC_PLAY       (BUTTON_PLAY | BUTTON_REMOTE)
#define  BUTTON_RC_STOP       (BUTTON_OFF | BUTTON_REMOTE)

Interface Design

Interface Design 1:

 + Mode:   [0-8]
   Gain:   [0-10]
   Volume: [0-100]
   Bass:   [0-8]
   Treble: [0-8]

Interface Design 2:

   Gain Vol  Bass Treb
   xxx  xxx  xxx  xxx
   Period:   [0-2000]ms
   Deviation:[0-50]
 + Volume:   [none|saw|tri|sqr|rand]
   Bass:     [none|saw|tri|sqr|rand]
   Treble:   [none|saw|tri|sqr|rand]

DEVMS Flowchar

Flowchart

DEVMS Program Variables

#define SOURCE_MIC   0
#define SOURCE_LINE  1
#ifdef HAVE_SPDIF_IN
#define SOURCE_SPDIF 2
#define MAX_SOURCE   SOURCE_SPDIF
#else
#define MAX_SOURCE   SOURCE_LINE
#endif

#define DEBUG_DEVMS YES

/* Modes */
#define MODE_GAIN   0
#define MODE_VOL    1
#define MODE_BASS   2
#define MODE_TREB   3
#define MODE_PRD    4
#define MODE_RPRD    5
#define MODE_DEV    6
#define MODE_VOLD   7
#define MODE_BASD   8
#define MODE_TRBD   9

/* Distortion Modes */
#define DIST_MODE_NONE    0
#define DIST_MODE_SAW     1
#define DIST_MODE_TRI     2
#define DIST_MODE_SIN     3
#define DIST_MODE_SQR     4
#define DIST_MODE_RAND    5
#define DIST_MODE_RANDTRI 6
#define DIST_MODE_RANDSIN 7

/* Limits */
#define MAX_GAIN          15
#define MAX_VOL           96
#define MAX_BASS          15
#define MAX_TREB          15
#define MAX_PRD           128
#define MAX_RPRD          64
#define MAX_DEV           128
#define MAX_DIST_MODES    8
#define MAX_MODES         10
#define MAX_STEPS         15

/* Default values */
#define DEFAULT_GAIN      10
#define DEFAULT_VOL       70
#define DEFAULT_BASS      7
#define DEFAULT_TREB      7
#define DEFAULT_PRD       1024
#define DEFAULT_RPRD      0
#define DEFAULT_DEV       16
#define DEFAULT_VOLD      0
#define DEFAULT_BASD      0
#define DEFAULT_TRBD      0
 
/var/www/sites/dokuwiki/data/pages/projects/devry/develnotes.txt · Last modified: 2009/04/11 22:23 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki