📄 rom_readme.txt
字号:
==================================================================
Installing ROM Targets for DragonBall VZ boards
==================================================================
WARNING: Flashing the ROM stationery will overwrite MetroTRK
or any other applications you may have installed in the Flash!
Instructions for re-flashing MetroTRK are included in the
readme_first.txt file in:
<CodeWarriorInstall>\E68k_Tools\MetroTRK\Processor\M68k\Board\motorola\<myboard>
directory.
==================================================================
Dip Switch Settings for DragonBall VZ for running ROM example
==================================================================
This code was tested with the following DIP switch configuration:
S1-1:6=110111, S2-1:8=10111000, where 1=ON.
==================================================================
Burning ROM Stationery to flash
==================================================================
This process requires that you run the BBUGV program from the VZ
tools suite.
1) Connect the VZ board to your host PC using a standard serial
cable. Connect the cable to the UART1 port (P2) of the VZ board.
2) Move switch S2-8 (BOOTSTRAP) to the ON position. Without this
switch, BBUGV will report an error. Recommended switch settings are
S1-1:6=110111 and S2-1:8=10111001, where 1=ON.
3) Load the Stationery project and compile. This will produce
a file called <myboard>.S19. Copy this file to the same directory
as the BBUGV program (see below) and give it a short name such as rom.s.
It is important that the S-Record file have lines no longer than 80
characters. If they are longer than 80 characters, BBUG will report
timeout errors.
4) Power the board on.
5) Launch BBUGV.EXE from \Codewarrior\E68K_Tools\Motorola_EZ_and_VZ_tools\Bbug_VZ\bbugv.exe
6) Select the communications port that the board is connected to.
7) Enter the command:
CB
chose option 2 (115200 baud) for a faster download speed. Next enter:
INIT
followed by
LO ROM.S S
At this point, BBUG will begin downloading the MetroTRK to the
ADS board.
8) Enter the command
GO 8000
BBUG may report "Receive time out error". This is not a problem
so you can ignore the message.
9) Power off the board and set switch S2-8 (BOOTSTRAP) to the OFF
position.
10) Enter the "EXIT" command in BBUGV to exit. This frees
your COM port for other programs.
10) Power the board on.
11) The ROM output should come out from the same put as the
one you connect to BBUGV. Set up a serial communcations program
such as Hyperterm for 19200 baud,N,8,1 and No Flow Control. A
message from your ROM target should appear on the terminal.
==================================================================
Details of ROM target
==================================================================
The ROM target memory footprint can be divide into three stages:
1. Upload the s record to RAM through bbugv. This s record
contain flash utility starts at 0x8000, and image of flash on
RAM allocated for flash buffer at 0x10000. All sections on user
program are redirected to address spaces on flash buffer using
AT directives while linked against their respective runtime
locations. Please refer to LCF chapter in targeting manual
for details on AT directives
RAM before running flash utility
0x8000 +-------------------------------------------+
.flash | flash utility built into this project |
| starts from 8000 |
0x10000 +-------------------------------------------+ <- ___FBUF_START
| | image of .reset |
| +-------------------------------------------+
| | image of .text, .rodata |
| +-------------------------------------------+
.flash_buffer | image of .exception and static initializer|
| +-------------------------------------------+
| | image of .data and .sdata |
| +-------------------------------------------+
| | image of rom table |
_ +-------------------------------------------+
<- ___FBUF_END
2. After running the flash utility(go 8000 in bbugv), the content of flash buffer
is burnt into flash memory.
flash memory after running flash utility
.
0x01000000 +-------------------------------------------+
| | .reset |
.flash | contains initial PC,SP,interrupt vector |
| | table, init code & boot loader | <- ___FLASH_START
- +-------------------------------------------+
| | .text |
| | code |
.main_application | |
| | .rodata |
| | constant data |
- +-------------------------------------------+
| image of .exception and static initializer| <- _DATA_ROM
| runtime will copy these to RAM at bootup |
+-------------------------------------------+
| image of .data and .sdata |
| runtime will copy these to RAM at bootup |
- +-------------------------------------------+
.romp | rom table | <- __S_romp
- +-------------------------------------------+
3. Booting from flash. During bootup, the init code would setup hardware
on the board and call __start in runtime. __start will set up A5 register
and some section from flash memory to RAM according to info on ROM table.
(exception table, static initializer, data and sdata). Then __start calls
main.
Code, constant data, and board initialization code in .reset are still
run from flash memory as in the footprint in 2.
RAM footprint at the beginning of main
0x0 +-------------------------------------------+
| space reserve for user to rellocate and |
| use interrupt vector table in RAM |
0x400 +-------------------------------------------+ <- _DATA_RAM
| | .exception |
| +-------------------------------------------+
| | | <- __exception_table_start__
| | exception table |
.cpp_code | | <- __exception_table_end__
| +-------------------------------------------+
| | | <- ___sinit__
| | static initializer |
- +-------------------------------------------+
| | | <- __START_DATA
| | .data |
.data | application initialized data | <- __END_DATA
| | | <- __START_SDATA
| | .sdata |
| | application initialized small data | <- __END_SDATA
- +-------------------------------------------+ <- __SDA_BASE <- A5 (runtime load __SDA_BASE to A5)
| | | <- __START_SBSS
| | .sbss |
| | application uninitialized small data | <- __END_SBSS
.uninitialized_data | | <- __START_BSS
| | .bss |
| | application uninitialized data | <- __END_BSS
- +-------------------------------------------+
| | <- _stack_address
| stack grows towards small address |
| | <- __SP_INIT
+-------------------------------------------+
| | <- ___heap_addr
| heap |
+-------------------------------------------+
ROM table:
Rom table is have entries of:
+---------------------------+
| source address 32bit |
+---------------------------+
| destination address 32bit |
+---------------------------+
| block size 32bit |
+---------------------------+
.
.
.
+---------------------------+
| zero in 32bit |
+---------------------------+
| zero in 32bit |
+---------------------------+
| zero in 32bit |
+---------------------------+
Custom hardware instead of supported hardware
If you are using custom hardware instead of supported hardware, there is several location
need to be changed:
1. reset code: if your are writing new reset code. Your reset code should
be in .reset section. content of .reset section should contain the initial
stack pointer, program counter, and the exception vector table in ROM. Reset
code should call __start in runtime to setup C runtime and let runtime to
launch main.
2. flash code: flash for Fujitsu MBM29LV160T flash is in .flashinit section,
entry point is copy_to_flash. You may need to provide your own flash code
for custom board
3. addresses of various sections in MEMORY section of linker command file to
correspond to custom hardware.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -