diff --git a/targets/FreeRTOS/ESP32_DevKitC/nanoCLR/Windows.Devices.I2c/win_dev_i2c_native_Windows_Devices_I2C_I2cDevice.cpp b/targets/FreeRTOS/ESP32_DevKitC/nanoCLR/Windows.Devices.I2c/win_dev_i2c_native_Windows_Devices_I2C_I2cDevice.cpp index b772a2ed1c..60946db9fa 100644 --- a/targets/FreeRTOS/ESP32_DevKitC/nanoCLR/Windows.Devices.I2c/win_dev_i2c_native_Windows_Devices_I2C_I2cDevice.cpp +++ b/targets/FreeRTOS/ESP32_DevKitC/nanoCLR/Windows.Devices.I2c/win_dev_i2c_native_Windows_Devices_I2C_I2cDevice.cpp @@ -170,7 +170,7 @@ HRESULT Library_win_dev_i2c_native_Windows_Devices_I2c_I2cDevice::NativeTransmit writeSize = writeBuffer->m_numOfElements; } - CLR_RT_HeapBlock_Array* readBuffer = stack.Arg3().DereferenceArray(); + CLR_RT_HeapBlock_Array* readBuffer = stack.Arg2().DereferenceArray(); if (readBuffer != NULL) { // grab the pointer to the array by getting the first element of the array