Vous êtes sur la page 1sur 12

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/251503198

Education of embedded systems: Design of a set-top box for streaming audio


applications on C6711 and MSP430 devices

Article · January 2002

CITATIONS READS

0 243

4 authors, including:

Marc Leeman Vincenzo De Florio


Institute of Electrical and Electronics Engineers Vrije Universiteit Brussel
17 PUBLICATIONS   81 CITATIONS    163 PUBLICATIONS   1,225 CITATIONS   

SEE PROFILE SEE PROFILE

Geert Deconinck
KU Leuven
426 PUBLICATIONS   3,824 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Fractal Social Organizations View project

P2P SmarTest Project View project

All content following this page was uploaded by Vincenzo De Florio on 12 February 2014.

The user has requested enhancement of the downloaded file.


Education of embedded systems:
Design of a set-top box for streaming audio applications
on C6711 and MSP430 devices

Marc Leeman, Francisco Barat, Vincenzo De Florio, Geert Deconinck


ACCA/ESAT KULeuven
Kasteelpark Arenberg 10
3001, Heverlee, Belgium
firstname.lastname@esat.kuleuven.ac.be

Abstract by requiring power efficient systems, to be implemented in


ubiquitous, hand held devices. But still, the manufacturer
In this paper, a design seminar on embedded systems is that is able to offer that extra bit of functionality or perfor-
described for fourth year students in the Multimedia and mance at the same or lower cost has a definite advantage
signal processing option at our electrical engineering de- in a very competitive market often characterised by techni-
partment. The goal of this seminar is to confront the stu- cally proficient customers. Secondly, with the progress of
dent with the design a real life example in order to ease up chip design, the functionality of the embedded processor in-
the adaptation of the universitary curriculum to what is ex- creases up to a point that a lot of these can almost compete
pected by industry of a high level engineer. The project cov- with general purpose processors1 .
ers multiple expertise areas, programming techniques and In order to cope with this kind of changing environment,
languages, development tools and hardware platforms in the systems developed must be modular and attention needs
order to develop a prototype of a set-top box with off-the- to be put on correct integration. A modular system makes
shelf tools, hardware and software. The interdisciplinary sure that last minute implementation or functional changes
character of this seminar combines multiple topics taught can be localised and do not affect the entire embedded soft-
in courses in the application. ware system. It also enables the reuse of previous software
modules and third party software, as well as easy integra-
tion.
1 Introduction One of the problems with an academic curriculum is that
there is a gap between the skills of the students that grad-
Embedded Computing has become ever more pervasive uate and what is expected and required by industry part-
over the last decades and this evolution has only touched ners. Because of this and the quickly changing nature of
the surface of the myriad of possibilities. Every day, new or the state of the art technology, the engineering programme
more challenging applications are conceived and researched was reformed at the University of Leuven with these ex-
in companies and universities. Despite this promising fu- pectations of industry in mind, the need for well qualified
ture, the education of the techniques that lie at the basis engineers and in an effort to revitalise engineering [11] a
of these applications (e.g. programming optimisation and couple of years ago. More stress is put on implementation
power consumption aware programming techniques) are of a system and not just on its design. Next to a series of
sometimes neglected in favour of new programming con- renewed courses, a design seminar was scheduled to im-
cepts that may or may not prove to be useful in real life. plement a multimedia application, with signal-processing
Efficiently mapping an algorithm to an embedded system specific hardware in the Multimedia and signal processing
has always been a challenging task. A number of technical option [20], [12].
and non technical reasons account for this. First of all, em- This paper describes a design seminar that was introduced.
bedded systems have always been quite cost sensitive (the In section 2, the goals and constraints of the project are de-
maximal functionality has to be mapped on the cheapest de- scribed. The topic of the next section is the hardware and
vices). Where the main focus had been to get sufficient
functionality on the system, it has been now complicated 1 And all this should be done by yesterday

1
software architecture and the differences to the software ar- sign is considered. Furthermore, these readily avail-
chitecture are pointed out in the two editions of the semi- able components are often available at a much lower
nar. In section 4, practical solutions from the students and cost than a in-house developed solution. In this sem-
the work of the students is elaborated. This paper concludes inar, the requirements are defined so that no custom
with a general overview of attained goals and some possible hardware needs to be developed.
changes and improvements.
off-the-shelf software : the same reasoning applies for the
software modules that are used.
2 Project Contents and Problem Description
In a digital world were data is intercepted analysed and
scrutinised by unauthorised third parties, secure communi-
In this section, the assignments to the students are de-
cation is important, A number of limitations that will be de-
scribed, from the initial concept that was implemented
scribed in more detail in section 3.2.2 required a review of
in the first edition, to a more complex modified version
the problem description. Since CD quality audio transmis-
that took hardware limitations into account and was imple-
sion was not possible with the current hardware, the system
mented in the second edition. It also introduces the software
was changed to a peer to peer (P2P) secure speech transmis-
and hardware components that were integrated in the final
sion system.
systems.
Over the last years, a lot of controversy arose around the
distribution of copyrighted material over the Internet. This 3 Application and System Description
medium allows world-wide and fast distribution at a low
cost and results in claims of huge losses by the audiovisual This section provides a detailed description of the main
industry. More importantly, due to judicial actions, lobby- hardware and software components of the target system.
ing and strict legislations, service enterprises found them- The application functionality to be supplied by these com-
selves faced with the de-facto obligation to strongly protect ponents is also described.
their copyrighted goods from unauthorised copying when
distributing it. On the other hand, commercial exploitation 3.1 Hardware
of the Internet as the largest and ubiquitous mall, gives these
companies a strong incentive for the introduction of secure, The hardware choice was done in the preparation phase
Internet-aware embedded systems and software integrated of the seminar. Each subsystem (client or server in the audio
in e.g. hand-helds, mobiles, . . . distribution case, or peer to peer (P2P) in the secure speech
From the very start of the project, confronting the stu- transmission case) consists of a Digital Signal Processing
dents with a challenging, real life example was one of the (DSP) to do the number crunching and a microcontroller
top priorities. As with most students, this audio example is (µc ) to control the operations of the system and provide a
a problem they are confronted with almost on a daily ba- simple user interaction.
sis. The initial problem description was selected among a Due to our past experience with Texas Instruments (T I),
set of industry relevant scenarios: to develop a transaction the fact that they occupy the largest market segment (and
based client/server system that enabled secure transmission as such, a high probability that the students would en-
of CD quality music. This e-commerce allowed one party to counter that hardware while working in embedded de-
consult a music repository and allowed ordering any num- vices after graduation), the choice was made to use the
ber of audio files. Every transaction needed to include price T MS 320C6711 Developers Starter Kit (DSK) [3]. The
negotiation (between server and client) and credit approval DSP on this DSK is a very large instruction word (VLIW)
(client). DSP, running at 166 MHz, has 128 KB two level cache,
The two key factors are authentication and encryption: 16 MB of external memory, combined with an integrated
authentication assures that the recipient of the data stream development environment (IDE): Code Composer Studio
is the one he is claiming to be and encryption ensures that [18]. The performance of the DSP also makes certain
the data stream cannot be used by anyone but the intended that there is additional room for functional upgrades and
recipient. The set-top prototype was designed with the fol- changes by the students. The Code Composer Studio soft-
lowing restrictions: ware offers a clear C and assembly programming IDE, an
interface to the DSP/BIOS II Real Time Operating System
off-the-shelf hardware : time-to-market is important in (RTOS) that enables modularly extending the system.
industry. This requires using standard components On the other hand, the operation of each DSP is con-
where possible and integrating them in the application trolled by a µc . Next to this, other important task are to
that is developed. Only when strict requirements have provide the needed user interaction by steering a LCD dis-
to be met (power consumption, I/O, . . . ) a custom de- play and reading input from a small keypad, setting up a

2
Figure 1. The system setup. On the left hand site, the full system is displayed, on the right hand site
the key components. 1: the ’C6711 DSK board, 2: the MSP430 controller, 3: the custom designed
daughterboard, a: the LCD display, b: the keypad, c: audio input, u: audio output

secure link between the boxes and checking the credit va- 3.2 Software
lidity of a client. The MSP430, also from T I was selected
for the seminars. Considering the specifications (discussed The functionality of the original secure audio distribu-
more in Section 4.4.1.2), the entire program would have to tion system and the secure speech transmission system is
fit in 1 kB of memory, the allocation of every byte in order to slightly different. First, the audio example is explained and
meet the software functionality would have to be measured in a subsequent section, the most important changes for the
carefully. While the software of the DSP gave a graphical speech example are highlighted.
interface to the hardware and to the RTOS functionality, the
focus of the µc was completely the opposite, programming
3.2.1 2001: secure audio distribution
was done in a basic editor and the program was sent over
the serial port to the µc board. The most important functional blocks of the audio distri-
The final system is seen in figure 1. Every system (on the bution system to be integrated are shown in figure 2. The
decoder as well as on the encoder side) has the following following steps are distinguished:
components:
Capture: Audio is offered in some form to the set-top box.
During the design of the prototype, the precise defini-
• 1 TMS320C6711 DSK board tion of the source is not yet made, but the inclusion
of analog to digital conversion only makes the system
more flexible. If the audio was already stored in dig-
• 1 MSP430 microcontroller with a keypad and an LCD
ital form (which is very likely), the Analog to Digital
screen
Converter (ADC) step would have to be removed and
replaced with the new data source. The ADC converter
• 1 communication DSK daughter board on the DSK board is used for the conversion of the au-
dio to PCM samples.
For interfacing the DSK with the µc , there was no read- Compression: Since the data should be delivered to a
ily available solution. After some hardware analysing, cus- range of customers over the Internet, distribution needs
tom daughterboard was developed to fit on the DSK exten- to be done in a form that consumes the least bandwidth
sion slots. This daughter board centralises the most impor- for the quality required (a combination of customer
tant connections on the system: DSK with µc , serial DSK- downstream bandwidth limitations and expensive up-
DSK and serial µc -µc communication and connecting the stream -server- reduction). We chose the MPEG1 layer
µc with the keypad. An important advantage is its robust- III audio compression (MP 3) [15].
ness, since the system has to be assembled at the start of
every session and disassembled afterwards. The system is Encryption: Encryption of the audio stream covers two
connected with a cable with two SUB D9 connectors. different problems. First of all, the data stream must

3
Figure 2. System description: software chain secure audio distribution system.

be encrypted in such a way that only the designated re- Coder Elapsed Time Portability
cipient gets access to the decrypted data. Secondly, the Blade 1’02” problematic
validated recipient of the audio steam should only be Lame 0’40” high
able to decipher the data stream as long as he/she has Gogo 0’24” low
provided enough credits. If the credit runs out, the data
stream should become unusable. The latest encryption Table 1. Evaluation of different MP 3 encoders
standard is chosen for this task, known as Rijndael or (elapsed time and portability), Highway to Hell,
AES [6], [7], [2]. 3’28”.

Serial connection: in order to transmit the data to the em-


bedded system counterpart, a communication link of coding2 was done on an AMD 650 PC3 , 512 MB SDRAM
some nature is required. Instead of using a full fledged on a single song [21]. The gogo [14] encoder is a hack
communication system, a serial link was chosen. As of the lame [16] encoder which is partly written in assem-
with the audio capture, this gives the students detailed bler. For this reason, it is not usable on the DSP platform
knowledge of the hardware. The prototype system has without rewriting the assembler part. Both the blade [10]
to be able to recover from errors in this serial connec- and lame encoders are fully written in C, but the memory
tion, when it drops or corrupts data for some reason management and usage in the blade encoder makes the
and restart normal operation as soon as the communi- portability to an embedded system problematic.
cation is restored. It does not have to correct the faults.

Equalising: this functionality is added on the client side. Decoding the stream is not such a intensive task as encoding
The user of the client device must have the ability to it. Since the same computational power is available on the
tweak the audio with a 4-band equaliser and volume client side as on the server side that does the encoding, the
control. cycle budget should not pose a problem. Still, this should
not be a reason to implement a slow solution into the pro-
On the client side, the complementary tasks are done: de- totype, the final system might include less performant (and
cryption, decompression (MP 3 to PCM) and Digital to Ana- less expensive) hardware. The choice of a MP 3 decoder was
log Conversion (ADC). As can be seen on figure 2, a num- easier, mostly because the most important public domain
ber of software modules are not yet described. These are decoder is very good:
practical problems that need to be solved during implemen-
tation in order to get a working system and will be discussed 2 Conversion from WAV format, RIFF (little-endian) data, WAVE au-

in section 4. dio, Microsoft PCM, 16 bit, stereo 44100 Hz to MPEG 1.0 layer III audio
stream data, 128 kBit/s, 44.1 kHz, jstereo.
The decision of the implementation was based on testing 3 Running Debian 2.2r2 (Sid), Linux and the GCC compiler 2.95. The
of the different available public domain coders. The results compiler options used are those found in the Makefile. For the gogo and
of this are summarised in table 1 for the encoders. The en- the lame encoder, this was -O3 and for the blade encoder, this was -O2.

4
Figure 3. System description: software chain secure speech transmission system.

