Lab 10: Programming the Flash
15. Open User_10.cmd and notice that the initialized sections for “passwords” and
“csm_rsvd” are linked to memories named PASSWORDS and CSM_RSVD,
respectively.
16. Using the DSP/BIOS configuration tool (Lab.cdb) define memory blocks for
PASSWORDS and CSM_RSVD. You will need to setup the MEM Properties for each
memory block with the proper base address and length. Set the space to code for both
memory blocks. (Uncheck the “create a heap in this memory” box for each block). You
may also need to modify the existing flash memory block to avoid conflicts.
Executing from Flash after Reset
The F2812 device contains a ROM bootloader that will transfer code execution to the flash after
reset. When the boot mode selection pins are set for “Jump to Flash” mode, the bootloader will
branch to the instruction located at address 0x3F7FF6 in the flash. An instruction that branches
to the beginning of your program needs to be placed at this address. Note that the CSM
passwords begin at address 0x3F7FF8. There are exactly two words available to hold this branch
instruction, and not coincidentally, a long branch instruction “LB” in assembly code occupies
exactly two words. Generally, the branch instruction will branch to the start of the C-
environment initialization routine located in the C-compiler runtime support library. The entry
symbol for this routine is _c_int00. Recall that C code cannot be executed until this setup routine
is run. Therefore, assembly code must be used for the branch. We are using the assembly code
file named CodeStartBranch.asm.
17. Open and inspect CodeStartBranch.asm. This file creates an initialized section
named “codestart” that contains a long branch to the C-environment setup routine.
This section needs to be placed in memory using the DSP/BIOS configuration tool.
18. Using the DSP/BIOS configuration tool (Lab.cdb) define a memory space named
BEGIN_FLASH.
19. Setup the MEM Properties with the proper base address, length, and space.
(Uncheck the “create a heap in this memory” box). Be sure to avoid memory section
conflicts.
20. In the earlier lab exercises, the section “codestart” was directed to the memory
named BEGIN_H0. Open and modify User_10.cmd so that the section
“codestart” will be directed to BEGIN_FLASH.
21. The eZdsp™ board needs to be configured for “Jump to Flash” bootmode. Move jumper
JP7 to position 1-2 to accomplish this. This jumper controls the pullup/down resistor on
the GPIOF4 pin, which is one of the pins sampled by the bootloader to determine the
bootmode. GPIOF4 alone is sufficient to configure “Jump to Flash” bootmode (see the
TMS320F28x DSP Boot ROM Reference Guide, and also the eZdsp F2812 Technical
Reference, for more information).
C28x - System Design 10 - 23