double precision float on ESP8266
Re: double precision float on ESP32
How does one enable building the firmware for double precision?
Edit to add: This is for an ESP32
Edit to add: This is for an ESP32
Last edited by rpr on Wed Jun 26, 2019 5:58 am, edited 1 time in total.
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: double precision float on ESP8266
I don't know the solution but are you looking for ESP8266 or ESP32? Your title says ESP8266 and your post ESP32..
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Re: double precision float on ESP8266
The place to change is mpconfigport.h in the esp32 directory. Change line:
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
into
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
into
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
Re: double precision float on ESP8266
Thanks for the hint Roberthh, but i need first to understand how to build the FW.
Re: double precision float on ESP8266 -> ESP32
hey
maybe i have to start a new thread for this issue but i cannot build esp32 FW.
installed xtensa, esp-idf
i followed the micropython/ports/esp32/readme but... i probably miss something..
maybe i have to start a new thread for this issue but i cannot build esp32 FW.
installed xtensa, esp-idf
Code: Select all
matthieu@heronux:~/esp/micropython/ports/esp32$ make V=1
fatal: cannot change to '-s': Aucun fichier ou dossier de ce type
** WARNING **
The git hash of ESP IDF does not match the supported version
The build may complete and the firmware may work but it is not guaranteed
ESP IDF path: </home/matthieu/esp/esp-idf/>
Current git hash:
Supported git hash: 6b3da6b1882f3b72e904cc90be67e9c4e3f369a9
aucun répertoire fourni pour -C
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
/bin/sh: 1: cannot create /components: Permission denied
/bin/sh: 1: cannot create /components: Permission denied
/bin/sh: 1: cannot create /components: Permission denied
GEN build/sdkconfig.h
mkdir -p build/
python3 </home/matthieu/esp/esp-idf/>/tools/kconfig_new/confgen.py \
--output header build/sdkconfig.h \
--config boards/sdkconfig \
--kconfig </home/matthieu/esp/esp-idf/>/Kconfig \
--env "IDF_TARGET=esp32" \
--env "IDF_CMAKE=n" \
--env "COMPONENT_KCONFIGS=" \
--env "COMPONENT_KCONFIGS_PROJBUILD="
/bin/sh: 1: cannot create /tools/kconfig_new/confgen.py: Directory nonexistent
Makefile:242: recipe for target 'build/sdkconfig.h' failed
make: *** [build/sdkconfig.h] Error 2
Re: double precision float on ESP8266
Yes, you have to follow the instructions step by step. Typical errors I use to make:
a) Wrong version checked out (this error is shown in your log):
In the esp-idf directory run the commands:
git checkout 6b3da6b1882f3b72e904cc90be67e9c4e3f369a9
git submodule update --init
b) Forgot git submodule init
In the esp-idf directory, issue the command:
git submodule update --init
c) ESPIDF not set
You have to set the environment variable ESPIDF to the path of the esp-idf directory. That canbe done permanent, or in the call to make. My preference is a GNUmakefile in the esp32 port directory. My example:
Depending on whether you device has SPIRAM, I use one of the two settings for SDKCONFIG.
a) Wrong version checked out (this error is shown in your log):
In the esp-idf directory run the commands:
git checkout 6b3da6b1882f3b72e904cc90be67e9c4e3f369a9
git submodule update --init
b) Forgot git submodule init
In the esp-idf directory, issue the command:
git submodule update --init
c) ESPIDF not set
You have to set the environment variable ESPIDF to the path of the esp-idf directory. That canbe done permanent, or in the call to make. My preference is a GNUmakefile in the esp32 port directory. My example:
Code: Select all
ESPIDF = $(HOME)/Downloads/esp-idf
# SDKCONFIG = boards/sdkconfig.spiram
SDKCONFIG = boards/sdkconfig
$(info SDKCONFIG = $(SDKCONFIG))
ESPTOOL=esptool.py
MPY_CROSS_FLAGS = -march=xtensa
include Makefile
Re: double precision float on ESP32
Hey,
so i restarted the building from beginning, following this :
http://www.microdev.it/wp/en/2018/08/08 ... for-esp32/
the build went on but stopped on an Error 1 :
any hint to fix it ?
so i restarted the building from beginning, following this :
http://www.microdev.it/wp/en/2018/08/08 ... for-esp32/
the build went on but stopped on an Error 1 :
Code: Select all
(...)
Traceback (most recent call last):
File "/home/matthieu/esp32/esp-idf/tools/ldgen/ldgen.py", line 22, in <module>
from fragments import FragmentFileModel
File "/home/matthieu/esp32/esp-idf/tools/ldgen/fragments.py", line 20, in <module>
from sdkconfig import SDKConfig
File "/home/matthieu/esp32/esp-idf/tools/ldgen/sdkconfig.py", line 18, in <module>
from pyparsing import Word, printables, Combine, Literal, hexnums, quotedString, Optional, nums, removeQuotes, oneOf, Group, infixNotation, opAssoc
ModuleNotFoundError: No module named 'pyparsing'
Makefile:805: recipe for target 'build/esp32.project.ld' failed
make: *** [build/esp32.project.ld] Error 1
Re: double precision float on ESP8266
See the ports/esp32 help page (README.md)
Try the following.
make PYTHON=python2
Try the following.
make PYTHON=python2
Re: double precision float on ESP32
it worked
and i'm with 64bit float
thanks a lot !
Matthieu
and i'm with 64bit float
Code: Select all
>>> 10/3
3.333333333333333
>>> 2*math.acos(0)
3.141592653589793
Matthieu