-->
Page 1 of 1

NodeMcu LoLin 40 Mhz crystal

PostPosted: Wed Mar 28, 2018 5:56 pm
by ekt
I'm trying to understand if the fact that having a non conventional crystal frequency might be a problem with firmwares built via nodemcu-build.com and flashed with PyFlasher

my (limited) understanding is that there is register which has to be set to 0 for 40MHz, or 1 for 26MHz crystals.

the esp8266 library in the arduino ide has a settings (core_esp8266_phy.c, phy_init_data[48])
the espressif flash download tool has a setting too (and a way to auto detect it also)
but I could not find an equivalent option in the cloud build, nor a setting in PyFlasher or esptool.py

Re: NodeMcu LoLin 40 Mhz crystal

PostPosted: Thu Mar 29, 2018 3:22 pm
by ekt
answering myself in hope it helps someone else
as far as I can tell, either PyFlasher or esptool.py does not support setting the crystal frequency. they all assume it has been correctly set in the firmware. the cloud build nodemcu-build.com does not have a way to specify it.

so, the best I came up was the following script (I'm on windows)

Code: Select allesptool.py --port com9 erase_flash
esptool.py --port com9 write_flash -fm dio 0x00000 nodemcu-firmware-20180328.bin
del rfblock.bin
esptool.py --port com9 read_flash 0x3FC000 128 rfblock.bin
set-byte.py rfblock.bin 0x30 0
esptool.py --port com9 write_flash 0x3FC000 rfblock.bin