Re: [Elphel-support] Script for changing the SADDR bit for the MT9P031 sensor

2018-03-08 Thread Oleg
Frederick,

1. Here are the files: https://community.elphel.com/f
iles/393/20180308_test_0x5d/

2. Before copying - boot from the card and check the linux version:

> root@elphel393:~# uname -r
> 4.9.0-xilinx-v2017.3


* If it's 4.9.0-xilinx-v2017.3 then copying only devicetree.dtb and uImage
might be enough - they are on the FAT partition of the card.
* In case of fail if you use minicom (or putty or other serial terminal
program) there will be some kind of a kernel panic.

3.
My bootlog for 0x5d:

> ...
> [   21.692018] {0} Setting i2c_addr to 0x5d
> [   21.696039] Read i2c (port = 0, sa7=0x5d, reg=0x0) chip ID=
> ...
> [   21.747074] {1} Setting i2c_addr to 0x5d
> [   21.756495] Read i2c (port = 1, sa7=0x5d, reg=0x0) chip ID=
> ...
> [   21.807904] {2} Setting i2c_addr to 0x5d
> [   21.817282] Read i2c (port = 2, sa7=0x5d, reg=0x0) chip ID=
> ...
> [   21.868874] {3} Setting i2c_addr to 0x5d
> [   21.878291] Read i2c (port = 3, sa7=0x5d, reg=0x0) chip ID=

...


bootlog for 0x48 (2 sensors connected):

> ...

[   21.607985] {0} Setting i2c_addr to 0x48
> [   21.612007] Read i2c (port = 0, sa7=0x48, reg=0x0) chip ID=1801
> [   21.617888] Found MT9P001 2592x1944 sensor, chip ID=1801
> [   21.674977] {1} Setting i2c_addr to 0x48
> [   21.684454] Read i2c (port = 1, sa7=0x48, reg=0x0) chip ID=1801
> [   21.690690] Found MT9P001 2592x1944 sensor, chip ID=1801
> [   21.747575] {2} Setting i2c_addr to 0x48
> [   21.757033] Read i2c (port = 2, sa7=0x48, reg=0x0) chip ID=
> ...
> [   21.808291] {3} Setting i2c_addr to 0x48
> [   21.817738] Read i2c (port = 3, sa7=0x48, reg=0x0) chip ID=
> ...


Best regards,
Oleg Dzhimiev
Electronics Engineer
phone: +1 801 783  x124
Elphel, Inc.
___
Support-list mailing list
Support-list@support.elphel.com
http://support.elphel.com/mailman/listinfo/support-list_support.elphel.com


Re: [Elphel-support] Script for changing the SADDR bit for the MT9P031 sensor

2018-03-08 Thread Oleg
Hi,


> Can you send me an updated version of the firmware using the 0x5D addr
> please?
>
Ok, I will send you a link once I prepare it later today. I will turn the
kernel debug on.

Will I be able to copy the files you will send me on the camera micro SD
> card so I can boot from it?
>
Do you have linux? There will be a script *write_bootable_mmc.py* in the
archive that can format it, provided it's discovered in the system as
/dev/sdX (if it's discovered as /dev/mmcblk the script will need a minor
modification)
The instructions how to format it manually can be found here
.

Best regards,
Oleg Dzhimiev
Electronics Engineer
phone: +1 801 783  x124 <(801)%20783->
Elphel, Inc.
___
Support-list mailing list
Support-list@support.elphel.com
http://support.elphel.com/mailman/listinfo/support-list_support.elphel.com


Re: [Elphel-support] Script for changing the SADDR bit for the MT9P031 sensor

2018-03-08 Thread Frederick Gamache
Hello Oleg,

Thank you for your fast response.

I'm not able to build the firmware at the moment. Following the spec,
changing the SADDR pin to a HIGH value should translate the device ID to
0xBA, so *0x5D* as the 7-bit address.
I'm able to read the device registers on your sensor board using the
print_sensor_i2c command.

Can you send me an updated version of the firmware using the 0x5D addr
please?
Will I be able to copy the files you will send me on the camera micro SD
card so I can boot from it?

Best regards,
Frederick




On Wed, Mar 7, 2018 at 12:35 PM, Oleg 
wrote:

> Hi,
>
> 1.
> I made change so it could be set int device tree (0x48) - just noticed a
> bug and had to fix it:
>
>>  ...
>
> elphel393_sensor_i2c: elphel393-sensor-i2c@0 {
>> compatible = "elphel,elphel393-sensor-i2c-1.00";
>> /* Add known devices: name, slave address (7-bit), number
>> of address bytes, number of data bytes, SCL frequency (kHz) */
>> elphel393-sensor-i2c,i2c_devices = "mt9f0020x10
>> 2 2 500",
>>"mt9p006*0x48*
>> 1 2 500",
>>"el103590x08 1
>> 2 500",
>>"el10359_32 0x08 1
>> 4 500",
>>"pca9500_eeprom 0x50 1
>> 1 100",
>>"sensor_eeprom  0x50 1
>> 1 100",
>>"sensor_temp0x18 1
>> 2 100",
>>"cy223930x69 1
>> 1 100";
>> } ;
>
> ...
>
>
> Commands to recompile devicetree:
> decompile:
>
>> $ dtc -I dtb -O dts devicetree.dtb -o devicetree.dts
>
> compile:
>
>> $ dtc -I dts -O dtb devicetree.dts -o devicetree.dtb
>
>
>
> 2. Are you able to build the firmware or should I upload it to somewhere?
>
>
> 3. Before any updating - can you read sensor's registers?
>
>> ~$ ssh root@192.168.0.9
>> root@elphel393:~# cd /usr/local/verilog/
>> root@elphel393:~# test_mcntrl.py @hargs-after
>> x393 --> r
>> x393 --> print_sensor_i2c (without args it will print usage)
>>
>> *...*
>> *print_sensor_i2c *
>> *...*x393 --> print_sensor_i2c 0 0x3000 0xff *0x10* 0
>> *   Result: 0x2e01*
>
>
>  - 10393's port the sensor is connected to. Can be: 0..3
>  - I tried on a sensor that has 16-bit addresses (0x3000), for
> MT9P006 it can be 0x0 (ID register addr)
> * *- set 0xff
> * -* SADDR
>
>
> 4. Side note (sensor power and clock):
> At boot autocampars.php calls: test_mcntrl.py @hargs
>
> test_mcntrl.py (located at /usr/local/bin/)
> hargs (located at /usr/local/verilog/)
>
> Inside hargs file there are commands for:
> - which bitstream to load
> - setting sensor power: for MT9P006 it's PAR12 which translates to
> {"mv":2800, "freq":24.0,"iface":"2V5_LVDS"}
> - setting sensor clock frequency: for MT9P006 it's 24.0 "2V5_LVDS"
>
> Best regards,
> Oleg Dzhimiev
> Electronics Engineer
> phone: +1 801 783  x124 <(801)%20783->
> Elphel, Inc.
>
___
Support-list mailing list
Support-list@support.elphel.com
http://support.elphel.com/mailman/listinfo/support-list_support.elphel.com