cancel
Showing results for 
Search instead for 
Did you mean: 

Capturing Thermal image with Lepton camera and Nucleo U5

ennioaloisini
Senior

Hello everyone. I am writing to you because I am trying to capture a thermal image (frame of temperature values) using a Lepton 2.5 thermal camera with Break Out board 2.0 connected to a Nucleo U5A5ZJ-Q board. First I connected the following pins of the Break Out board 2.0 to the Nucleo board, as shown in the table below.

ennioaloisini_0-1751563547732.png

I checked the communication of the I2C on the oscilloscope and it seems good. Anyway I read 0 as the temperature of the case of the Lepton Thermal camera and I have never received the VSYNC signal from the Lepton Thermal camera to read the thermal frame on the SPI.

I tried to put software pull-up and to remove them on the I2C, but the situation remains the same. 

Then I noted that about each minute the Lepton thermal camera shutter close and open for a while.

Do you have any idea how I can solve this problem?

 

Thank you very much for the support!

 

5 REPLIES 5
KDJEM.1
ST Employee

Hello @ennioaloisini;

 

Can you share the Lepton 2.5 thermal camera datasheet?

Can you give more details regarding PB0 pin configuration?

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi KDJEM.1,

thank you very much for the answer.

Here below the PB0 configuration.

ennioaloisini_0-1751909995616.png

Regarding the Lepton 2.5 thermal camera datasheet, please find attached Lepton datasheet, Lepton Software IDD and Breakout Board datasheet.

 

Best regards

 

Ennio

 

KDJEM.1
ST Employee

Hi  @ennioaloisini;

 

Thank you for sharing the lepton camera datasheet.

Are you able to read the device ID?  What SPI frequency did you use? 

How to write your question to maximize your chances to find a solution - STMicroelectronics Community

I recommend you to look at AN5543 and at Getting started with SPI - stm32mcu and check the SPI configuration.

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi @KDJEM.1 ,

I tried to read the device ID. I read 0. It is a strange value.

I used the following line of codes to read the device ID.

 

uint16_t Lepton_ReadCameraID(void)
{
  HAL_StatusTypeDef status;
  uint8_t tx_buf[2];
  uint8_t rx_buf[2];
  uint16_t timeout = 1000;

  // STEP 1: Write command ID (0x0004) in the register 0x0008
  tx_buf[0] = 0x00;
  tx_buf[1] = 0x04;
  status = HAL_I2C_Mem_Write(&hi2c1, LEPTON_I2C_ADDR << 1, CMD_ID_REGISTER, I2C_MEMADD_SIZE_16BIT, tx_buf, 2, 100);
  if (status != HAL_OK) return 0xFFFF;

  // STEP 2: Write command GET (0x0000) in the register 0x0006
  tx_buf[0] = 0x00;
  tx_buf[1] = 0x00;
  status = HAL_I2C_Mem_Write(&hi2c1, LEPTON_I2C_ADDR << 1, CMD_TYPE_REGISTER, I2C_MEMADD_SIZE_16BIT, tx_buf, 2, 100);
  if (status != HAL_OK) return 0xFFFF;

// STEP 3: Wait that bit 1 of the statu register is 0
  do {
    status = HAL_I2C_Mem_Read(&hi2c1, LEPTON_I2C_ADDR << 1, STATUS_REGISTER, I2C_MEMADD_SIZE_16BIT, rx_buf, 2, 100);
    HAL_Delay(10);
    timeout--;
  } while ((status == HAL_OK) && (rx_buf[1] & 0x02) && (timeout > 0));

  if (timeout == 0) return 0xFFFF;

  // STEP 4: Read the result from the register 0x0004
  status = HAL_I2C_Mem_Read(&hi2c1, LEPTON_I2C_ADDR << 1, RESULT_REGISTER, I2C_MEMADD_SIZE_16BIT, rx_buf, 2, 100);
  if (status != HAL_OK) return 0xFFFF;

  uint16_t cam_id = (rx_buf[0] << ‌‌ | rx_buf[1];
  return cam_id;
}

 

The bit 1 of the Status Register is always at 1. I removed the Step 3, but at the end I read 0 as Device ID.

I checked also on the oscilloscope and the I2C communication seems ok.

Regarding the SPI, I set the prescarel at 2 and the baud rate is 2.0 MBits/s.

 

Let me know!

 

Thank you very much for the support!

 


Edited to apply source code formatting - please see How to insert source code for future reference.

The instructions were also included in How to write your question to maximize your chances to find a solution - please do read that as well!

Hi everyone,

I tried to check also on the https://github.com/FLIR/lepton, but it seems that the functions that I'm using are correct. I do not know why I read ID = 0 and case temperature = 0 on the I2C. Probably the module is not ready to answer or there is some hardware or software problem.

Do you have any advices?

Let me know!

 

Thank you very much for the support!