1120 - ispVM: What needs to be modified in ispVM Embedded to target an embedded system? <br>
In general, most of the modification will involve the hardware.c file. This module contains functions that are specific to the embedded system and compiler used. The major portions of hardware.c are:
- Pin assignments -- constant declarations describing the GPIO mapping of each JTAG signal. This should be modified to the corresponding bit location that provides the data to the physical connection to the JTAG chain of devices.
- writePort() function -- This function manipulates the values of the pin state variable and applies it to the GPIO port. Your compiler may use a special function (such as _outp(), outb, outport(), etc) or have a dedicated register assignment for this task.
- readPort() function -- This function reads the value of the GPIO port to interpret TDO from the device chain. Your compiler may use a special function (such as _inp(), inb(), inport(), etc) or have a dedicated register assignment for this task.
- ispVMDelay() function -- This function implements a real-time delay (in microseconds) used at various points in the algorithm. If your compiler and system provides a real-time clock mechanism for time-keeping (such as Sleep(), usleep(), etc), it is recommended that those be used.
- Software timing loops should be used only if a hardware time keeping system is not available, and should be scaled properly for processor speed. Care should be taken to ensure compiler optimization does not impact the loop.
Note: ispVMDelay() is the MOST CRITICAL function and a common cause of errors in embedded programming. Care should be taken to implement this function properly so a minimum real-time delay always results. It is especially important to ensure this function is accurate when programming non-volatile devices (Flash and EEPROM). Providing delays less than the minimum specified can result in programming failures.
Other modifications may be desired, such as removing the command-line arguments or altering the method by which VME (ispVM Embedded file) data is stored and accessed.