Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: SAM9XE512 custom board
PostPosted: Tue Jul 31, 2012 2:44 pm 
Offline

Joined: Tue Jul 31, 2012 2:14 pm
Posts: 2
I have custom board based on SAM9XE512 cpu.
On board 32 Mb SDRAM with 16-bit bus width.
The linux works fine on this board.

I try to start stanalone "getting-started" application.
I have IAR 6.40 and J-Link ultra.
When I click "Download and Debug" in IAR it looks like j-link can't write the board SDRAM (0x20000000).
Here is the log:
===============================================================
J-Link V4.50d DLL Log
DLL Compiled: Jun 5 2012 19:43:01
Logging started @ 2012-07-30 15:22

T0C84 000:099 JLINK_Halt()
T0C84 000:105 JLINK_Reset() -- Type: 0 returns TRUE
T0C84 001:514 JLINK_ReadMemU32(0xFFFFFC30, 0x0001 Items, ...) - Data: 0x00000000
T0C84 001:674 JLINK_WriteMem(0xFFFFFC20, 0x0004 Bytes, ...) - Data: 01 40 00 00
T0C84 001:994 JLINK_WriteMem(0x20000000, 0x0044 Bytes, ...) - Data: 28 F0 9F E5 28 00 9F E5 ...
T0C84 002:297 JLINK_WriteMem(0x20000100, 0x33FC Bytes, ...) - Data: F0 4F 2D E9 02 50 A0 E1 ...
T0C84 042:019 JLINK_ReadMemU32(0x20000000, 0x0011 Items, ...) - Data: 0xFFFFFFFF 0xFFFFFFFF ...
T0C84 042:382 JLINK_ReadMemU32(0x20000100, 0x0800 Items, ...) - Data: 0xFFFFFFFF 0xFFFFFFFF ...
T0C84 077:466 JLINK_ReadMemU32(0x20002100, 0x04FF Items, ...) - Data: 0xFFFFFFFF 0xFFFFFFFF ...
T0C84 104:408 JLINK_ReadMemU32(0xFFFFEF00, 0x0001 Items, ...) - Data: 0x00000000
T0C84 104:568 JLINK_WriteMem(0xFFFFEF00, 0x0004 Bytes, ...) - Data: 03 00 00 00
T0C84 104:762 JLINK_ReadMemU32(0xFFFFEF00, 0x0001 Items, ...) - Data: 0x00000003
T0C84 104:922 JLINK_ReadMemU32(0xFFFFFC30, 0x0001 Items, ...) - Data: 0x00000000
T0C84 105:082 JLINK_WriteMem(0xFFFFFC20, 0x0004 Bytes, ...) - Data: 01 40 00 00
T0C84 105:278 JLINK_ReadMemU32(0x2000167C, 0x0001 Items, ...) - Data: 0xFFFFFFFF
T0C84 105:503 JLINK_ReadMemU32(0x00000008, 0x0001 Items, ...) - Data: 0xF9D8EEE5
T0C84 108:443 JLINK_ReadMemU32(0x1FFFFF00, 0x0020 Items, ...) - Data: 0xFFFFFFFF 0xFFFFFFFF ...
T0C84 108:993 JLINK_ReadMemU32(0x1FFFFF80, 0x0020 Items, ...) - Data: 0xFFFFFFFF 0xFFFFFFFF ...
T0C84 109:546 JLINK_ReadMemU32(0x20000000, 0x0020 Items, ...) - Data: 0xFFFFFFFF 0xFFFFFFFF ...
T0C84 110:099 JLINK_ReadMemU32(0x20000080, 0x0020 Items, ...) - Data: 0xFFFFFFFF 0xFFFFFFFF ...
T0C84 110:685 JLINK_ReadMemU32(0x00000000, 0x0020 Items, ...) - Data: 0xE87F3313 0xE97D32FF ...
T0C84 111:236 JLINK_ReadMemU32(0x00000080, 0x0020 Items, ...) - Data: 0x1A827299 0x9A5A84E7 ...
T0C84 111:785 JLINK_ReadMemU32(0x0000003C, 0x0020 Items, ...) - Data: 0x8752D19F 0x6FD80349 ...
T0C84 112:334 JLINK_ReadMemU32(0x000000BC, 0x0020 Items, ...) - Data: 0x36EF7576 0x14EC4717 ...
T0C84 112:902 JLINK_ReadMemU32(0x20000010, 0x0001 Items, ...) - Data: 0xFFFFFFFF returns 0x00000000
===============================================================
There are 0xff instead of real data (as I understand).

IAR reports the following warnings:
==========================================================
Tue Jul 31, 2012 15:39:16: Error while calling macro execUserPreload
Tue Jul 31, 2012 15:40:41: 11656 bytes downloaded and verified (0.13 Kbytes/sec)
Tue Jul 31, 2012 15:40:41: Warning:
Verify error at address 0x20000000, target byte: 0xFF, byte in file: 0x28
Tue Jul 31, 2012 15:40:41: Warning:
Verify error at address 0x20000001, target byte: 0xFF, byte in file: 0xF0
Tue Jul 31, 2012 15:40:41: Warning:
Verify error at address 0x20000002, target byte: 0xFF, byte in file: 0x9F
....
==========================================================

In the file board.h I changed the bus width on 16:
#define BOARD_SDRAM_BUSWIDTH 16

and the frequency of my board (12 Mhz) instead of 18432000:

/// Frequency of the board main oscillator.
#define BOARD_MAINOSC 12000000

/// Master clock frequency (when using board_lowlevel.c).
#define BOARD_MCK ((12000000 * 97 / 9) / 2)

What can see more to start application on my board?


Top
 Profile  
 
 Post subject: Re: SAM9XE512 custom board
PostPosted: Wed Aug 01, 2012 10:50 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
If it is anything like Keil with the J-Link/SAM-ICE there is a script for the debugger that pokes registers inside the chip, and configures the SDRAM controller, and SDRAM. It does this prior to downloading code.

Look at IAR Systems\Embedded Workbench 5.4 Kickstart\arm\examples\Atmel\resources\iar\at91sam9xe-ek-sdram.mac


Top
 Profile  
 
 Post subject: Re: SAM9XE512 custom board
PostPosted: Tue Aug 07, 2012 4:57 pm 
Offline

Joined: Tue Jul 31, 2012 2:14 pm
Posts: 2
Thanks for your answer. I've found file at91sam9xe-ek-sdram.mac and sdram initialization in it.
Changed bus width from 32 on 16 but see the same result. Will explore else sdram parameters.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: