BLACKSheep® Software Developers Guide

Aus BECOM Systems Support
Version vom 31. Oktober 2023, 09:03 Uhr von Peter (Diskussion | Beiträge) (1 Version importiert)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

BLACKSheep® Software Developers Guide

Software development using a JTAG device

Bluetechnix core modules work with every JTAG-device provided by Analog Devices Inc. Please contact Bluetechnix for purchasing a JTAG device or have a look at the Bluetechnix homepage to get further information. If you have a JTAG device connected to the core module create an appropriate target platform with the VDSP++ Configurator, depending on the core module you are using. Use this target device to connect your JTAG with the core module. Refer to the VDSP++ User’s Guide, to see how to use the Configurator.

You can develop projects and download the executable via the JTAG device. You have full control over the Blackfin® processor and full debug capabilities. Refer to the VDSP++ Compiler and Library Manual and the VDSP++ Kernel (VDK) User’s Guide from Analog Devices to learn more about software development under VDSP++. After you have created a loader file with VDSP++ you can flash this file, using the integrated Flash Programmer tool in order to create standalone applications. As flash driver you have to use the appropriate *.dxe flash driver file (depending on which core module you are using) which easily can be downloaded from the Bluetechnix support homepage at category “Software Development Tools for Blackfin\FlashToolDriver-files”.

Note
This flash driver file strongly depends on the currently used core module. There are different flash driver files for each core module available.
Refer to the VDSP++ User’s Guide, how to use the Flash Programmer.

If you are using a JTAG device it is important to set correct register reset settings for the EBIU registers after starting VDSP++. The IDE initializes these registers once started, according to the definitions in the xml-files located in the System/ArchDef directory in the installation path of the VDSP++. The relevant files are named “ADSP-BF5xx-proc.xml”. Bluetechnix provides files with the correct settings for Bluetechnix Blackfin® core modules. These important files can be downloaded at the Bluetechnix support homepage - category “Software Development Tools for Blackfin\VDSP++XML_files”.


