Skip to content
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

Is there a version of a TOML parser for Arduino? #82

Open
Alacritous opened this issue Sep 28, 2019 · 3 comments
Open

Is there a version of a TOML parser for Arduino? #82

Alacritous opened this issue Sep 28, 2019 · 3 comments

Comments

@Alacritous
Copy link

I took a stab at getting it to run in the Arduino IDE but I just don't know enough.

@Alacritous Alacritous changed the title Is there a version of this for Arduino? Is there a version of a TOML parser for Arduino? Sep 28, 2019
@ToruNiina
Copy link
Owner

For toml11, there isn't.
Actually, I'm not familiar with Arduino, so I totally don't have any idea about this. Sorry.

If you have any idea to get rid of the difficulty, PRs and suggestions are welcome.

@Alacritous
Copy link
Author

I was just curious. I don't have the skill to make something of that nature myself. Otherwise I would have. I just stumbled across TOML and I like its features and when I looked around I didn't see arduino support. Arduino uses C++ but I don't know enough about the differences in infrastructure to be able to port something like this to it.

@cr1tbit
Copy link

cr1tbit commented Aug 16, 2023

Well I do have some skills, just enough to make it work, not wholly understanding the process though 😅

Some tips for people stumbling across this - i used platformio with Arduino framework to make it work:

  1. Arduino core for esp32 uses GCC 8.4.0, which could not compile the library at the start. I had to provide a little patch (branched from 3.7.0, I don't think worth merging upstream)

cr1tbit@cbd4df7

  1. This library is enormous (measuring in code size) compared to usual arduino libraries, in my case the compiled binary wouldn't fit into the default flash layout (with 2 flash banks for OTA update). Can be fixed by setting:

board_build.partitions = huge_app.csv

  1. Tomls tend to be big. The main arduino setup-loop has stack size only 8k or so, and it's hardcoded into arduino core. In my case I moved toml config handling to a separate task like this:
    xTaskCreate( TomlTask, "toml task",
      65536, NULL, 6, NULL );
  1. Platformio can natively include this lib, by simply putting it as one of the dependencies. You can do it like this (my fork compiles fine)
lib_deps = 
        [...]
        https://github.com/cr1tbit/toml11.git#cbd4df71a9f853c50baeedf31c9a106e11409a19

https://github.com/cr1tbit/antController-fw for reference how to make it work

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