CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
ErrorCross

Errors Managing

Page Summary


Here you can find informations about the follwoing topics:

Error registers and flags


Error registers


A large number of flags are available to take account of the presence of errors or not adequate performances of both the hw and fw. The errors are in a vector of unsigned int. Every element of the vector cotains 32 flags of information. A flag in true state means that the corresponding error has been verified. The vector with the errors is Post_frontend_errors:

unsigned int Post_frontend_errors[error_number_of_errors_registers+error_offset_for_board_up]; ///< Vector that lists the flag registers.
//First half for board down, second half for board up
unsigned int Post_frontend_errors[error_number_of_errors_registers+error_offset_for_board_up]
Error are notified via can if =1; not notified if =0.
@ error_offset_for_board_up
=15, First addresss for board up errors
@ error_number_of_errors_registers
Number of errors (this is not an addres)

its registers are addressed according to the enum ERROR_CROSS_address_ whose list follows. Note that the length of the half vector is error_number_of_errors_registers, the last element of the list for board down. A similar number of elements with the same name offset by error_offset_for_board_up account for board up. The number on left of the list is the register address whithin Post_frontend_errors:

  1. error_address_reg_ADC0 flags list at flags_error_ADC
  2. error_address_reg_ADC1 flags list at flags_error_ADC
  3. error_address_Power_Supply_in_General flags list at flags_error_PowerSupply
  4. error_address_I2C0 Error register for I2C0 flags list at flags_error_I2C
  5. error_address_I2C1 Error register for I2C1 flags list at flags_error_I2C
  6. error_address_SPI Error register for SPI flags list at flags_error_SPI
  7. error_preamplifier_down flags list at flags_error_preamplifier
  8. error_preamplifier_up flags list at flags_error_preamplifier
  9. error_address_CAN flags list at flags_error_CAN
  10. error_address_PGA_DetectorTrimmer_down flags list at flags_error_PGA_DetectorTrimmer
  11. error_address_PGA_DetectorTrimmer_up flags list at flags_error_PGA_DetectorTrimmer
  12. error_address_Bias_adjustment flags list at flags_error_Bias_Adj
  13. error_number_of_errors_registers (this is not an address, it is the lenght of the vector)
  14. error_offset_for_board_up registers for board up start from this addres and replica the firsts above


The first regsiters, from address 0 to error_number_of_errors_registers, are for the lower board. The registers whose address starts from error_offset_for_board_up registers, are for board up and are a replica in meaning of the first ones. So, for instance, a fail in reading power supply for board down is found at address error_address_Power_Supply_in_General, or 2, while the same fail on board up is found at address error_offset_for_board_up registers + error_address_Power_Supply_in_General.

Flags



Every register of the Post_frontend_errors vector is a set of 32 homogenous flags, that summmmarize the behaviour of some subjects, ADC, I2, SPI, etc. The signature of an error is the value of 1 of a flag and every flag. As an instance, to consult the error during I2C0 communication one has to look at the register Post_frontend_errors[error_address_I2C0]. Each flag of that registers that is 1 marks the verification of any not expected bahaviour.
Now, to manage the flags a few function are available, described below.
Let's start to interpet the flags. To each register an enum is built that lists the flags. They are all listed below. The number on the left of the lists are the position of the flag in the register. As an instance, if the error Vbol_neg_large_for_switching happens, than a 1 is stored at 1 << Vbol_neg_large_for_switching in the error_address_Power_Supply_in_General register.
Here is the list:

