Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
20
of
174
where
FTZ7QCMF
is the serial number for the debugger.
The GDB, telnet and TCL ports must be set to a unique value in the Linux user-available
range 1025-65535, the defaults are GDB: 50001, telnet: 4444, TCL: 6666.
For example, two debuggers with serial numbers
FTZ7QCMF
and
FTZ7IB10
can be setup
via
run_aac_debugger.sh -s FTZ7QCMF -g 50001 -t 4444 -p 6666
run_aac_debugger.sh -s FTZ7IB10 -g 50002 -t 4445 -p 6667
Two instances of GDB can then be opened, and connected to the different debuggers via
target remote localhost:50001
and
target remote localhost:50002
respectively. Only the GDB port is used when connecting from GDB.
3.6. Programming an application (boot image) to system flash
This chapter describes how to program the NAND flash memory with a selected boot image.
To achieve this, the boot image binary is bundled together with the NAND flash
programming application during the latter's compilation. The NAND flash programming
application is then uploaded to the target and started just as an ordinary application using
gdb. The maximum allowed size for the boot image for is 16 MB. The nandflash_program
application can be found in the BSP.
The below instructions assume that the toolchain is in the PATH, see section 3.3 for how to
accomplish this.
1. Compile the boot image binary according to the rules for that program.
2. Ensure that this image is in a binary-only format and not ELF. This can be
accomplished with the help of the GCC objcopy tool included in the toolchain:
Note that
X
is to be replaced according to what your application has been compiled
against, either
elf
for a bare-metal application or
rtems4.11
for the RTEMS variant.
or1k-aac-X-objcopy -O binary boot_image.elf boot_image.bin
3. See chapter 3.4 for installing the BSP and enter
cd path/to/bsp/aac-or1k-xxx-x-bsp/src/nandflash_program/src
4. Now, compile the nandflash-program application, bundling it together with the boot image
binary.
make nandflash-program.elf PROGRAMMINGFILE=/path/to/boot_image.bin
5. Load the
nandflash-program.elf
onto the target RAM with the help of gdb and
execute it, see section 3.5.3. Follow the instructions on screen and when it's ready,
reboot the board by a reset or power cycle.