Error: amb_ard_pin_check_fun. Incorrect pin: 26 When Merging u8g2 and SensirionI2cSht4x

Ameba Version V3.1.9 , Board: Datalogger IoT (RTL8720DF)
我發現在同一個專案中同時使用 u8g2 函式庫和 SensirionI2cSht4x 函式庫時,會出現以下錯誤訊息:“Error amb_ard_pin_check_fun. Incorrect pin: 26 Please check if pin or board is right.”
sensirion sht40 lib

Ameba version 3.1.9
PS : 我退到 Version 3.1.6 是可以運作正常的,同時也沒有任何錯誤

您好 @Kevin,想向您確認一下,3.1.8 也有類似問題嗎?

是的 V3.1.8 也是同樣問題

我嘗試一下再讓您知道。謝謝!

Hi @Kevin ,

不好意思,您有同時使用 u8g2 函式庫和 SensirionI2cSht4x 函式庫的範例讓我參考嗎?謝謝

您好,
附件是 範例程式 程式庫
請參考
感謝

Pammy via Realtek Ameba IOT Developers Forum (AMB82 RTL8722 RTL8195 RTL8710 RTL8720 BW16 Development board) - IOT / MCU Solutions 瑞昱開發者論壇 開發板 开發者论坛 开發板 <notifications@ameba.discoursemail.com> 於 2025年7月1日 週二 下午2:30寫道:

(attachments)

new_sht40_scd41.zip (1.63 KB)
Sensirion_I2C_SHT4x.zip (1.95 MB)

1 Like

Hi Kevin,

我嘗試了一下,無法複製 “Error amb_ard_pin_check_fun. Incorrect pin: 26 Please check if pin or board is right.” 錯誤。

我這裏是沒連Sensor, 所以以下的 log 應該是預期中的:
Error trying to execute serialNumber(): Data too long to fit in transmit buffer
Error trying to execute measureLowestPrecision(): Data too long to fit in transmit buffer
Error trying to execute measureLowestPrecision(): Data too long to fit in transmit buffer
Error trying to execute measureLowestPrecision(): Data too long to fit in transmit buffer

使用的是 3.1.9 SDK。


您好 @Kevin

您可以參考這個 commit 來修改您的 Wire.cpp. Update Wire.cpp by pammyleong · Pull Request #287 · Ameba-AIoT/ameba-arduino-d · GitHub

謝謝

Hi Pammy,

可以再幫我確認嗎?
這次更新也沒用。
因為日前必須切換其他版本,回過頭來測試的時候又出現。更新Wire.cpp 也沒用,我不知道這個狀況距離上次 Wire.cpp 更新後已經存在多久了
這個問題修正完後是否可以直接 release ? 這個問題非常困擾,已經快 2 年了沒解決,用戶不一定會反饋.
但是生意一定會受影響,已經超過3 個月沒接新單了。目前的應用都是使用 Sensirion 。感謝!
kevin

Pammy via Realtek Ameba IOT Developers Forum (AMB82 RTL8722 RTL8195 RTL8710 RTL8720 BW16 Development board) - IOT / MCU Solutions 瑞昱開發者論壇 開發板 开發者论坛 开發板 <notifications@ameba.discoursemail.com> 於 2025年7月30日 週三 下午4:50寫道:

Hi Pammy,

我想到還有 amb_ard_pin_check.c , 但是我更新了也沒用
所以,問題仍存在.
麻煩幫我確認. 感謝

Kevin

Pammy via Realtek Ameba IOT Developers Forum (AMB82 RTL8722 RTL8195 RTL8710 RTL8720 BW16 Development board) - IOT / MCU Solutions 瑞昱開發者論壇 開發板 开發者论坛 开發板 <notifications@ameba.discoursemail.com> 於 2025年7月30日 週三 下午4:50寫道:

Hi @Kevin

您是指還一直有 incorrect pin 26 問題嗎?我這裏看一下

Hi Pammy,

昨天有找到問題了, 是SPI & I2C 的初始順序對調就可以了.
這次是 incorrect pin 0
結論是 要先 SPI → I2C 的順序 , 反了就會出現錯誤
不好意思,虛驚一場.

Kevin

Pammy via Realtek Ameba IOT Developers Forum (AMB82 RTL8722 RTL8195 RTL8710 RTL8720 BW16 Development board) - IOT / MCU Solutions 瑞昱開發者論壇 開發板 开發者论坛 开發板 <notifications@ameba.discoursemail.com> 於 2025年10月22日 週三 上午10:27寫道:

Hi @Kevin

好的, 沒問題