Recommendation
Copy and save the existing files within the directory to have a backup from the original configuration files.
Overwrite the files with the downloaded files from the support homepage.
Note
These .xml files can now be obtained at this location (if you don't have an account yet create it here )
Installing a VDSP++ update will lead to overwritten xml-configuration files. After a VDSP++ update installation these files has to be overwritten again
with the Bluetechnix core module specific files.

Configuring VDSP++ using a custom .xml file

In newer Versions of VDSP++ you can configure a Session Overlay to reflect the differences between the standard settings and a Bluetechnix Core Module.

The files named COREMODULE-custom.xml (e.g. CM-BF537E-custom.xml)

After creating your Session and successful connection to the Module, Go the Settings Menu -> Session

  • Enable customizations and select the *****-custom.xml as Custom board support file name.
  • VDSP++ should automatically reconnect
  • All settings should be saved within the session.

Valid linker description files (*.ldf)

By using a JTAG device the developer can use customized linker description files. The only things to take in consider is the SDRAM size of the core modules, 32MB starting at 0x00000000. Bluetechnix provides sample linker files for Bluetechnix Blackfin® core modules. These module specific files can be downloaded at the support Bluetechnix support homepage - category “Software Development Tools for Blackfin\ldf\

Valid loader files (*.ldr)

Refer to the VDSP++ Compiler and Library Manual to see how to create bootable Blackfin® loader files. If the developer haves sections in the SDRAM that has to be initialized during the boot process, an initialisation file must be used. This initialisation file sets up the SDRAM prior to boot the application. As the SDRAM settings depend on the used SDRAM type it is important to use the appropriate initialisation file that matches the SDRAM. For each core module Bluetechnix provides appropriate initialisation files (*.dxe) which can be found at the Bluetechnix support homepage - category “Software Development Tools for Blackfin\initcode\”. Set the appropriate *.dxe file that correspond to your Blackfin® core module as initialisation file within the project {{#if: project options | project options {{#if: | {{{3}}} {{#if: | {{{4}}} {{#if: | {{{5}}} {{#if: | {{{6}}} {{#if: | {{{7}}} {{#if: | {{{8}}} {{#if: | {{{9}}} {{#if: | {{{10}}}| }}| }}| }}| }}| }}| }}| }}| }}| }} or [ Alt + F7 ] Project {{#if: Load | Load {{#if: Options | Options {{#if: Initialization file | Initialization file {{#if: | {{{5}}} {{#if: | {{{6}}} {{#if: | {{{7}}} {{#if: | {{{8}}} {{#if: | {{{9}}} {{#if: | {{{10}}}| }}| }}| }}| }}| }}| }}| }}| }}| }}.

At the CM-BF561 you have to use the file “bf561_prom16.dxe” as boot loader (second stage loader) instead of using it as an initialisation file! This is necessary because the BF561 is a dual core DSP and this requires a second stage loader for booting both cores, otherwise only one core will be booted. If you don’t use a boot file on a BF561 project for creating a loader file the elfloader will report a warning.

Correct the settings to create valid loader files

Each core module has its own settings. These settings can be set at the Project Options: Load.

CM-BF533
Foreseen initialisation file:
Software Development Tools for Blackfin\initcode\cm-bf533\Init_code.dxe
  • No Boot Kernel
  • No ROM Splitter
Boot mode Boot format Output width
PROM Intel-HEX 16Bit Default start address
CM-BF537
Foreseen initialisation file:
Software Development Tools for Blackfin\initcode\cm-bf537e\Init_code.dxe
  • No Boot Kernel
  • No ROM Splitter
Boot mode Boot format Output width
PROM Intel-HEX 16Bit Default start address


CM-BF561
No initialisation file!
Foreseen Boot Kernel:
Software Development Tools for Blackfin\initcode\cm-bf561\Init_code.dxe
  • No ROM Splitter
Boot mode Boot format Output width
PROM Intel-HEX 16Bit Default start address
Note
Be sure to have selected the correct boot mode “Boot from 16 bit Flash/PROM” on your target board. Refer to the appropriate Blackfin® Hardware User Manual to see how to set boot modes.

Software development without JTAG device

If you don’t have a JTAG device you can use the Simulator from the VDSP++ IDE to develop your application. Create a loader file from your project. This loader file (*.ldr) can be downloaded to the core module using the download features from BLACKSheep® OS. Depending on the BLACKSheep®- and core module-version you have different download capabilities. Files can be downloaded by standard UART interface with the XModem protocol or over a standard http browser. Refer to the BLACKSheep Command Reference to see how to transfer files with the xmt command.

With the integrated BLACKSheep® flash programming tool the developer can flash an application either as Application booted by the BLACKSheep® or as Standalone Application.

Note
Be aware that flashing an application as Standalone Application overwrites BLACKSheep® OS and the core module can only be re-flashed with a JTAG device.

If the developer has flashed an executable as Application it can be started with the load command from BLACKSheep® OS. After the boot process of BLACKSheep® the whole flash will be scanned to find a valid application. A found application in flash will be started if no key has been pressed by the user. There are no debug features supported by BLACKSheep® OS, but you can debug the application by using integrated VDSP++ Simulator.

A detailed description of all available BLACKSheep® OS commands can be seen at the BLACKSheep Command Reference.

Application boot process

The boot loader of BLACKSheep® OS is as the Blackfin® boot loader located in the boot ROM of the embedded processor. The BLACKSheep® OS application loader scans the flash or loader file for a valid dxe header and copies each defined loader file section into the appropriate memory section. After the copy process has finished all interrupts get cleared and the instruction pointer jumps to the start address of the internal code memory (0xFFA00000).

The code for the application loader resides in the first 8kB of the SDRAM memory. The developer has to take care to avoid sections that have to be initialized at boot time and are located within this first 8kB. This can be done very easily simply by using the preconfigured Bluetechnix linker description files which can be found at the Bluetechnix support homepage - category “Software Development Tools for Blackfin\ldf\”. These linker files avoid having code or data in these memory sections and provide correct SDRAM size for Bluetechnix core modules.

Flash usage

The BLACKSheep® OS command “flash –ff” gives information on the flash usage of the BLACKSheep® OS. BLACKSheep® OS resides on bottom of the flash beginning with address 0x20000000. Applications will be stored on the top of the BLACKSheep® code, starting on the first free sector. After BLACKSheep® OS and the application has booted, the flash can be used by the user application. BLACKSheep® OS requires about 600kB of flash. This size strongly depends on the used BLACKSheep® OS version.

Note
Don’t write in sectors where the application- or the BLACKSheep®-code is saved, otherwise the BLACKSheep® and/or the application won’t be able to start anymore.
It is recommended to start at the top of the flash for storing user data.

Valid linker description files (*.ldf)

As described above feel free to use your own linker files as long you don’t have any sections that has to be initialized at boot time within the first 8kB (code of the application loader), and you consider the SDRAM (32MB) starts at 0x00000000. Bluetechnix provides linker description files which can be found at the Bluetechnix support homepage - category “Common\DevelopmentTools\ldf” which perfectly fit for Bluetechnix Blackfin® core modules.

Valid loader files (*.ldr)

Refer to section 1.1.2 to see how a valid loader file can be created. You have to consider the above mentioned rules in order to flash BLACKSheep® OS substituted with the –b option (get a detailed description from BLACKSheep Command Reference). If you want to create loader files that can be started BLACKSheep® OS either from flash or with the “exec” command, you have to consider the following two rules.

At the CM-BF533 and CM-BF537 you must not use the initialisation file, because the SDRAM has been already initialized by BLACKSheep® OS!

At the CM-BF561 you must not use the Boot Kernel because BLACKSheep® OS acts as second stage loader!