1. Most public domain MP 3 decoding use some form of buffered the data to enable some operations (encryp-
the mpg123 decoder [9]. tion on blocks of data, an MP 3 block has 1142 sam-
ples) made the synchronisation process slow.
2. There is a trimmed down version available in the
source tree of mpg123. These concerns were addressed in the following edition by
modifying the problem to a secure speech transmission sys-
3. Searching on the Internet showed that this de- tem. The change in functionality was also reflected in the
coder could even be used on older systems as an system design (figure 3):
80486DX2 [1], which makes it fast. serial communication : While the secure audio transmis-
sion example was based on a client server system, a
The encryption and decryption code was obtained from
server sending data to the client, the P2P secure speech
the K.U.Leuven, where the Rijndael algorithm was devel-
link needs (at least half-duplexed) two-way commu-
oped [6], [7].
nication. This requires that all the code needs to be
present on one system (no distinction between server
3.2.2 2002: secure speech transmission and client anymore). The bi-directional link also en-
abled the removal of the µc -µc link and letting the
The choice of the hardware, combined with the software control communication go over the DSK-DSK serial
modules put some additional constraints on the system that link. This reduced hardware complexity and µc func-
became evident after the first design seminar. The most im- tionality requires a complex routing of data between
portant technical issues were: the modules.
sampling : The C6711 DSK boards have a ADC converter subband en/de-coding : In order to reduce latency, com-
that is limited to a mono 8 kHz sampling rate, while bined with the introduction of more hands-on pro-
typical CD quality is at stereo 44.1 kHz. While this gramming4 , the MP 3 code was replace with custom
obviously does not influence the functionality of the designed subband encoding and decoding (C code).
system, it has a clear effect on the produced audio.
functional specialisation : Due to the increased complex-
clock drift : In line with the intend of these low cost starter ity of the overall system, it was no longer feasible
kits, the boards are equipped with cheap clocks that to split people in client and server teams, also be-
steer the ADC/DAC converters. As such, there is a cause the full functionality is in every box. Instead,
considerable clock drift between the capturing and groups were assigned to do more software develop-
playback clocks (up to 0.8). This problem can be ment (en/de-cryption and subband en/de-coding) or fo-
solved in software by including a re-sampling mod- cus on hardware integration (µc and DSP).
ule, however, a synchronisation time is needed. In 4 In the first edition, practical C knowledge and programming practice

combination with the chain that was implemented that proved to be a larger problem than anticipated.

5
4 Design Seminar: Building a Prototype is a slight drift between the clocks of any two boards.
The students had to write synchronisation code to com-
This section reports about the actual design seminars. pensate for this.
The work done by the students in the design seminar is de-
scribed, with a special focus on the implementation on the equaliser: On the client side, the equaliser code has to be
DSK and µc platforms. While designing the secure audio plugged in.
distribution system, all students had a lot of hardware pro-
gramming, while in the secure speech transmission system,
about half had the same hardware oriented focus, the rest of Framing of the Data In order to write the wrapper code
the students worked on the DSK, mainly to test their algo- for each subsystem (client or server) to integrate the func-
rithms. tional modules, detailed knowledge of the interfaces of soft-
ware modules is needed. This is then used for correctly
4.1 2001: secure audio distribution system processing the data. After some initial C tackling and fa-
miliarising with the T MS 320C6711 DSKs and the I DE,
All teams (DSP and µc ) consisted of 2 to 3 persons, with the groups completed the initial integration of the software
about 16 DSP teams and 4 µc teams. In turn, the DSP teams modules without problems.
were divided in the ones that would work on the client side After the development of the wrapper code on the client and
(decoder) and the ones on the server side (encoder). In the server side, the first integration phase is required: the one
first part, the DSP work is explained. The second part will concerning the two DSK boards.
go into the work done by the people that were assigned to When the data is transmitted over the serial line, the
the µc tasks. frame information is lost. To the receiver, the data is noth-
ing but a continuous stream of bits. Obviously a trial and
4.1.1 DSP work error approach of trying to decrypt the n×128 byte blocks5
(shifting a bit to the left every time an error was produced)
The students had to get a prototype of the secure audio is not a viable option.
transmission system working within the time frame defined One solution the groups opted for, was to agree on a
by the duration of the seminar. This is regarded as a hard fixed length an encrypted block of data would be. Next,
deadline. All the publically available software modules each block would be encapsulated by a header the client
were collected before the seminars. The main task of the and server developers agreed upon. The client software
DSP groups was to integrate these within the T I DSP/B IOS then scans through the received data bitwise until it iden-
Real Time Operating System (RTOS) [4]. tifies such a header. At this point, the client is sure that the
The software modules as described in section 3.2.1 had next n × 128 bytes do not contain this header anymore. It
to be integrated. To this end, a pipe structure was used [17], then copies these bytes into the decoding buffer.
readily available in the DSP/B IOS environment. These Another solution was to include the length of the data-
pipes isolate the modules, making their operations indepen- block in the frame header instead of predefining this length.
dent from each other. In order to write this code, a rudimen- When this option is used, the server controls the length and
tary knowledge of how the code uses its buffers is needed the client adapts its operations. This solution is obviously
and the wrapper code must adapted to this (see figure 4). more flexible, though in practice there is no difference since
These software modules were given at the start of the sem- the length of the data block is not changed once the system
inar (MP 3, encryption and serial communication), mainly is running.
motivated by the fact that the code is readily available from
the Internet. As a result, not giving these would only delay
the project without providing much added value. Resampling PCM Data and the Equaliser The next
Still, the following problems needed to be solved: problem the prototype developers were confronted with, is
transmission: As long as the data is on one board, it is easy that the quality of their decoded music was very low6 [19].
to retrieve the data at any point, since the programmer Some groups experienced very slow playback with discon-
knows in what format and in what buffer it is written. tinuities, while others had the problem that the sound was
When the data is transmitted over the serial line, this too high pitched, intermitted with short bursts of random
is not the case anymore. Code had to be written to 5 128 is the element size of the encryption algorithm. The encrypted
recognise the data packets on the other (client) side of data blocks should be a multiple of 128 bits.
the system. 6 The DSK boards have a sampling limit of 8 kHz mono sampling fre-

quency. The best sound quality is at any time telephone level. This in
resampling: There is a particular problem with the Analog contrast with the more expensive Evaluation board Module (E VM) that has
to Digital/Digital to Analog Converter devices. There a 48 kHz capability.

6
Figure 4. Interfacing software modules with DSP/BIOS in Code Composer Studio

noise7 . The groups on the decoder side developed to different


The first possible problem to eliminate was to check if solutions:
the data does not get corrupted along the way. After remov-
ing this possibility, the groups started testing the hardware • All the data is decoded. If no buffer is available to
and came to the conclusion that the behaviour of their pro- write the decoded data in (DAC clock is too slow), the
grams changed with the combination of DSK boards they data is dropped. If there is not enough data to keep
were using, reducing the search space to the boards. In the DAC busy, padding is applied. The main strength
order to identify the problem as being drifting clocks, the of this example is that the client knows exactly how
students had to know the details of the DSK board. much data is dropped or padded and will have a exact
The data flow in the MP 3 chain is largely governed by resampling ratio based on these values.
the rate at which the data is sampled, since the release of
• Another solution was to check if the PCM data will
a buffer triggers a software interrupt that fires the next pro-
be played before the MP 3 frame is decoded. If the
cessing module in the pipe (see figure 4). In turn, this mod-
DAC has enough data queueing, the frame is dropped.
ule produces a new batch of data, releases it, which fires a
This approach has a larger granularity but minimises
new software trigger. In the case of the MP 3 system, the
the DSP load by not decoding unneeded values. It also
data entering the system is the sampled audio. At the end
uses a step-wise change in the resampling factor, mak-
of the chain (on the client side) there is a discontinuity: af-
ing it harder to converge towards a resampling ratio
ter the decoding, data is consumed by the Digital to Analog
that reflects the exact client/server clock drift unless a
Converter (DAC) at a fixed rate (its clock speed), instead
more complex system is used that compensates for this
of being triggered (see figure 5). At this point, one of the
effect.
following problems is most likely to occur:
By this time, the groups working on the DSP had a sys-
• If the Analog to Digital Converter (ADC) clock on the
tem that captured, encoded and encrypted the data, trans-
server side is faster than the DAC clock on the client
mitted it to the counterpart client board over a serial line.
side, the music that is played back would be too slow,
This stream was then again converted to PCM data and put
dropping data when the buffers are full. This accounts
on the speakers. The entire system was able to compen-
for the discontinuities in the sound.
sate for the drifting ADC/DAC clocks and after a couple of
• If the ADC on the server side is slower than the DAC seconds, the system self-stabilised. Adding an extra mod-
clock on the client side, then there is not enough data ule just before the DAC to perform equalising was quickly
to be be put on the output line and buffer underruns done.
occur.
4.1.2 Microcontroller
Since it is generally possible that multiple clients, each
with a different DAC clock, connect to a single server, the On the µc side, each group had access to two TI MSP430
adaptation had to be made on the client side. A requirement microcontrollers [5] with a clock frequency of 8 MHz.
that was added, once the groups identified the reason for the These microcontrollers have a 16-bit RISC architecture, 16
poor audio quality, was that any solution they come up with, integrated registers on the CPU, built-in hardware multipli-
had to be independent from any combination of boards. cation, and communication capability using asynchronous
7 The
(UART) and synchronous protocols. A digital-controlled
random noise was built in the serial communication code to indi-
cate to the students that something was wrong. This enabled the students
oscillator, together with the frequency lock loop, provides a
to make the distinction between a crash of the boards (by e.g. overwriting fast wake up from the low-power mode to the active mode
program memory) and functional problems in less than 6 µs, which makes this product a good candidate

7
Figure 5. Data stream discontinuity: DAC pulls data out the system

when fast real-time response and extended battery lifetime pair. However, the keys are passed to the DSK byte
are both important design requirements. by byte. If the DSK used these new bytes immedi-
Unfortunately, the systems were configured with just 1 ately in its 16 byte (128 bit) key, the data would get
KB of RAM, which makes it almost an impossibility to corrupted. To avoid this, the µc passed the new key,
write software via any high level language. Hence, an addi- and only when it got confirmation that all keys arrived
tional requirement for the microcontroller groups was that and were processed, it generates a signal to the DSK to
of using the MPS430 assembly to develop their software. A start encrypting with the new key-pair.
front-end software by TI was available, which also allowed
In the implemented µc -DSK communication protocol, the
students to debug their code via step-by-step executions and
µc has to check if a command is received and processed. To
breakpoints.
this purpose, it keeps a counter for each command it sent
After some familiarising with the system, the students
and then waits. The DSK in turn, returns the command it
had to learn how to use the system and its software. Imme-
received combined with its own counter of the number of
diately after this preliminary step, they were asked to de-
commands it had received. After successful comparison by
velop a driver for the keypad. As an example, the source
the µc , the µc can send a new command, else, it resends the
of a driver for printing strings on the LCD was given to the
last command.
students.
After this, the students were asked to set up drivers for
the communication between the microcontrollers (via the 4.1.3 Integration: DSP and µc
UART) and to their slave DSP (via parallel ports). Again, The last step of this design process is on the integration
example code was available to provide hints to the groups. sessions, in which the microcontroller groups and the DSP
Then the students had to develop a port-to-port protocol groups had to work together to set up the entire application.
between DSP-µc including the following requests: Up until this point, the both teams had only used specifica-
encryption keys : encryption needs two keys, the first one tions and agreements they made.
is the encryption key that is used to encrypt and de- The communication from the µc to the DSP was done by
crypt the data. These keys are generated by the µc and writing into a 16-bit register on the daughterboard. This reg-
passed to the DSK boards. The keys are generated on ister was mapped in the DSP memory hierarchy and raised a
the server side µc , sent to the client µc and this one hardware interrupt to the DSP. Writing from the DSP to the
passes the keys to client DSK. µc is done by writing to a 8-bit register on the daughter-
board (again memory mapped). The µc polled this register
integrity key : this is the second of the key-pair needed for to see if the contents had changed,
encryption. This one is used to check if there was any Once the basic system as described worked, a couple
tampering with the data block. It adds an extra level of groups invested their remaining time in adding functional-
security. ity to the system. This was not longer separated, but tightly
equaliser : the user enters or changes the values of the coupled since new commands had to be agreed upon. Also,
equaliser bands to adjust the music quality. This is a the µc groups had their programming memory filled. In or-
client-only task. der to tweak out that last bit of functionality, we saw that
they started moving functionality off the µc on the DSK
change keys : a generated key-pair has a limited lifetime. boards. Space was then freed for (additional) control tasks.
The servers side µc keeps a counter to see if the key- Two of the important added features are the inclusion of a
pair is still valid. If it is not valid, it generates a new start/stop button on the client side and the server warning

8
the client when the time was about to expire. They could similar to the code developed by the teams in the previous
then start negotiating on a next time frame, before the cur- year, with one important difference: they had to compensate
rent audio stream was encoded with a new key the client did between different types of data being sent over the serial
not have. line. Instead of pure data, the following types could now be
Because of the clear system description, this integration sent:
was done seaminglessly and well within the budgeted time
of two sessions. encryption negotiation : In the previous edition, the
server µc generated a key-pair and passed it along to
4.2 2002: secure speech transmission system the client µc via the µc -µc serial link. In the speech
system, the functionality was extended with Diffie-
In the second edition of the design seminar, the teams Hellman key initialisation [13]. Since there is no en-
were divided into functional groups: 1 group working on the cryption key, this data is not encrypted and should be
development of subband encoding and decoding, another directed at the AES modules (see figure 3).
group working on encryption and decryption, one group on µc control commands : Instead of using a µc -µc link,
the µc , one group on the serial communication between all communication is done via the DSK-DSK link.
both DSK boards and one group on the framework that tied Such command data should be recognised and directed
the system together. Every group consisted out of 2 to 3 to the microcontrollers.
persons.
data : The bulk of the traffic over the serial line consists of
4.2.1 DSP work data, subband encoded and encrypted audio.

