IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


Command shell:      PFI Configuration Setup

How the PFI shell command is used to configure a Power Fail Interrupt is described here.   This configuration will be held in non-volatile memory and restored at each power up to assure that Power Loss Protected (PLP) drives, including the A: flash drive, can be protected from the start prior to any application running or user actions.

Command Syntax

        PFI         interruptNumber     level     [A:] [B:] [D:] [E:] [F:]

This command performs the hardware setup required for the PFI using a specified interrupt and active level.   The user may install callbacks for this interrupt using the isrInstall() API in the normal manner.   However this callback installation must be done after the PFI configuration with this command.   This command purges any user callbacks that had been installed for the specified interrupt.

By default, any further sector writes to PLP disk drives will be inhibited following the Power Fail Interrupt.   This behavior can optionally be overridden for specific drives by specifying their drive letters on this command line so that the drive will remain write enabled after the PFI.

Following a Power Fail Interrupt, the system will not allow any disk drive to be opened.   A CPU reset is expected from the hardware shortly thereafter, so under normal conditions this restriction should never become evident.   However, should this expected hardware reset go missing due to either a miss-configured PFI or faulty hardware, then it could happen that the A: flash drive is not opened at start up and therefore the CHIP.INI would not be read.   If the RS-232 console was not using the default BAUD rate, this could result in the console being unreadable.   In any event, the console prompt will be "A:$>" when the PFI occurred before the A: drive was mounted and no subsequent CPU reset occurred.   (This prompt results whenever the current working directory is invalid.)   A PFI ERASE action is recommended in this case.

First parameter:     interruptNumber

The first parameter interruptNumber designates which signal shall be used for the Power Fail Interrupt.   For this purpose the decimal value of a tag from the ISR_NUMBER enumerator type shall be used. For example 21 specifies interrupt ISR_PSC2_4.   Only signals from the subset of ISR_NUMBER enumerators listed below are legal for use as the PFI.
interruptNumber
ISR_NUMBER enumerator tag
PIO number
0
ISR_IRQ0
n/a
1
ISR_IRQ1
n/a
2
ISR_IRQ2
n/a
3
ISR_IRQ3
n/a
20
ISR_PSC1_4
4
21
ISR_PSC2_4
9
22
ISR_PSC3_4
14
23
ISR_PSC3_5
15
24
ISR_PSC3_8
18
25
ISR_PSC3_9
19
26
ISR_PSC6_0
20
27
ISR_PSC6_1
21
29
ISR_GPIO_7
31
CAUTION:     Please note that the values listed in the ISR_NUMBER enumerator tag and PIO number columns in the above table are only for reference.   The interruptNumber is the only value from this table to appear as an argument on the command line.

Second parameter:     level

The second parameter level must be one of the following:

  • HIGH - Interrupt input is level sensitive, active high.
  • LOW - Interrupt input is level sensitive, active low.

Note that hardware wise, only InterruptNumber 0 through 3 actually operate in a level sensitive manor.   All of the other interrupts (which each have an associated PIO number) have edge triggered hardware.   Nevertheless, the hardware circuit which drives the PFI must remain asserted after the PFI edge.   This allows the respective input pin to be polled by the system during power up to determine if the power fail detection circuit had already issued the edge (rising for HIGH level active or falling for LOW level active).   In this manner no early PFI can be missed during the system startup sequence.   So the PFI triggering hardware should be designed as a level sensitive interrupt irrespective of which interrupt is to be used.

Optional parameters:      [A:] [B:] [D:] [E:] [F:]

The optional parameters must appear last on the command line, and they may appear in any order.   They are case insensitive.

The entire purpose of the system's PFI handler is to inhibit further sector writing to disk drives that have the PLP format.   This default behavior can be defeated for specific drives which are to be left write enabled after the PFI by listing their drive letter on this command line with the final parameters.

Examples






Top of page | Main page

Copyright © 2018 Beck IPC GmbH
Generated on Thu Nov 1 13:20:13 2018 by Doxygen 1.6.1