Error compiling Modbus library
Hi,
I am trying to use the modbus mater and slave sketch from the blog but get an error when trying to compile for the D21G.
If I choose another samd21 board it compiles OK.
How can I fix this?
Arduino: 1.8.13 (Windows 10), Board: "Industruino D21G"
libraries\ArduinoModbus\libmodbus\modbus.c.o: In function `_sleep_response_timeout':
C:\Users\frank\Documents\Arduino\libraries\ArduinoModbus\src\libmodbus/modbus.c:157: undefined reference to `delayMicroseconds'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Industruino D21G.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
So I have downgraded from modbus library v1.04 to v1.03 and it seems to compile OK. Is this the reccomended procedure?
Hi, yes that example was based on ArduinoModbus v1.0.1
It seems this commit removes a line that is necessary for Industruino D21G, i have asked to include it again https://github.com/arduino-libraries/ArduinoModbus/commit/629884d0dbf32abc76e71e7f2349aaef5afb3234
In the meantime, if you want to use the current v1.0.4 you could include that line in modbus.c
Your answer
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
Stats
Asked: 5/30/21, 12:12 AM |
Seen: 1475 times |
Last updated: 5/31/21, 1:26 AM |