Commit d0ed55cd authored by Colin González's avatar Colin González
Browse files

Moved convenient scripts to opt/ directory as they are not mandatory for the project.

parent 0a4e842d
#! /bin/sh
exec sam-ba /dev/ttyACM0 at91sam9g20-ek src/flashing/$1-flash.tcl > flash.log 2>&1
true
set bootstrap "/home/colin/Documents/apc/at91bootstrap/binaries/at91sam9g20ek-nandflashboot--3.8.10.bin"
set img "/home/colin/Documents/apc/template-freertos/bin/img-sdram.bin"
set img "/home/colin/Documents/apc/template-freertos/bin/img-at91sam9g20-ek-at91sam9g20-sdram.bin"
NANDFLASH::Init
......
set img "/home/colin/Documents/apc/template-freertos/bin/img-sdram.bin"
set img "/home/colin/Documents/apc/template-freertos/bin/img-at91sam9g20-ek-at91sam9g20-sdram.bin"
GENERIC::Init $RAM::appletAddr $RAM::appletMailboxAddr $RAM::appletFileName [list $::target(comType) $::target(traceLevel) $BOARD::extRamVdd $BOARD::extRamType $BOARD::extRamDataBusWidth $BOARD::extDDRamModel]
send_file {SDRAM} "$img" 0x20000000 0
......
# SDRAM initialization script for the AT91SAM9G20
#------------------------------------------------
# Configure master clock
echo Configuring the master clock...\n
# Enable main oscillator
set *0xFFFFFC20 = 0x00004001
while ((*0xFFFFFC68 & 0x1) == 0)
end
# Set PLLA to 800MHz
set *0xFFFFFC28 = 0x202A3F01
while ((*0xFFFFFC68 & 0x2) == 0)
end
# Set PLLB for USB usage
set *0xFFFFFC2C = 0x10193F05
while ((*0xFFFFFC68 & 0x4) == 0)
end
# Select prescaler
set *0xFFFFFC30 = 0x00001300
while ((*0xFFFFFC68 & 0x8) == 0)
end
# Select master clock
set *0xFFFFFC30 = 0x00001302
while ((*0xFFFFFC68 & 0x8) == 0)
end
echo Master clock ok.\n
echo Configuring the SDRAM controller...\n
# Enable EBI chip select for the SDRAM
set *0xFFFFEF1C = 0x2
# Enable PC16-PC31 pins
set *0xFFFFF870 = 0xFFFF0000
set *0xFFFFF874 = 0x00000000
set *0xFFFFF804 = 0xFFFF0000
# SDRAM configuration
set *0xFFFFEA08 = 0x96338379
set *0xFFFFEA00 = 0x1
set *0x20000000 = 0
set *0xFFFFEA00 = 0x2
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x3
set *0x20000000 = 0
set *0xFFFFEA00 = 0x0
set *0x20000000 = 0
set *0xFFFFEA04 = 0x39D
echo SDRAM configuration ok.\n
# MCK initialization script for the AT91SAM9G20
#------------------------------------------------
# Configure master clock
echo Configuring the master clock...\n
# Enable main oscillator
set *0xFFFFFC20 = 0x00004001
while ((*0xFFFFFC68 & 0x1) == 0)
end
# Set PLLA to 800MHz
set *0xFFFFFC28 = 0x202A3F01
while ((*0xFFFFFC68 & 0x2) == 0)
end
# Select prescaler
set *0xFFFFFC30 = 0x00001300
while ((*0xFFFFFC68 & 0x8) == 0)
end
# Select master clock
set *0xFFFFFC30 = 0x00001302
while ((*0xFFFFFC68 & 0x8) == 0)
end
echo Master clock ok.\n
#!/bin/bash
img=$1
cmd=cmd.gdb
sdram_config="./opt/gdb/at91sam9g20-ek-sdram.gdb"
sram_config="./opt/gdb/at91sam9g20-ek-sram.gdb"
if echo $img | grep sdram > /dev/null
then
config=$sdram_config
else
config=$sram_config
fi
echo "define reset" > $cmd
echo " target remote localhost:2331" >> $cmd
echo " monitor reset" >> $cmd
echo " source" $config >> $cmd
echo " load" >> $cmd
echo "end" >> $cmd
if !(file $img | grep ELF > /dev/null)
then
echo "ELF file is expected."
exit
fi
exec gdb-multiarch -x cmd1.gdb -ex reset $img
#!/bin/bash
exec /opt/SEGGER/JLink/JLinkGDBServerCLExe -USB -device AT91SAM9G20 -endian little -if JTAG -speed auto -noLocalhostOnly
#!/bin/bash
exec picocom --baud 115200 --parity n --stop 1 --flow none /dev/ttyUSB0
#! /bin/sh
sam-ba /dev/ttyACM0 at91sam9g20-ek src/flashing/sdram.tcl > flash.log 2>&1
true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment