NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux

Developer Guide
5.1.0.2 Release


 
Camera Module EEPROM Tools (nveeprom_flash and nveeprom_dump)
 
EEPROM Flash Tool (nveeprom_flash)
Flashing the Factory Section
Updating the writable section
Example: Flashing EEPROM on Camera Modules
EEPROM Dump Tool (nveeprom_dump)
Dumping and Saving the Contents of the EEPROM
EEPROM Specification
Factory Section (Read Only)
Writable Section
Complete Specification
NvMedia includes tools for flashing, updating, and reading the EEPROM present on certain camera modules. Currently, those modules include:
SF3324
SF3325
The EEPROM memory is divided into two parts: The factory section and the writable section.
Factory Section - This section is meant to be flashed to the EEPROM once by the module manufacturer. Applications that use the EEPROM can read data from the factory section, but they cannot update or modify it. You can flash a new factory section to the EEPROM, but that overwrites all other data stored on the EEPROM, including the writable section.
Writable Section - This section contains data that can be modified by the application. Applications that use the EEPROM can read, add, and update parameters in the writable section; however, parameters may not be deleted from the writable section. An EEPROM module must contain a valid factory section before it can be updated with a writable section.
EEPROM Flash Tool (nveeprom_flash)
You can use the EEPROM flash tool to flash a new binary blob to the factory section of the EEPROM module, or to update parameters within the writable section. This tool uses a configuration file to set up the serializer/deserializer link with the camera module.
The application requires a configuration file and configuration set to be specified with the -cf and -c parameters, respectively. The application also requires you to provide either a binary file to write to the factory section, a text file with parameters to write to the writable section, or both.
Option
Parameter
Notes
Default
-h
N/A
Prints guidance on using the tool.
N/A
-v
[level]
Specifies logging Level:
0: Errors
1: Warnings
2: Information
3: Debug
If option is not used: 0.
If option is used, but level is not provided: 3.
-if
[input file]
Specifies a binary file to write to the factory section of the EEPROM. This option overwrites the previous factory section. It also deletes the contents of the writable section.
N/A
-p
[parameter file]
Specifies a text file that contains a list of writable parameters to update. For more information, see Writable Section Parameter File Format (below).
N/A
-cf
[config file]
Specifies the configuration file.
N/A
-c
[name]
Specifies the parameter set name.
N/A
-lc
N/A
Lists the available configuration sets. This tool and the nvmimg_cap sample use the same configuration file syntax. For more information, see Image Camera Capture (nvmimg_cap).
N/A
-n
[sensors]
Specifies the number of camera modules to flash, starting from link 0.
1
Writable Section Parameter File Format
# Comments begin with a '#' character
# Example of an integer type parameter
writable.intrinsic.model = 3;
# Example of an array-like float parameter
# '[' and ']' are used to index the array.
# Locations in the array that are not assigned (In this case 2, 3, and 4) are set to 0.
writable.extrinsic.parameters[0] = 111.111;
writable.extrinsic.parameters[1] = 1.23;
writable.extrinsic.parameters[5] = -9.8;
# Example of a binary parameter
# Binary parameters are expressed in hexadecimal. If the size of a binary parameter
# is larger than the given value, the rest of the space is padded with 0.
writable.scratchPad.scratchPad = 0123456789abcdef;
Flashing the Factory Section
To flash a single camera
1. Obtain the factory data for the camera module you want to flash.
The factory data for the SF3324 and SF3325 camera modules are distributed in the platform. Copy the blob to the target file system.
2. Flash the factory data to the camera by running the following command on the target machine. You may need to change the selected parameter set, based on the camera group to which the camera is attached.
./nveeprom_flash -cf ddpx-a.conf -c <param_set> -if <factory_data>
On completing this step, the camera on link 0 should be flashed to contain the factory data. All data previously stored in the EEPROM is lost.
To simultaneously flash multiple cameras
Follow the steps in To flash a single camera, but use the -n option to specify the number of cameras.
For example, the following command flashes the cameras connected to link 0, 1, and 2 on camera group B:
./nveeprom_flash -cf ddpx-a.conf -c SF3325-CSI-C -if SF3325.bin -n 3
Updating the writable section
Prerequisites
The EEPROM must already contain a valid factory section.
To update the writable section
1. Create a writable parameters script, using the following as your starting point.
# Intrinsic model has 16 floating point coefficients
writable.intrinsic.model = 3;
writable.intrinsic.coefficients[0] = -0.123400;
writable.intrinsic.coefficients[1] = 20.000000;
writable.intrinsic.coefficients[2] = -0.123400;
# Coefficients that are not specified are set to 0
writable.intrinsic.coefficients[15] = 20.000000;
writable.intrinsic.measuredFlag = 1;
 
# Extrinsic parameters has 6 floating point coefficents
writable.extrinsic.parameters[0] = 123;
writable.extrinsic.parameters[1] = -123;
writable.extrinsic.parameters[2] = 6.5;
writable.extrinsic.parameters[3] = 20;
writable.extrinsic.parameters[4] = 2;
writable.extrinsic.parameters[5] = 111.111;
 
# Second and third intrinic models
writable.secondIntrinsic.model = 1;
writable.secondIntrinsic.coefficients[1] = 999.000000;
 
writable.thirdIntrinsic.model = 0;
writable.thirdIntrinsic.coefficients[15] = -999.1234;
writable.thirdIntrinsic.measuredFlag = 0;
writable.scratchPad.scratchPad = 010203040506070809abcdefdeadbeef;
Notes:
The script does not have to specify a value for every writable parameter.
Writable parameters that are not specified in the script are not overwritten or removed from the EEPROM.
When writing parameters that are arrays, array elements that are not specified are set to 0.
2. Flash the writable parameters to the EEPROM by running the following command on the target:
./nveeprom_flash -cf ddpx-a.conf -c SF3325-CSI-A -p writable_parameters.txt
Example: Flashing EEPROM on Camera Modules
The SF3324 and SF3325 camera modules contain an EEPROM that may be flashed to contain information about the camera module. You can update these camera modules with the following steps.
To flash EEPROM on camera modules
1. Connect one or more camera modules to one of the camera ports on the NVIDIA® DRIVE™ AGX Toolkit.
2. Determine whether the camera modules are SF3324 or SF3325. All camera modules must be the same.
3. Locate the matching binary (SF3324.bin or SF3325.bin). Both binaries are included in the platform.
4. Run one of the following commands, depending on the number of cameras and the group to which the cameras are connected.
Camera Group
Camera Module
Number of Cameras
Command Set
A
SF3324
1
./nveeprom_flash -cf ddpx-a.conf -c SF3324-CSI-A
-if SF3324.bin
4
./nveeprom_flash -cf ddpx-a.conf -c SF3324-CSI-A
-if SF3324.bin -n 4
SF3325
1
./nveeprom_flash -cf ddpx-a.conf -c SF3325-CSI-A
-if SF3325.bin
4
./nveeprom_flash -cf ddpx-a.conf -c SF3325-CSI-A
-if SF3325.bin -n 4
B
SF3324
1
./nveeprom_flash -cf ddpx-a.conf -c SF3324-CSI-C
-if SF3324.bin
4
./nveeprom_flash -cf ddpx-a.conf -c SF3324-CSI-C
-if SF3324.bin -n 4
SF3325
1
./nveeprom_flash -cf ddpx-a.conf -c SF3325-CSI-C
-if SF3325.bin
4
./nveeprom_flash -cf ddpx-a.conf -c SF3325-CSI-C
-if SF3325.bin -n 4
C
SF3324
1
./nveeprom_flash -cf ddpx-a.conf -c SF3324-CSI-E
-if SF3324.bin
4
./nveeprom_flash -cf ddpx-a.conf -c SF3324-CSI-E
-if SF3324.bin -n 4
SF3325
1
./nveeprom_flash -cf ddpx-a.conf -c SF3325-CSI-E
-if SF3325.bin
4
./nveeprom_flash -cf ddpx-a.conf -c SF3325-CSI-E
-if SF3325.bin -n 4
D
SF3324
1
./nveeprom_flash -cf ddpx-a.conf -c SF3324-CSI-G
-if SF3324.bin
4
./nveeprom_flash -cf ddpx-a.conf -c SF3324-CSI-G
-if SF3324.bin -n 4
SF3325
1
./nveeprom_flash -cf ddpx-a.conf -c SF3325-CSI-G
-if SF3325.bin
4
./nveeprom_flash -cf ddpx-a.conf -c SF3325-CSI-G
-if SF3325.bin -n 4
 
EEPROM Dump Tool (nveeprom_dump)
You can use the EEPROM Dump tool to display the contents of the EEPROM in a human readable format. The tool can also save the EEPROM contents to a file. This tool uses a configuration file to set up the serializer/deserializer link with the camera module.
The application requires that a configuration file and configuration set be specified with the -cf and -c parameters, respectively.
Option
Parameter
Notes
Default
-of
[output file prefix]
If not specified, the contents of the EEPROM is printed. Otherwise, the contents of the EEPROM is saved to files with names prefixed by the given string.
N/A
-lc
N/A
Lists the available configuration sets from the configuration file that the ‑cf option specifies.
N/A
-v
[level]
Logging Level:
0: Errors
1: Warnings
2: Information
3: Debug
If option is not used: 0.
If option is used, but level is not provided: 3.
--all
N/A
Prints the entire EEPROM contents. If this parameter is not specified, the tool prints a summary of the EEPROM contents instead. This flag is not necessary if the -of flag is used.
N/A
-h
N/A
Prints guidance on using the tool.
N/A
-cf
[config file]
Specifies the configuration file. This tool and the nvmimg_cap sample use the same configuration file syntax. For more information, see Image Camera Capture (nvmimg_cap)in this document.
N/A
-c
[name]
Specifies the name of a configuration set in the configuration file that is to be used to configure the tool. This tool and the nvmimg_cap sample use the same configuration file syntax. For more information, see Image Camera Capture (nvmimg_cap) in this document.
N/A
-n
[sensors]
Specifies the number of camera modules from which to read content, starting from link 0.
1
Dumping and Saving the Contents of the EEPROM
To dump the contents of the EEPROM
Run the following command on the target:
./nveeprom_dump -cf ddpx-a.conf -c SF3325-CSI-A
This command prints the contents of the EEPROM on link 0.
To save the contents of the EEPROM to a file
If you provide a file prefix with the ‑of option, the tool stores the EEPROM contents into files:
./nveeprom_dump -cf ddpx-a.conf -c SF3325-CSI-A -of eeprom
This command generates two files: eeprom_link00_factory.txt and eeprom_link00_writable.txt, where the -of option provides the file prefix.
EEPROM Specification
EEPROM datatypes
Name in nveeprom
Data type & description
Size (bytes)
NVEEPROM_TYPE_UINT8
uint8: An unsigned 8 bit integer.
1
NVEEPROM_TYPE_UINT16
uint16: An unsigned 16 bit integer, stored in big endian format.
2
NVEEPROM_TYPE_UINT32
uint32: An unsigned 32 bit integer, stored in big endian format.
4
NVEEPROM_TYPE_UINT64
uint64: An unsigned 64 bit integer, stored in big endian format.
8
NVEEPROM_TYPE_FLOAT
float: An IEEE-754 single precision floating point number, stored in big endian format.
4
NVEEPROM_TYPE_STRING
string: A null terminated string. The null terminator may be left out if the string fills the entire space.
variable
NVEEPROM_TYPE_FIXED
fixed: A 16 bit packed array of fixed point numbers, with user-defined size, precision, and sign.
NOTE: Currently, support is limited to 16-bit fixed-point numbers.
variable
NVEEPROM_TYPE_BINARY
binary: Data with a user defined type, or whose type does not fit any of the other categories.
variable
Factory Section (Read Only)
The module manufacturer writes the factory section to the EEPROM. After that it is considered "read only." Applications running on the DRIVE AGX Toolkit must not write to or change this section.
The parameters stored in the factory section are divided into groups. A group may be present or absent from the section, but the factory section cannot contain only a subset of the parameters in a group; it must contain all of a group's parameters, or none of them. The entire factory section is guarded by a single MD5 checksum.
The factory section may contain the following groups:
Camera Module Specification
Module Maker Intrinsic Parameters
Channel Color Responses
Lens Shading Data
Sensor Fuse ID
Writable Section
Applications running on the DRIVE AGX Toolkit can write to the writable section. They can add or modify parameters in that section but cannot remove them.
The parameters in the writable section are also divided into groups. Parameters that have never been written are marked as invalid and cannot be read. Each group has its own CRC16 checksum to verify its integrity.
The writable section may contain the following groups:
Intrinsic Parameters
Extrinsic Parameters
Second Intrinsic Parameters
Third Intrinsic Parameters
1 KB Scratch Pad
Complete Specification
For the complete EEPROM specification, contact your NVIDIA representative.