Myzhar / Lepton3_Jetson

Library and examples to connect the FLIR Lepton3 thermal camera to Nvidia Jetson embedded boards
MIT License
52 stars 15 forks source link

Infinite Forcing RESYNC error #2

Closed emrahustun closed 3 years ago

emrahustun commented 4 years ago

"Forcing RESYNC" message never ends. Even for different SPI ports, and frequency values. Debug mode prints "Wrong Packet ID for TTT in segment". Seems like Lepton3.cpp line 336 uint8_t pktNumber = segmentAddr[20*mPacketSize+1]; allways 0. Any idea?

Myzhar commented 4 years ago

Hi @emrahustun how long are the connection cables? SPI and I2C are not designed to have long cables and maybe that the SPI signal is not stable. Try to use an oscilloscope to monitor it and see if you have good square waves or bad "shark fin" waves.

Elieva commented 4 years ago

Hi, I think it may come from a SPI issue on the Jetson Nano for the SPI_MODE3. There is a patch for the jetson nano on this forum: https://forums.developer.nvidia.com/t/two-spi-bugs-on-jetson-nano/111323/3 (I have not tried to patch yet my jetson nano...)

Myzhar commented 4 years ago

@Elieva usually the problem comes from the default size of the buffer for the SPI. It was the same on the BeagleBone and on the Rpi3. @emrahustun have you followed the instruction to enlarge the size of the SPI buffer of the Jetson Nano? This is my guide to perform the operation: https://www.myzhar.com/blog/jetson-nano-with-flir-lepton3/#Change_SPI_buffer_size

emrahustun commented 4 years ago

ave you followed the instruction to enlarge the size of the SPI buffer of the

Thanks for suggestions. Yes I tried resizing buffer, but it seems I have an issue with Lepton device itself. Will try with an other Lepton. Thanks again.

rahulsharma11 commented 3 years ago

Hi, I tried lepton3 with breakout_v2 with Jetson nano. Using latest jetpack4.4 (32.4.3) I checked all the steps and enlarged the SPI buffer size also. But still getting the error "Forcing resync " infinitely. Anyone succeeded here ? Thanks.

Myzhar commented 3 years ago

Infinite Forcing Resync means problems in SPI communication. I suggest you to test all the cables and to monitor the signals with an oscilloscope

rahulsharma11 commented 3 years ago

Hi, Thanks for the reply.

Just to add information, i have made a small PCB and mounted lepton directly on jetson nano with that so not using any wire that acts as noise.

Still i would try debug with oscilloscope

rahulsharma11 commented 3 years ago

hi, just wanted to know as i am using V2 breakout where VSYNC signal is there.

Shall i have to use that pin also or i can leave it ?

This link is utilising that pin- https://lepton.flir.com/getting-started/raspberry-pi-lepton/

Myzhar commented 3 years ago

The VSYNC pin utilization is not mandatory, even if it would be very useful to know exactly when new data are available before asking for them to the sensor.

Check the wiring on the little PCB that you have done and verify that you connected it to the same I2C and SPI port that I used for my project, otherwise you must modify the code to match your configuration.

rahulsharma11 commented 3 years ago

Wirings are same and i can also detect the module as "i2cdetect -y -r 0".

Not sure may be should try to check with jetpack3.3 as tested

rahulsharma11 commented 3 years ago

Hi , Just a quick doubt.

Can you share the details of jetson nano OS that has been tested? there is a conflict between using Jetpack3.3 or L4T [32.3]. As default jetpack version for jetson nano is 4.2. Thanks.

rahulsharma11 commented 3 years ago

Hi, It worked thanks

Myzhar commented 3 years ago

Hi @rahulsharma11 I installed on a new SD CARD for the NANO the Jetpack 4.4 with L4T R32.4.3 and I'm facing your same problem. I checked the connection simply inserting the SD Card with L4T R32.3 and it works without any issue, so connection is right. Have you succeeded using the Lepton with latest Jetpack?

rahulsharma11 commented 3 years ago

Hi, I have not tried with latest jetpack. Need to check the SPI /i2c driver. Older one is working.

Myzhar commented 3 years ago

I opened a thread on Nvidia devtalk forum: https://forums.developer.nvidia.com/t/spi-bus-on-jetson-nano-l4t-32-4-3-not-working/154259

Elieva commented 3 years ago

Hi, I was able to use the camera by changing the SPI mode to 1 instead of 3. I know it is not a proper fix because the camera specification asks for mode 3. But maybe this info can help for debugging.

Myzhar commented 3 years ago

@Elieva this is a very important information! I just tested it and it works also for me. I suddenly report this to the Nvidia engineer that is helping me on Devtalk forum.