One of the remarks the students had on the secure audio dis- The routing information is added to the framing header and
tribution system was that they did not have enough freedom the packet length. This way, when a header is identified, the
to develop a solution. Therefore, the amount of material destination (packet type) is extracted and the content is sent
given at the start was reduced, which included a more hit- to the correct module by putting it in a different buffer.
ting the metal approach for getting the e.g. serial communi-
cation to work accompanied with browsing through techni- 4.2.2 Microcontroller
cal manuals. Unfortunately, this work was hindered by two
main problems that we did not encounter during the previ- One of the problems of the µc -DSP communication scheme
ous sessions: of 2001 was the constraint that messages had to be a maxi-
mum of 16 bits from µc to DSP and 8 bits from DSP to µc .
ADC/DAC code : one of the first examples a student is In the last edition of the course, this limitation was removed
confronted with when starting to work with CCS, is by using a simple protocol that allowed the transmission of
the audio example. The code that was used in the first messages of arbitrary length between both processors. This
edition was based on the 1.2 version of CCS. The main allowed the transmission of complete keys in just one mes-
advantages were that it was clear and clean code for sage. Messages are divided in blocks and then reassembled
people to start with. This year, the CCS was upgraded on the target system.
to the 2.0 version. The modified audio example code Additionally, messages had a target address, which al-
was more complex and included some features to show lowed the µc to communicate with several modules (en-
possible problems at an advanced level. As a result, cryption, equaliser and the µc on the other side) in a uni-
much more time was spent on the familiarising with form and simple manner.
the tools and the example code and even rendering the Message transmission is always initiated by the µc . The
example useless for students to start with. µc periodically polls the DSP to see if there are pending
CCS bug : a DSP/BIOS configuration tool (cdb) related messages. If there are any messages, the µc requests the
bug generated erroneous C code from the graphical in- message byte by byte to the DSP and then reassembles it.
terface to the DSP/BIOS functionality. Identifying the In order to transmit a message, the µc sends the message
problem took some time. byte by byte to the DSP. When the message is received, it is
then redirected to the appropriate task.
On the other hand, the group working on the frame-
work code had little problems other than managing the large 4.2.3 Integration
complexity of their project. The introduction of the bi-
directional communication required much more interaction The groups each developed their part of the system sep-
with the RTOS by defining the correct software interrupts arately, but needed to communicate with others to estab-
and buffers. The framing code developed was more or less lish interfaces (mostly algorithmic encryption and encoding

9
people with the framework team and the µc team with the • In the secure audio distribution system, a working pro-
framework team) and agreements had to be reached. One of totype was set up within the budgeted time.
the most prominent things to notice was how the different
teams developed their own emphasis and view of the func- • When the sessions were in danger of running out of
tionality of the global system. time, rescheduling of the groups was done in order to
The code of the serial communication was integrated get the system working. The time needed for the im-
with the framework. The framework code processed com- plementation (and familiarisation) on the systems was
mands from the µc and passed it along the serial line. underestimated. It took the students more time than
Unfortunately, a fundamental problem prevented the final expected to understand the logic of the DSK and the
integration of the software modules into this hardware- development tools (DSP/BIOS). Due to delays with re-
dependent code. The decision to let some people work on spect to the initial planning, the prototype would never
the development of algorithms in C was inspired by the im- be completed within the time of the seminar. In the
portance of C in commercial code and implementations and first edition, this was done by splitting up the work that
the fact that this seminar was the first real hands-on expe- needed to be done in subproblems and assigning these
rience most students had with this language. However, a to different groups. In the second edition, such a divi-
working C program is not identical to good C code, and sion was already done from the start, but when a group
especially embedded devices (DSP) are sensitive to this. encountered unexpected problems, another group took
The combined project did compile, but at run-time prob- over part of the work. This gave the participants ex-
lems were continuously detected, mainly caused by mem- perience in project management and inter-group coor-
ory handling. There was not sufficient time left to handle dination. These points were also very important in the
these problems. coordination of the integration parts (DSK–DSK and
DSK–µc ).

5 Conclusions • Some obvious oversights in the curriculum were fixed:


the students had to attain a profound knowledge of C
After two years, and two different sessions to let the stu- (and assembly programming).
dent get acquainted and get hands-on experience with em-
bedded systems, a number of conclusions can be made. As • The hardware platform and the provided tools are
for the goals that were set out at the start of the project, the good teaching tools and overall, the students found the
following were reached: course motivating.

A number of things that still need to be improved are:


• A thorough introduction into embedded systems was
offered to the students and the different areas involved • One of the remarks last year, was the lack of C knowl-
in embedding software: the technical hardware and edge. This year, the seminar started with a crash-
software side and the more interactive integration. The course (6 hours) into the basics of C and more em-
people on the DSP side had a clear idea of the inter- phasis was put on programming and debugging. Still,
nals of such a development system, and had mastered this is the most important recurring remark: the stu-
the basics of an operating system and put it to use. The dents realise the importance and are frustrated to some
same goes for the µc side. Since they were working degree that it is not more prominent in their curricu-
on a lower level (assembly) and on a simpler system, lum [8].
they knew the µc inside out. They got to know how to
squeeze out the last bit of functionality on a very con- • In a response to giving more design freedom, the pen-
strained (memory wise) hardware platform. Especially dulum swung too far to the other side. This combined
in the implementation of the secure speech transmis- with a steep learning curve when working with DSPs
sion system, the framework and the required logic to posed additional problems. In following editions, a
tie it together was complex and posed a challenge to middle ground must be found between these two.
the students.
• More attention has to be put on the quality of the pro-
• We believe that the environment provided to work in, duced C code by the people guiding the algorithmic
was closely reflecting the one of industrial projects. design groups.
On both of the major platforms, the problem was not
obvious and implementation issues were built into the • The tutorials need to be checked after an upgrade of
seminar sessions; issues that had to be solved by the the development tools. The audio example was too
students themselves. confusing to be in a tutorial session.

