-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I2C slave does not work above MiniCore v1.0.4 #122
Comments
What IDE version are you using? From v2.0.0 and later MiniCore hosts its own version of Wire, while v1.0.4 uses the version that ships with the IDE. Does it work in your current IDE when using the Arduino UNO as target? |
Arduino IDE is 1.8.10
I2C Slave works perfectly fine when I use UNO as target.
Regards,
Evans
…On Sat, Jan 4, 2020 at 1:18 AM Hans ***@***.***> wrote:
What IDE version are you using? From v2.0.0 and later MiniCore hosts its
own version of Wire, while v1.0.4 uses the version that ships with the IDE.
Does it work in your current IDE when using the Arduino UNO as target?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#122?email_source=notifications&email_token=AEDV24J2YIFYBJMXM3ZVTV3Q37BT7A5CNFSM4J5SM2T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEICJSVY#issuecomment-570726743>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEDV24LF22SENJBM5I35OMTQ37BT7ANCNFSM4J5SM2TQ>
.
|
Thanks! I compared the two versions, and there were done some changes to Wire.cpp in 2017 (to fix slave functionality) that I didn't catch. I'll fix it soon! Would you test it for me after I've pushed a fix? 🙂 |
@evansgl I've now pushed a fix. Could you test it with your hardware? You'll have to do a manual installation of MiniCore to get the latest fix. |
Thanks Hans,
Let me try it and I'll let you know tomorrow.
Regards,
Evans
…On Sun, Jan 5, 2020 at 5:12 PM Hans ***@***.***> wrote:
@evansgl <https://github.com/evansgl> I've now pushed a fix. Could you
test it with your hardware? You'll have to do a manual installation of
MiniCore to get the latest fix.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#122?email_source=notifications&email_token=AEDV24OH2HPZWQAGXQKJCOLQ4H2GNA5CNFSM4J5SM2T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIDY6YY#issuecomment-570920803>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEDV24NFN7IBNR36Q5ZTHX3Q4H2GNANCNFSM4J5SM2TQ>
.
|
Did you get the chance to test this? 🙂 |
Apologies for the delay.
Unfortunately I tried yesterday but it didn't work.
Copied the latest submitted Wire libraries from git and cleaned all my
built files.
Recompiled it and the atmega is still not working as a i2c slave.
To further test, I copied the original Wire library in the Minicore folder
and this worked.
To be honest I didn't check the code you submitted yet. I just moved the
two Wire* libraries into my workspace
Regards,
Evans
…On Sat, Jan 11, 2020 at 1:13 AM Hans ***@***.***> wrote:
Did you get the chance to test this? 🙂
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#122?email_source=notifications&email_token=AEDV24NQJCYSRKPA7OJ7UEDQ5D6JTA5CNFSM4J5SM2T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIVPU4I#issuecomment-573241969>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEDV24OMCHICDVPC67FYE4LQ5D6JTANCNFSM4J5SM2TQ>
.
|
That's strange. Did you only copy the Wire.h and Wire.cpp? You also need the two files (twi.h and twi.c) located in the utility folder. |
I have just cloned the git MiniCore repo and fully replaced "2.0.3" library
directory. I also verified that the compiler was using the correct path.
Unfortunately it does not work.
…-I/Users/evansg/Library/Arduino15/packages/MiniCore/hardware/avr/2.0.3/libraries/Wire/src
/Users/evansg/Library/Arduino15/packages/MiniCore/hardware/avr/2.0.3/libraries/Wire/src/Wire.cpp
-o
/var/folders/56/h22y8dw13mz50028k3z4381c0000gn/T/arduino_build_890922/libraries/Wire/Wire.cpp.o
/Users/evansg/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-gcc
-c -g -Os -std=gnu11 -ffunction-sections -fdata-section
On Sat, Jan 11, 2020 at 5:42 PM Hans ***@***.***> wrote:
That's strange. Did you only copy the Wire.h and Wire.cpp? You also need
the two files (twi.h and twi.c) located in the utility folder.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#122?email_source=notifications&email_token=AEDV24M2CO4VSRGDTBCUH6DQ5HSFVA5CNFSM4J5SM2T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIWER2Q#issuecomment-573327594>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEDV24PFFBSRYV5MEFNOEFTQ5HSFVANCNFSM4J5SM2TQ>
.
|
OK. I will try it myself on my own hardware to see if I can figure it out |
I did test the master/slave functionality using this code: https://www.arduino.cc/en/Tutorial/MasterWriter I used a 328P as a slave. It works just fine with the fix I applied. |
I am using Atmega328PB, MiniCore 2.0.3, Arduino IED 1.8.10. The two ends are Atmega328PB. It worked when I replaced the Wire directory from libraries in MiniCore by the Wire folder from standard Arduino AVR core 1.8.2 libraries. I appreciate your huge efforts. Thank you very much. |
@mhmayyan can you retry your test but with a manual install of MiniCore instead? I did push a fix for this that solved this issue for me at least. |
I deleted all the contents of the folder "..\MiniCore\hardware\avr\2.0.3". Then I downloaded the zip file of the repository and extracted the contents of "MiniCore-master.zip\MiniCore-master\avr" into "..\MiniCore\hardware\avr\2.0.3". The problem is now back. The slave sender does not respond to the master reader but it like before still detects the request from the master reader. Again, when I replaced the Wire folder in libraries by the one from Arduino AVR it worked. |
That's really strange. It works for me! Can you turn on the compiler output, and have a look at what SPI.cpp file is being compiled, open this and check if this fix are applied to the file? |
I compared the source files from IDE 1.8.10 with the files from MiniCore, and there was some code lines in the MiniCore version that shouldn't have been there. These have been removed now. |
Now it works. Thank you very much. |
Thanks for testing! Now the library is identical to the official one too. I wil apply this fix to my other Arduino cores as well. |
Seems that all versions of MiniCore v2.x.x are affected by the same issue.
I have an atmega328 as an I2C slave and it does not work properly.
It does not report something in the I2C channel.
If I use the stock and latest arduino hardware pack the I2C slave works. It also works fine with any 1.x.x version of Minicore.
The text was updated successfully, but these errors were encountered: