Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3552

Interfacing (DSI, CSI, I2C, etc.) • ATSHA204 Wake up problem

$
0
0
I am trying to wakeup ATSHA20a crypto IC, connecting on I2C bus (custom CM4 board).
I use atmel-sha204a module with some mod

Code:

--- drivers/crypto/atmel-i2c.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)diff --git a/drivers/crypto/atmel-i2c.c b/drivers/crypto/atmel-i2c.cindex 83a9093eff25..93ebbb88b5b5 100644--- a/drivers/crypto/atmel-i2c.c+++ b/drivers/crypto/atmel-i2c.c@@ -170,14 +170,22 @@ static int atmel_i2c_wakeup(struct i2c_client *client) struct atmel_i2c_client_priv *i2c_priv = i2c_get_clientdata(client); u8 status[STATUS_RSP_SIZE]; int ret;-+        +        struct i2c_msg msg;+        u8 val = 0;+ +        msg.addr  = 0;+        msg.flags = I2C_M_IGNORE_NAK;+        msg.len   = sizeof(val);+        msg.buf   = &val;+        i2c_transfer(client->adapter, &msg, 1); /*  * The device ignores any levels or transitions on the SCL pin when the  * device is idle, asleep or during waking up. Don't check for error  * when waking up the device.  */-i2c_transfer_buffer_flags(client, i2c_priv->wake_token,-i2c_priv->wake_token_sz, I2C_M_IGNORE_NAK);+//i2c_transfer_buffer_flags(client, i2c_priv->wake_token,+//i2c_priv->wake_token_sz, I2C_M_IGNORE_NAK);  /*  * Wait to wake the device. Typical execution times for ecdh and genkey-- 2.43.0
I also check I2C bus with logic analyser (pulsewiev screenshot)
Знімок екрана з 2024-05-07 06-25-43.png
And I get

Code:

[  114.324957] atmel-sha204a: probe of 1-0064 failed with error -5

Statistics: Posted by Kuzma30 — Tue May 07, 2024 6:35 am



Viewing all articles
Browse latest Browse all 3552

Trending Articles