Hello, When I compile a simple Hello World program in the Big Endian Format (with GNU tools) and test it on the flash, it does not print anything on my terminal. If I launch the same program in Little Endian, it's OK. To program the flash when I use the Big Endian Mode, I modified the file Flash.ini like this :
/***********************************************************************/ /* This file is part of the ARM Compiler package */ /* Copyright KEIL ELEKTRONIK GmbH 1992-2003 */ /***********************************************************************/ /* */ /* FLASH.INI: Flash Initialization File */ /* */ /***********************************************************************/ //*** <<< Use Configuration Wizard in Context Menu >>> *** FUNC void Setup (void) { // <h> External Bus Interface (EBI) // <e1.13> Enable Chip Select 0 (CSR0) // <o1.20..31> BA: Base Address <0x0-0xFFF00000:0x100000><#/0x100000> // Start Address for Chip Select Signal // <o1.7..8> PAGES: Page Size <0=> 1M Byte <1=> 4M Bytes // <2=> 16M Bytes <3=> 64M Bytes // Selects Active Bits in Base Address // <o1.0..1> DBW: Data Bus Width <1=> 16-bit <2=> 8-bit // <o1.12> BAT: Byte Access Type <0=> Byte-write // <1=> Byte-select // <e1.5> WSE: Enable Wait State Generation // <o1.2..4> NWS: Number of Standard Wait States <1-8><#-1> // </e> // <o1.9..11> TDF: Data Float Output Time <0-7> // Number of Cycles Added after the Transfer // </e> //_WDWORD(0xFFE00000, 0x01002429); // EBI_CSR0: Flash _WDWORD(0xFFE00000, 0x29240001); // EBI_CSR0: Flash // <e1.13> Enable Chip Select 1 (CSR1) // <o1.20..31> BA: Base Address <0x0-0xFFF00000:0x100000><#/0x100000> // Start Address for Chip Select Signal // <o1.7..8> PAGES: Page Size <0=> 1M Byte <1=> 4M Bytes // <2=> 16M Bytes <3=> 64M Bytes // Selects Active Bits in Base Address // <o1.0..1> DBW: Data Bus Width <1=> 16-bit <2=> 8-bit // <o1.12> BAT: Byte Access Type <0=> Byte-write // <1=> Byte-select // <e1.5> WSE: Enable Wait State Generation // <o1.2..4> NWS: Number of Standard Wait States <1-8><#-1> // </e> // <o1.9..11> TDF: Data Float Output Time <0-7> // Number of Cycles Added after the Transfer // </e> // _WDWORD(0xFFE00004, 0x040034A5); // EBI_CSR1: RAM _WDWORD(0xFFE00004, 0xA5340004); // EBI_CSR1: RAM // <q1.4> DRP: Data Read Protocol // <0=> Standard Read // <1=> Early Read //_WDWORD(0xFFE00024, 0x00000010); // EBI_MCR: Data Read Protocol _WDWORD(0xFFE00024, 0x10000000); // EBI_MCR: Data Read Protocol //_WDWORD(0xFFE00020, 0x00000001); // EBI_RCR: Remap Command _WDWORD(0xFFE00020, 0x01000000); // EBI_RCR: Remap Command // </h> } // Switching from Slow Clock to Main Oscillator for faster Download //_WDWORD(0xFFFF4020, 0x002F0002); // APMC_CGMR: Enable Main Oscillator _WDWORD(0xFFFF4020, 0x02002F00); // APMC_CGMR: Enable Main Oscillator _sleep_(10); // Wait for stable Main Oscillator //_WDWORD(0xFFFF4020, 0x002F4002); // APMC_CGMR: Switch to Main Oscillator _WDWORD(0xFFFF4020, 0x02402F00); // APMC_CGMR: Switch to Main Oscillator Setup(); // Setup for Flash
What device is executing the code? Is it big endian, little endian, or programmable? ARM devices are made all three ways. If the endianness is programmable, does your reset code initialize the endianness properly?
Sorry, I forgot to precise : This is a AT91M55800A in the board Phycore-AT91M55800A. You make me doubt... I tought that AT91M55800A supported both Big Endian and Little Endian because it is based on ARM7TDMI, but I just have a look at the datasheet and saw :
The ARM7TDMI processor address space is 4G bytes. The memory controller decodes the internal 32-bit address bus and defines three address spaces: • Internal memories in the four lowest megabytes • Middle space reserved for the external devices (memory or peripherals) controlled by the EBI • Internal peripherals in the four highest megabytes In any of these address spaces, the ARM7TDMI operates in Little-Endian mode only.
Vincent VILLOT cites the datasheet as saying: "the ARM7TDMI operates in Little-Endian mode only." Vincent VILLOT then asks: "Can I use the Big Endian with this device ?" Haven't you just answered your own question with that piece that you cited from the Data Sheet?!
Yes that's true :)