Skip to content

Issue compiling MODBUS library #10

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

Closed
iMarvinS opened this issue Mar 29, 2015 · 4 comments
Closed

Issue compiling MODBUS library #10

iMarvinS opened this issue Mar 29, 2015 · 4 comments

Comments

@iMarvinS
Copy link

Hello!
I just wanted to compile the arduino-modbus-slave library (https://code.google.com/p/arduino-modbus-slave/downloads/detail?name=MODBUS.zip&can=2&q=) which seems to be perfectly compatible with the ESP8266 Arduino SDK because it only uses the Serial library which is fully adopted.
When I try to compile my sketch which depends on the MODBUS library I get the following error:
bildschirmfoto 2015-03-29 um 15 21 24

Does anybody know where the issue is?
It seems to be an issue with the xtensa toolchain but I cannot find out what it is.

Kind Regards
Marvin

@igrr
Copy link
Member

igrr commented Mar 29, 2015

The issue is because the library seems to use malloc function, which is not
available. There are three ways to fix that:

  • replace malloc and free with new and delete in the library
  • replace malloc and free with os_malloc and os_free which are defined in
    ESP SDK
  • fix ulibc to use os_malloc instead of malloc.
    On Mar 29, 2015 4:29 PM, "iMarvinS" notifications@github.com wrote:

Hello!
I just wanted to compile the arduino-modbus-slave library (
https://code.google.com/p/arduino-modbus-slave/downloads/detail?name=MODBUS.zip&can=2&q=)
which seems to be perfectly compatible with the ESP8266 Arduino SDK because
it only uses the Serial library which is fully adopted.
When I try to compile my sketch which depends on the MODBUS library I get
the following error:
[image: bildschirmfoto 2015-03-29 um 15 21 24]
https://cloud.githubusercontent.com/assets/7142039/6885609/f0081af4-d627-11e4-8ad7-a55a682a2463.png

Does anybody know where the issue is?
It seems to be an issue with the xtensa toolchain but I cannot find out
what it is.

Kind Regards
Marvin

Reply to this email directly or view it on GitHub
#10.

@igrr
Copy link
Member

igrr commented Mar 29, 2015

A lot of people seem to be having issues related to malloc, so I created #11 to track it.

@iMarvinS
Copy link
Author

Thank you!
I replaced all malloc and free calls with their corresponding C++ equivalents (new and delete).
Now the library works flawless on the ESP as well as the Uno.
This issue is resolved now.

Thanks

igrr pushed a commit that referenced this issue Jun 26, 2015
@gkrananth
Copy link

Can you please share the library

igrr pushed a commit that referenced this issue Oct 29, 2015
igrr pushed a commit that referenced this issue Oct 29, 2015
ascillato pushed a commit to ascillato/Arduino that referenced this issue Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants