SAM-BA 2.10 Custom board programming problem.

Microchip in-system programming solution: SAM-BA

Moderators: nferre, fab

kc4ydx
Posts: 4
Joined: Thu May 13, 2010 4:59 pm

SAM-BA 2.10 Custom board programming problem.

Fri Jul 30, 2010 10:18 pm

I have the latest SAM-BA, 2.10 and am targeting a custom board with 16bit SDRAM. This board works fine if a pre-programmed flash is installed so I doubt there is any hard ware issues. Note: custom board had different row and column attributes than those used on ek board.
When I connect using the installed settings and applets I get an SDRAM failed to initialize error. This is understandable since the default bus width is wrong. I edit the target script to correct the bus width and I get the same error. Again, this is understandable since my Row/Col configuration is different than the default.
I tried correcting the memories.c file and recompiling extram but the recompiled applet hangs SAM-BA. So I re-installed SAM-BA 2.10 and compiled the extram applet with no changes. The new compiled applet hangs SAM-BA. either the compiler environment is bad or the source code has a bug.

Any suggestions?

USB attached.
Tool chain: arm-none-eabi-gcc (Sourcery G++ Lite 2008q3-66) 4.3.2
GNU Make 3.81.
nat
Contact:
Location: Atmel Rousset
Posts: 60
Joined: Mon Feb 16, 2004 1:34 pm

Re: SAM-BA 2.10 Custom board programming problem.

Mon Aug 02, 2010 3:10 pm

Hello,
On samba 2.10 to recompile an applet you need to use codesourcery version ( or upper):
arm-2010q1-188-arm-none-eabi for Windows.
kc4ydx
Posts: 4
Joined: Thu May 13, 2010 4:59 pm

Re: SAM-BA 2.10 Custom board programming problem.

Mon Aug 02, 2010 10:05 pm

OK, that didn't work.

This is with stock SAM-BA 2.10 files.
C:\Program Files\ATMEL Corporation\SAM-BA v2.10\applets\isp-project\extram>make
clean BOARD=at91sam9260-ek CHIP=at91sam9260 sdram

makefile:214: warning: overriding commands for target `debug'
makefile:214: warning: ignoring old commands for target `debug'
makefile:214: warning: overriding commands for target `debug'
makefile:214: warning: ignoring old commands for target `debug'

rm -f obj/*.o bin/*.bin bin/*.elf bin/*.map

arm-none-eabi-gcc -Wall -g -Os -I../../at91lib/boards/at91sam9260-ek -I../../at
91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat91sam9260 -D__A
SSEMBLY__ -Dsdram -c -o obj/sdram_isp_cstartup.o isp_cstartup.S

isp_cstartup.S: Assembler messages:
isp_cstartup.S:82: Error: cannot use register index with PC-relative addressing
-- `str r1,[pc,#-(8+.-isInitialized)]'
make: *** [obj/sdram_isp_cstartup.o] Error 1

C:\Program Files\ATMEL Corporation\SAM-BA v2.10\applets\isp-project\extram>arm-n
one-eabi-gcc --version
arm-none-eabi-gcc (Sourcery G++ 4.4-263) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Code: Select all

/* Update the is_initialized flag */    
    mov     r1, #1
    str     r1, [pc, #-(8+.-isInitialized)]
Tried again with a different tool chain. Looks like it is the one you specified this time. Still fails at the same place.
C:\Program Files\ATMEL Corporation\SAM-BA v2.10\applets\isp-project\extram>make
clean BOARD=at91sam9260-ek CHIP=at91sam9260 sdram
makefile:214: warning: overriding commands for target `debug'
makefile:214: warning: ignoring old commands for target `debug'
makefile:214: warning: overriding commands for target `debug'
makefile:214: warning: ignoring old commands for target `debug'
rm -f obj/*.o bin/*.bin bin/*.elf bin/*.map
arm-none-eabi-gcc -Wall -g -Os -I../../at91lib/boards/at91sam9260-ek -I../../at
91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat91sam9260 -D__A
SSEMBLY__ -Dsdram -c -o obj/sdram_isp_cstartup.o isp_cstartup.S
isp_cstartup.S: Assembler messages:
isp_cstartup.S:82: Error: cannot use register index with PC-relative addressing
-- `str r1,[pc,#-(8+.-isInitialized)]'
make: *** [obj/sdram_isp_cstartup.o] Error 1

C:\Program Files\ATMEL Corporation\SAM-BA v2.10\applets\isp-project\extram>arm-n
one-eabi-gcc --version
arm-none-eabi-gcc (Sourcery G++ Lite 2010q1-188) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


C:\Program Files\ATMEL Corporation\SAM-BA v2.10\applets\isp-project\extram>
falingtrea
Location: Mounds View, MN
Posts: 209
Joined: Wed Jan 09, 2008 5:09 pm

Re: SAM-BA 2.10 Custom board programming problem.

Tue Aug 03, 2010 8:01 pm

I was able to compile SAM-BA v2.10 extram using Sourcery G++ Lite ARM EABI Sourcery G++ Lite 2008q1-126 without error. I used the cs-make.exe for Windows to run the makefile. You need to make sure you are using the Code Sourcery EABI target package and not cLinux or GNU/Linux.

C:\Program Files\ATMEL Corporation\SAM-BA v2.10\applets\isp-project\extram>cs-make clean BOARD=at91s
am9260-ek CHIP=at91sam9260 sram
Makefile:214: warning: overriding commands for target `debug'
Makefile:214: warning: ignoring old commands for target `debug'
Makefile:214: warning: overriding commands for target `debug'
Makefile:214: warning: ignoring old commands for target `debug'
rm -f obj/*.o bin/*.bin bin/*.elf bin/*.map
arm-none-eabi-gcc -Wall -g -Os -I../../at91lib/boards/at91sam9260-ek -I../../at91lib/peripherals -I
../../at91lib/components -I../../at91lib -Dat91sam9260 -D__ASSEMBLY__ -Dsram -c -o obj/sram_isp_csta
rtup.o ../common/isp_cstartup.S
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I../../at91lib/boards/at91
sam9260-ek -I../../at91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat91sam9260 -DDY
N_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -Dsram -c -o obj/sram_main.o main.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I../../at91lib/boards/at91
sam9260-ek -I../../at91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat91sam9260 -DDY
N_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -Dsram -c -o obj/sram_board_memories.o ../../at91lib/boards/at
91sam9260-ek/board_memories.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I../../at91lib/boards/at91
sam9260-ek -I../../at91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat91sam9260 -DDY
N_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -Dsram -c -o obj/sram_board_lowlevel.o ../../at91lib/boards/at
91sam9260-ek/board_lowlevel.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I../../at91lib/boards/at91
sam9260-ek -I../../at91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat91sam9260 -DDY
N_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -Dsram -c -o obj/sram_dbgu.o ../../at91lib/peripherals/dbgu/db
gu.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I../../at91lib/boards/at91
sam9260-ek -I../../at91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat91sam9260 -DDY
N_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -Dsram -c -o obj/sram_pio.o ../../at91lib/peripherals/pio/pio.
c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I../../at91lib/boards/at91
sam9260-ek -I../../at91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat91sam9260 -DDY
N_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -Dsram -c -o obj/sram_cp15.o ../../at91lib/peripherals/cp15/cp
15.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I../../at91lib/boards/at91
sam9260-ek -I../../at91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat91sam9260 -DDY
N_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -Dsram -c -o obj/sram_stdio.o ../../at91lib/utility/stdio.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I../../at91lib/boards/at91
sam9260-ek -I../../at91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat91sam9260 -DDY
N_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -Dsram -c -o obj/sram_trace.o ../../at91lib/utility/trace.c
arm-none-eabi-gcc -g -Os -Wl,-Map=bin/isp-extram-at91sam9260.map,--gc-sections -T"../../at91lib/bo
ards/at91sam9260-ek/at91sam9260/sram_samba.lds" -o bin/isp-extram-at91sam9260.elf obj/sram_isp_cstar
tup.o obj/sram_main.o obj/sram_board_memories.o obj/sram_board_lowlevel.o obj/sram_dbgu.o obj/sram_p
io.o obj/sram_cp15.o obj/sram_stdio.o obj/sram_trace.o
arm-none-eabi-objcopy -O binary bin/isp-extram-at91sam9260.elf bin/isp-extram-at91sam9260.bin
arm-none-eabi-size obj/sram_isp_cstartup.o obj/sram_main.o obj/sram_board_memories.o obj/sram_board_
lowlevel.o obj/sram_dbgu.o obj/sram_pio.o obj/sram_cp15.o obj/sram_stdio.o obj/sram_trace.o bin/isp-
extram-at91sam9260.elf
text data bss dec hex filename
240 0 0 240 f0 obj/sram_isp_cstartup.o
232 0 0 232 e8 obj/sram_main.o
860 0 0 860 35c obj/sram_board_memories.o
252 0 0 252 fc obj/sram_board_lowlevel.o
132 0 0 132 84 obj/sram_dbgu.o
304 0 0 304 130 obj/sram_pio.o
504 0 0 504 1f8 obj/sram_cp15.o
1184 1032 0 2216 8a8 obj/sram_stdio.o
1112 0 0 1112 458 obj/sram_trace.o
1560 0 0 1560 618 bin/isp-extram-at91sam9260.elf
Tim Barr
Multitech Inc.
kc4ydx
Posts: 4
Joined: Thu May 13, 2010 4:59 pm

Re: SAM-BA 2.10 Custom board programming problem.

Tue Aug 03, 2010 9:05 pm

That compiled without errors after I modified line 52 of the make file to be:
escapes added to prevent forum script from parsing the code string.

Code: Select all

INSTALLDIR = \"..\/..\/..\/tcl_lib\/$(BOARD_DIR)\/\"
Before that, it would give me a directory not found error and not move the .bin to the extram directory. With the change the make runs with no problems:
C:\Program Files\ATMEL Corporation\SAM-BA v2.10\applets\isp-project\extram>make
clean BOARD=at91sam9260-ek CHIP=at91sam9260 sdram
makefile:214: warning: overriding commands for target `debug'
makefile:214: warning: ignoring old commands for target `debug'
makefile:214: warning: overriding commands for target `debug'
makefile:214: warning: ignoring old commands for target `debug'
rm -f obj/*.o bin/*.bin bin/*.elf bin/*.map
arm-none-eabi-gcc -Wall -g -Os -Iat91lib/boards/at91sam9260-ek -Iat
91lib/peripherals -Iat91lib/components -Iat91lib -Dat91sam9260 -D__A
SSEMBLY__ -Dsdram -c -o obj/sdram_isp_cstartup.o common/isp_cstartup.S
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I..
/at91lib/boards/at91sam9260-ek -Iat91lib/peripherals -Iat91lib/compo
nents -Iat91lib -Dat91sam9260 -DDYN_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -D
sdram -c -o obj/sdram_main.o main.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I..
/at91lib/boards/at91sam9260-ek -Iat91lib/peripherals -Iat91lib/compo
nents -Iat91lib -Dat91sam9260 -DDYN_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -D
sdram -c -o obj/sdram_board_memories.o at91lib/boards/at91sam9260-ek/board
_memories.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I..
/at91lib/boards/at91sam9260-ek -Iat91lib/peripherals -Iat91lib/compo
nents -Iat91lib -Dat91sam9260 -DDYN_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -D
sdram -c -o obj/sdram_board_lowlevel.o at91lib/boards/at91sam9260-ek/board
_lowlevel.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I..
/at91lib/boards/at91sam9260-ek -Iat91lib/peripherals -Iat91lib/compo
nents -Iat91lib -Dat91sam9260 -DDYN_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -D
sdram -c -o obj/sdram_dbgu.o at91lib/peripherals/dbgu/dbgu.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I..
/at91lib/boards/at91sam9260-ek -Iat91lib/peripherals -Iat91lib/compo
nents -Iat91lib -Dat91sam9260 -DDYN_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -D
sdram -c -o obj/sdram_pio.o at91lib/peripherals/pio/pio.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I..
/at91lib/boards/at91sam9260-ek -Iat91lib/peripherals -Iat91lib/compo
nents -Iat91lib -Dat91sam9260 -DDYN_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -D
sdram -c -o obj/sdram_cp15.o at91lib/peripherals/cp15/cp15.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I..
/at91lib/boards/at91sam9260-ek -Iat91lib/peripherals -Iat91lib/compo
nents -Iat91lib -Dat91sam9260 -DDYN_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -D
sdram -c -o obj/sdram_stdio.o at91lib/utility/stdio.c
arm-none-eabi-gcc -Wall -mlong-calls -ffunction-sections -g -Os -mthumb -I..
/at91lib/boards/at91sam9260-ek -Iat91lib/peripherals -Iat91lib/compo
nents -Iat91lib -Dat91sam9260 -DDYN_TRACES -UDYN_TRACES -DTRACE_LEVEL=0 -D
sdram -c -o obj/sdram_trace.o at91lib/utility/trace.c
arm-none-eabi-gcc -g -Os -Wl,-Map=bin/isp-extram-at91sam9260.map,--gc-sections
-T"at91lib/boards/at91sam9260-ek/at91sam9260/sdram_samba.lds" -o bin/isp-
extram-at91sam9260.elf obj/sdram_isp_cstartup.o obj/sdram_main.o obj/sdram_board
_memories.o obj/sdram_board_lowlevel.o obj/sdram_dbgu.o obj/sdram_pio.o obj/sdra
m_cp15.o obj/sdram_stdio.o obj/sdram_trace.o
arm-none-eabi-objcopy -O binary bin/isp-extram-at91sam9260.elf bin/isp-extram-at
91sam9260.bin
arm-none-eabi-size obj/sdram_isp_cstartup.o obj/sdram_main.o obj/sdram_board_mem
ories.o obj/sdram_board_lowlevel.o obj/sdram_dbgu.o obj/sdram_pio.o obj/sdram_cp
15.o obj/sdram_stdio.o obj/sdram_trace.o bin/isp-extram-at91sam9260.elf
text data bss dec hex filename
240 0 0 240 f0 obj/sdram_isp_cstartup.o
232 0 0 232 e8 obj/sdram_main.o
860 0 0 860 35c obj/sdram_board_memories.o
156 0 0 156 9c obj/sdram_board_lowlevel.o
132 0 0 132 84 obj/sdram_dbgu.o
304 0 0 304 130 obj/sdram_pio.o
504 0 0 504 1f8 obj/sdram_cp15.o
1184 1032 0 2216 8a8 obj/sdram_stdio.o
1112 0 0 1112 458 obj/sdram_trace.o
1464 0 0 1464 5b8 bin/isp-extram-at91sam9260.elf

C:\Program Files\ATMEL Corporation\SAM-BA v2.10\applets\isp-project\extram>arm-n
one-eabi-gcc --version
arm-none-eabi-gcc (Sourcery G++ Lite 2008q1-126) 4.2.3
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
However, the new extram applet does not work.. It hangs the target. SAM-BA runs and never returns. I think the applet is stuck in a loop and never returns back to the ROM/boot code to report. 0x0f. "External RAM initialization failed."
Achieve4
Posts: 16
Joined: Fri Dec 31, 2010 9:48 am

Re: SAM-BA 2.10 Custom board programming problem.

Fri Dec 31, 2010 9:56 am

hello,

did you find out the cause of compiled applet hangs the sam-ba? i am having the same issue.

thanks.
kc4ydx
Posts: 4
Joined: Thu May 13, 2010 4:59 pm

Re: SAM-BA 2.10 Custom board programming problem.

Tue Jan 04, 2011 5:15 pm

Sorry, No.
I was not able to find a solution in time to meet my project schedule. I had to give up and move on to other problems.
falingtrea
Location: Mounds View, MN
Posts: 209
Joined: Wed Jan 09, 2008 5:09 pm

Re: SAM-BA 2.10 Custom board programming problem.

Tue Jan 04, 2011 7:11 pm

One thing I forgot to ask. How big is the applet after compile. For a 9260 the applets should be smaller than 4k so that they will fit into the SRAM on the processor. Since I use the 9G20 I don't usually worry about that because the SRAM is 4x bigger.
Tim Barr
Multitech Inc.

Return to “SAM-BA”

Who is online

Users browsing this forum: No registered users and 3 guests