Objectives

Show RockBox running on some Free/Open hardware. After we can go to Olimex and ask them (or any others) If they are still interested on assembly and sell the hardware as a gadget on their online shop. We had contacted Olimex on 11 January 2007 and they said they will probably be interested and they even suggest a possible hardware configuration and price: AT91SAM9260? + LCD NOKIA 6610 + 8MB flash + 8/16MB SDRAM + nRF24L01 wireless chip + audio CODEC + Li-ion battery + charger + miniUSB + buttons, price in range of 100 ¤.

Version 1 of the LyreProject will be made on some development board having as base an ARM MCU. We should not seek to have exotic hardware, just simple and cheap, to try not spending time in coding drivers and spending money on some hardware that will change in future. Just do the necessary to have a functional hardware that plays audio from files stored on some kind of flash memory, and which displays files, audio information, on a display

Status of the project

Now there is a bootstrap code working that boots from DataFlash memory. There is also one test application flash_LED code that is started by the bootstrap. The application resides on DataFlash memory with the bootstrap. In the end, the application will be the Rockbox bootloader that will load the Rockbox firmware from the SD card FAT file system partition. Audio data files will also be loaded from SD card.

Hardware

At red we have the main board - Olimex SAM9-L9260 development board. We will use the MCU + SDRAM + FLASH + SD card connector + USB port. There is also the Power section, JTAG connection and an RS232 port, that were not drawn.

We will connect to that main board one custom secondary board, assigned as green in the image. The secondary board will have buttons, IC audio codec + earphone jack and color LCD.

Development board - Olimex SAM9-L9260

SAM9-L9260 is a development platform with ARM9 microcontroller, 64MB SDRAM and 512MB NAND Flash. The board have Ethernet 100Mbit controller, USB host, USB device, RS232 and 40 pin extension port with all unused SAM9260 ports available for add-on boards. Have a RTC clock which is backuped with 3V Li battery.

The AT91SAM9260? is the first member of a pin-compatible ARM9-based microcontroller family that shares the same programming model as ARM7-based controllers, allowing direct migration between controllers based on different ARM cores. It supports deterministic, real-time operation, offers supervisory functions, and has third-party support comparable to that for 8-bit microcontrollers.

The AT91SAM9260? is based on the ARM926EJ?-S processor, with 8K byte instruction and 8K byte data cache memories. It operates at 210 MIPS with a 190 MHz clock. It features 8K bytes of SRAM and 32K bytes of ROM with single cycle access at maximum processor or bus speed, together with an external bus interface with controllers for SDRAM and static memories including NAND Flash and CompactFlash?. Its extensive peripheral set includes USB Full Speed Host and Device interfaces, a 10/100 Base T Ethernet MAC, Image Sensor Interface, Multimedia Card Interface (MCI), Synchronous Serial Controllers (SSC), USARTs, Master/Slave Serial Peripheral Interfaces (SPI), a three-channel 16-bit Timer Counter (TC), a Two Wire Interface (TWI) and four-channel 10-bit ADC. Three 32-bit Parallel I/O Controllers multiplex the pins to/from these peripherals in order to reduce the device pin count, and peripheral DMA channels maximize the data throughput between these interfaces and the on- and off-chip memories.

The AT91SAM9260? has a fully featured system controller for efficient system management, including a reset controller, shutdown controller, clock management, advanced interrupt controller (AIC), debug unit (DBGU), periodic interval timer, watchdog timer and real-time timer. It is available in a 217-ball LFBGA RoHS?-compliant package and in a 208-pin Green QFP package.

The only feature that the AT91SAM9260? does not have is an integrated LCD controller. This limitation is met by the AT91SAM9261?. But we will defer using it since it is available only in BGA package.

LCD

We will use the Nokia 6610 Color LCD 128x128 plus a carrier board, as show in images. The carrier board of the LCD will be connected with the SAM9-L9260 development board using SPI and +3.3V and GND. The carrier board have a voltage step-up converter to power also de 6-7 volts background light (leds) of the LCD.

Buttons

We will use 8 buttons: 4 direction buttons (up/down/left/right), select, menu, play/pause and stop. Up and down buttons typical acts as volume up and down.

Software

Bootloader

The AT91SAM9260? will boot directly from NAND flash. The first 4kB bytes of the NAND flash are loaded into internal SRAM and executed by branching at address 0x0000_0000 after remap. This is automatically done by the AT91SAM9260? Boot Program - read more about on the section "NAND Flash Boot" at AT91SAM9260 datasheet.

1st stage bootloader

The 1st stage bootloader must not be more than the 4kB because it will be stored on the internal SRAM of the AT91SAM9260? - AT91SAM9260? have 4kB of the internal SRAM.

We will use the AT91 Bootstrap bootloader provided on the SAM9-L9260 development board. This bootloader will initialize, at least, the SDRAM and flash memory controllers. After It will load a code binary image from flash memory to SDRAM and jump to It, in our case, the 2nd stage bootloader.

U-Boot will help in development because we can communicate with him by ethernet and using TFTP, we can upload a new image of Rockbox to the NAND flash memory.

3rd stage bootloader

This bootloader is an application that will be launched by U-Boot.

At this stage, we need to use buttons, LCD and flash NAND memory. For flash NAND memory we must make an ATA driver, the functions: ata_init(), ata_read_sectors() and ata_write_sectors() - to initialize, read and write data to the flash NAND memory. We need to also to mount fat file system and for that we will re-use the code from others targets.

We will need to implement also the next tasks:

call system_init(); -- to re-initialize the ARM core??

call kernel_init(); -- to initialize the Rockbox kernel.

call spi_init(); -- to initialize SPI bus communications. We will use, at this stage, SPI to communicate with the LCD.

call lcd_init(); -- to initialize the LCD.

call button_init(); -- to initialize the buttons - configure the MCU IOs that connect to buttons, as digital inputs.

mount partitions of FAT file system, of the NAND flash memory ??

call load_raw_firmware(); -- to read Rockbox firmware from NAND flash, put it on SDRAM and jump to it.

Buttons

Keymap definitions for the various targets are in apps/keymaps/ - lines such as BUTTON_ON|BUTTON_UP indicate a button combination that the hardware allows. The keymap_h1x0_h3x0.c and keymap_gigabeat.c are probably most useful to look at, as they have a similar number of buttons. (note that BUTTON_REL and BUTTON_REPEAT aren't real buttons, they're used to indicate release and repeat events respectively).

LCD

This Nokia Color LCD 128x128 uses the Epson S1D15G10? Compatible Controller. There is drivers for the Epson S1D15E06? LCD Controller 2bit color 160x128 at IriverPort (IriverHardwareComponents), maybe the drivers for the Epson S1D15G10? Controller are similar.

There is the IriverH10Port that uses a 128x128 color LCD, should be nice to look at that code as example.