esp32 newlib migration or access via Arduino ide

comperem
Posts: 4
Joined: Sat Jan 25, 2020 8:08 pm

esp32 newlib migration or access via Arduino ide

Postby comperem » Mon Feb 03, 2020 2:11 pm

Hello,

The ESP32 devices are outstanding. I'm using the Arduino IDE but can also see some interesting code in the newlib github respository here:

Code: Select all

https://github.com/espressif/esp-idf/tree/master/components/newlib
Is this going to be integrated into the Arduino ide library? Is there a (simple) way to access this code through Arduino IDE now?

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: esp32 newlib migration or access via Arduino ide

Postby ESP_Sprite » Mon Feb 03, 2020 3:51 pm

Newlib already is part of ESP-IDF, and as the ESP32 Arduino environment is built on top of that, you should be able to use it straight out of the box.

comperem
Posts: 4
Joined: Sat Jan 25, 2020 8:08 pm

Re: esp32 newlib migration or access via Arduino ide

Postby comperem » Mon Feb 03, 2020 4:07 pm

Ok, this is somewhat good news but I don't have any of the `newlib` files, for example `test_newlib.c` and friends.

I've used the Arduino IDE instructions using the Board Manager and the Stable Release link:
https://github.com/espressif/arduino-es ... manager.md

This works and provides basic functionality and I can program the ESP32 using the Arduino IDE but only the basic esp32 library is installed.

Do you have a recommendation on these two options?
(1) reinstall using the Board Manager and Development release link
(2) reinstall using the detailed steps in 'Using Arduino IDE with the development repository'

I'll continue investigating.

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: esp32 newlib migration or access via Arduino ide

Postby ESP_krzychb » Mon Feb 03, 2020 5:49 pm

Hi comperem,

With arduino-esp32 installation you are getting compiled newlib binary (not individual .c files) + headers.

/home/user-name/.arduino15/packages/esp32/hardware/esp32/1.0.4/tools/sdk/lib/libnewlib.a (compiled binary)
/home/user-name/.arduino15/packages/esp32/hardware/esp32/1.0.4/tools/sdk/include/newlib (headers)

You should have all you need to use newlib already (plus several other libraries compiled from "esp-idf/components"), no need to redo the installation steps, or do it in an alternate way.

comperem
Posts: 4
Joined: Sat Jan 25, 2020 8:08 pm

Re: esp32 newlib migration or access via Arduino ide

Postby comperem » Tue Feb 04, 2020 3:36 am

Ok, if the newlib .a library is there (I checked - it is) and the headers are there (I checked, time.h and others are there), then something in the `#define`'s are not triggering `clock_gettime()`.

I'm getting: `'clock_gettime' was not declared in this scope`

I need a `clock_gettime()` example that works. There's no example in the Arduino examples with `clock_gettime()`

What is the proper approach to getting the `#defines` to trigger `clock_gettime()`?

Who is online

Users browsing this forum: No registered users and 103 guests