10
View publication stats
This seminar, with other initiatives to give engineering a [8] ESAT/KULeuven. Burgerlijk elektrotech-
much needed new appeal, gives the students an opportunity nisch ingenieur en burgerlijk werktuigkundig-
to apply the theoretical competence in a real-life applica- elektrotechnisch ingenieur richting elektrotechniek,
tion. Instead of giving additional courses for gaps in the 2001. http://cwisdb.cc.kuleuven.ac.
curriculum, this knowledge is now offered in a hands-on be/programmaboek/h/h15.htm.
manner. It offers also experience that cannot be learned in
classical sessions: social interaction, cooperation to obtain [9] M. Hipp. Mpg123 mp3 decoder, 2001. http://
results and a taste of the future. www.mpg123.de/.
This seminar is the first step in bridging the gap between [10] T. Jansson. Bladeenc, a free mp3 encoder, 2001.
industry and our university. With the experience of the past http://bladeenc.mp3.no/.
sessions and ideas from industry, these design sessions are
modified and extended to fit new requirements and evolu- [11] C. Kelly. Teaching from a clean slate. IEEE Spectrum,
tions. pages 59 – 64, September 2001.
[12] M. Leeman and F. Barat. Hj82 dsp seminar sessions,
6 Acknowledgements 2001. http://www.esat.kuleuven.ac.be/
˜mleeman/hj82/.
From the very outset of the project, the department got
large support from TI. They sponsored the hardware and the [13] A. J. Menezes, P. C. van Oorschot, and S. A. Vanstone.
best project team was given a TI award, including a set of Handbook of Applied Cryptography. CRC Press, 2000
DSK boards. The students that followed this design semi- Corporate Blvd., Boca Raton, FL 33431, USA, 5th
nar have to be acknowledged for their positive feedback and edition, 2001.
suggestions which gave a definite added value to the entire
project. [14] Shigeo. The gogo encoder, 2001. http:
Geert Deconinck is a postdoctoral fellow of the Fund for //homepage1.nifty.com/herumi/soft.
Scientific Research - Flanders. html/.
[15] M. Slager. Mpeg/audio, 1997. http://www.
References csclub.uwaterloo.ca/˜mpslager/
articles/mpeg/mpeg.html.
[1] Anonymous. Freshmeat, mpg123 description,
2001. http://freshmeat.net/projects/ [16] M. Taylor. Lame ain’t an mp3 encoder, 2001. http:
mpg123/. //www.sulaco.org/mp3/.
[2] Anonymous. Nist website, 2001. http://csrc. [17] Texas Instruments, Canada. User’s Guide Code Com-
nist.gov/encryption/aes/rijndael/. poser v3.0, Code Composer Simulator v 3.0, 1998.
[3] Anonymous. T I website, 2001. http://focus. [18] Texas Instruments, Nice,France. Code Composer Stu-
ti.com/docs/tool/toolfolder.jhtml? dio, Getting Started, 2001.
PartNumber=TMDS320006711%.
[19] Texas Instruments, Nice, France. TMS320C6201/6701
[4] Anonymous. T I website, 2001. http: Evaluation Module Technical Referencei (spru305),
//dspvillage.ti.com/docs/sdstools/ December, 1998.
sdscommon/showsdsinfo.jhtml?path%
=templatedata/cm/dspbios/data/ [20] L. Van Eycken. Seminaries ontwerpen ict: M&s:
overview_and_benefits&templateId=57. HJ 82, 2001. http://www.esat.kuleuven.
ac.be/˜hj82/2000-2001/.
[5] L. Bierl. MSP430 Family Mixed-Signal Microcon-
troller Application Reports. Texas Instruments, 2000. [21] A. Young, M. Young, and S. Bon. Highway to hell,
1979.
[6] J. Daemen and V. Rijmen. The block cipher rijndael.
In Smart Card Research and Applications, pages 288
– 296. LNCS 1820, J.-J. Quisquater and B. Schneier,
Eds., Springer-Verlag, 2000.
[7] J. Daemen and V. Rijmen. Rijndael, the advanced en-
cryption standard. In Dr. Dobb’s Journal, volume 26,
No. 3, pages 137 – 139, March 2001.

11

Vous aimerez peut-être aussi