STM32 Ipod Iphone Accessories Library - Presentation v0.2
STM32 Ipod Iphone Accessories Library - Presentation v0.2
General Presentation
15th
Analog audio:
UART communication for control and information Direct output of analog audio signals on the 30-pin connector
* : Fully compatibility : the API/library is based on Apple_Release_2010-9. Full Testing, characterization is on-going **IDPS: Identify Device Preferences and Settings mandatory for any new iPod accessory
Firmware summary
Cortex-M3 CPU 71.88 MHz
64 Kbyte SRAM
DMA
iAP Stack
Loudness Control Audio Class* HID Class* FS USB Host *
XTAL oscillators 32 kHz + 3-25 MHz
5 bands - Equalizer
IS
PLL block
Audio DAC
Amp
Speakers / Headset
USB
UART
I2C
SPI
Authentication Coprocessor
XXX
XXX *
USART
I2C I2S
DAC
Authentication Coprocessor
I2C
Suitable STM32F105 products: -STM32F105RCT6: 256K/64pins -STM32F105RBT6: 128K/64pins -STM32F105VCT6: 256K/100pins -STM32F105VBT6: 128K/100pins
Audio stream
Control data
8
Amplifier
1. Extension connector: straightforward connection to STM3210C eval board via CN1 and CN2 2. iPod/iPhone Authentication Coprocessor 2.0B class 6 (ACP) 3. iPod/IPhone connector 4. Hardware jumpers setting
I2C address selection for ACP module Accessory Identify : UART or USB Power select: iPod/iPhone board power source from iPod or STM3210C eval board
Audio Player
Tags Display MP3
Title : Chariots Of fire Artist : Vangelis Album :STMicroelectronics Genre : Instrumental Year : 1981
80 60 40 20
0:25
0:30
0 Mute
Mute Control
Home Repeat
*Karaoke
Game
Play Pause
Stop
iPod Player
Title : Chariots Of fire Artist : Vangelis Album :STMicroelectronics Genre : Instrumental
80 60 40 20
Audio Utilities
5 Bands Equalizer 5dB 2.5dB 0dB 2.5dB 5dB 1KHz 5dB 2.5dB 0dB 2.5dB 5dB 3KHz 5dB 2.5dB 0dB 2.5dB 5dB 6KHz 5dB 2.5dB 0dB 2.5dB 5dB 12KHz Loudness Control Max Gain 5dB 2.5dB 0dB 2.5dB 5dB 18KHz Min Gain Quit
Song Info
0:25
0:30
R Play
Audio Player
Tags Display MP3
Title : Chariots Of fire Artist : Vangelis Album :STMicroelectronics Genre : Instrumental Year : 1981
80 60 40 20
0:25
0:30
0 Mute
Mute Control
Home Repeat
iPod control is using digital audio (USB communication) This demo is NOT using any OS, but based on interrupts priorities MP3/WAV decoding, EQ, volume control, are all done by software within the STM32
11
Priority
SOF period
Mem to I2S transfer DMA transfer DMA transfer DMA transfer DMA transfer DMA transfer USB high priority tasks
IOE
Main loop
N x SOF Period
Asynchronous input events (Joystick & touch screen)
12
HCC stack resources: Flash: 37.34 Kbytes. Code: 37.16 Kbytes. RO Data: 0.18 Kbytes. RAM : 28.9 Kbytes. GUI: Flash: 19.90 Kbytes. Code: 13.09 Kbytes. RO Data: 6.81 Kbytes. RAM : 5.15 Kbytes. (4 Kbytes heap, 1 Kbytes Stack).
Connectivity Demo: Flash: 73.208 Kbytes. Code: 25.75 Kbytes. RO Data: 47.45 Kbytes. 8 Pictures (48 x 48 16bits). 1 picture (80 x 36 16bits). Zero filled buffer: 4 Kbytes. RAM: 2.03 Kbytes.
IAR C-standard library: FW HAL Drivers: Flash: 1.55 Kbytes. Flash: 9.75 Kbytes. Code: 1.55 Kbytes. Code: 9.71 Kbytes. RO Data: 2 bytes. RO Data: 38 bytes. RAM: 68 bytes. RAM: 60 bytes
iPod player(1/8)
iPod Player controls iPod internal player engine
Authenticate with the iPod. Synchronize screen contents with iPod Player (progress bar, total time, current time, song info). Sends Play, Pause, Stop, Fast forward, Fast Backward, Next track, Previous track and Repeat commands. Retrieve PCM data stream from iPod. Regulate output stream (Volume, audio post processing,...).
15
iPod player(2/8)
USB audio streaming
Two methods were implemented to handle the synchronization of data transfer from iPod to on board DAC(refer to next slides) apply additional filters (Equalizers or loudness control) and volume control
Stream synchronization
6 6
7 7
8 8
9 9
10 10 11
11
Accumulative error
2 1
5 3 4
6 5
7 6
9 7
10 8
11 9
Two methods were implemented to handle the synchronization of data transfer from iPod to on board DAC.
This method is enabled by default, to have High end Audio Quality 1:1 ratio ( lossless samples)
N-8
W
/4
W
/4 Left
N-6
N-5
Right
iPod player(7/8)
HCC USB audio class driver Audio post processing Priority Transfer complete SOF period
Mem to I2S transfer DMA transfer DMA transfer DMA transfer DMA transfer DMA transfer USB high priority tasks IOE Main loop Background tasks: (iAP stack and GUI)
Volume regulation with equalizer or Loudness control when enabled.
N x SOF Period
iPod player(8/8)
USB tasks scheduling avoid mutex dead locks and concurrency on the USB bus. Priority
USB High priority tasks call HCC Audio task & HCC transfer task
Time
HID report are sent only after higher priority tasks execution
Known limitation(1/5)
iPod tracks Tags: Only the Title, Artist, Album and Genre tags are extracted.
For Demo purposes.
iPod control application supports only iPod Accessory Protocol small packets.
For Demo purposes.
Audio quality may be not good with on board speaker, its due to the on board speaker quality. For a better experience please use a headphone.
23
Known limitation(2/5)
iPod control track information (stream length, Title, Artiste, Album and Genre) are retrieved when iPod sends new chapter or new track event notification. iPod control streaming : supported sampling rate are 48KHz, 44.1 KHz and 32KHz as in Apple specifications. Next/Previous track buttons allow navigation within the selected data base records.
24
Known limitation(3/5)
When MP3 player demo detect Bit rate variable (VBR) it will reset:
Time progress to 0:00 Stream Time length to 0:00 Then "VBR Detected." Message will be displayed.
Media browser: If the mass storage device contains a big number of files some of them may not be displayed.
This is related to the heap space allowed for GUI items and files/folders list. items and list are created dynamically (dynamic memory allocation).
25
Known limitation(4/5)
Maximum FIFO size set to 512 bytes: a received packet larger than 512 bytes will be improperly handled. Supported lingoes and minimal versions
Lingoes General Lingo Simple remote lingo Display remote lingo Digital audio lingo Minimal lingo version 1.02 1.00 1.02 1.02[1]
1. iPod is not switched to extended mode (please refers to iPod Accessory protocol specification for more info)
26
Known limitation(5/5)
Firmware design switch iPod to USB configuration 2 (composite USB device):
iPod mass storage feature is unavailable when connected to the STM32 docking station.
27