Register name: error_address_reg_ADC0 and error_address_reg_ADC1 (ADC's errors)
ADC errors flags Da implementare


Register name: error_address_Power_Supply_in_General (eorrors with any Power Supply)
Errors flags for Vbol for switching Da implementare
Errors flags for Vbol limiting values Da implementare
Errors flags for VREF_POS_PRE Da implementare
Errors flags for VREF_NEG_PRE Da implementare
Errors flags for VCC_PRE Da implementare
Errors flags for VEE_PRE Da implementare
Errors flags rotation for VCC_PGA Da implementare
Errors flags rotation for VEE_PGA Da implementare
Errors flags for V__dig_5V Da implementare
Errors flags for V__dig_3e3V Da implementare


Register name: error_address_I2C0 and error_address_I2C1 (errors with any I2C)
Trouble with I2C communication parziale
I2C Mux0 settings parziale
I2C to parallel conversion PCA9554
Preamplifier trimmer

EPROM


Register name: error_address_I2C0_B and error_address_I2C1_B (errors with any I2C)
Trouble with preamplifier thermometer

parziale

Bias trimmer


Register name: error_address_SPI
Trouble with SPI communication parziale


Register name: error_address_CAN (errors with CAN bus communication)
Trouble with CAN communication Da implementare


Register name: error_preamplifier_down and error_preamplifier_up
Trouble in temperature reading Da implementare
Troubles with reading preamplifier trimmer Da implementare
Troubles with writing preamplifier trimmer Da implementare
Troubles in writing the preamplifier EEPROMs parziale


Register name: error_address_CAN (errors with CAN bus communication)
Trouble with CAN communication Da implementare


Register name: error_address_PGA_DetectorTrimmer_down and error_address_PGA_DetectorTrimmer_up
Troubles with detector trimmer ommunication Da implementare
Troubles with PGA settings Da implementare
  • PGA_error_0 for onboard trimmer error communication CH0
  • PGA_error_1 for onboard trimmer error communication CH1
  • PGA_error_2 for onboard trimmer error communication CH2
  • PGA_error_3 for onboard trimmer error communication CH3
  • PGA_error_4 for onboard trimmer error communication CH4
  • PGA_error_5 for onboard trimmer error communication CH5


Register name: error_address_Bias_adjustment (detector bias errors)
Final differential bias out of tolerance Da implementare
Final positive bias out of tolerance Da implementare
Final negative bias out of tolerance Da implementare
Slopes not available


Error managing functions


The user makes use of the function instr_ERROR_inspection_function() which is passed a parameter, via Byte6 of the CAN instruction, tha can take one of the following 4 values:

  1. : this case the returned parameter is the address of the register where the last error has been detected;
  2. : the content of the register queried in the instruction is sent back;
  3. : the errors are all reset;
  4. : the state of the immidieate echos of errors, when verified. Note that the echos can be set ON or OFF by instr_ERROR_echo_on_off_function() via CAN bus.

As an example, to verify the presence of negative bias adjustment error for CH2 we test true:

@ Final_bias_pos_not_accurate_2
positive detector bias setting out of tolerance CH2
@ error_address_Bias_adjustment
Error register for channel detector bias adjustment.

Anatomy of errors


There are 4 functions that are used in the fw to manage the errors:

  1. The first allows to set the error in the register; it is ERROR_codifica_errore() with input parameters: uint8_t scheda_su_scheda_giu, unsigned char error_addres, unsigned char code_to_shift, uint8_t reset_count_se_0 in which error_addres is the address of the register, see sub-section Error registers, while code_to_shift is the position of the flag to set whitihn the register, see for this case the sub-section Flags. Here an axample of its use:
    I2C_mux -> MasterTransmit( I2C_mux_address_postmainboard_down, &canale_da_abilitare, 1,false);
    while( I2C_mux -> GetStatus().busy); // White transmission complete
    volatile uint32_t Error_bad_operation
    exploited to mark the errors
    void ERROR_codifica_errore(uint8_t scheda_su_scheda_giu, unsigned char error_addres, unsigned char code_to_shift, uint8_t reset_count_se_0)
    If an error is found its flag is codified here.
    @ I2C_Error_I2C_mux
    Trouble with I2C mux communication.
    @ error_address_I2C0
    Error register A for I2C0.
    #define I2C_mux_address_postmainboard_down
    I2C 7 bits address of the postmainboard up I2C_mux.
    Definition: I2C_mux.h:9
    Note that ERROR_codifica_errore() set the flag whithin the register, but does not veirfy if the error has been generated. In the above example the presence of error is marked by Error_bad_operation when different from zero.
    Error_bad_operation is located whithin I2C_0_SignalEvent_t(), I2C_1_SignalEvent_t(), SPI_callback() to mark communication errors.
    Error_bad_operation is not the only parameter to test for errors. As an instance, with CAN bus this other way is used:
    //Before here a CAN message has been sent with success, we hope
    while( (ii <50) && ( evento_CAN != ARM_CAN_EVENT_RECEIVE ) ){
    ii++;
    }
    uint32_t volatile evento_CAN
    This is the variable which resembles the flags from the communication.
    Definition: Can.c:326
    @ CAN_error_comunichiamo_qualche_dato_timeout_on_transmission
    Transmission CAN error.
    @ error_address_CAN
    Error register for CAN bus
    void Aspetta_tanti_ms(int millisecondi)
    The timing function.
    Definition: Timer.c:52
  2. The second function is store_errors() that serves to push the whole registers.
  3. Then, the function restore_errors() pop's the whole regsiters.
  4. The function Error_imposta_la_istruzione() has to be located at the end of every instruction function to mark the error at Byte5, if present. If there is an error it sets the value 0xff at Byte5, if Byte5 is different from 0xff, otherwise it sets 0xfa.

See also
The instructions to manage errors via CAN bus are instr_ERROR_inspection and instr_ERROR_echo_on_off.