I2C Communication Fails with DS3231 RTC Module

eriksl
Posts: 157
Joined: Fri May 22, 2015 6:22 pm

Re: I2C Communication Fails with DS3231 RTC Module

Postby eriksl » Sun Aug 27, 2017 11:31 pm

Hi Pradik,

It's a pity that you don't have access to non-public sources / documentation, because that is exactly what's missing at the moment. I am quite sure there are quite a few registers that nobody outside Espressif know they exist (and that are not related to the wireless phy). For example the memory addressing and caching ("poor man's MMU" ;-)) features are not documented at all, as far as I know. On the esp32 they are. We need it for e.g. open OTA implementation.

The other stuff, the source versions, I am under the assumption they're not really drop-in replacements for the precompiled binaries, I also don't recall having seen sources of the espconn functions, but I will check.

I once had a look at LWIP itself, but deemed it far too complex for the simple tasks we usually do on the esp8266, the espconn implementation is sufficient.

Thanks,
Erik.

eriksl
Posts: 157
Joined: Fri May 22, 2015 6:22 pm

Re: I2C Communication Fails with DS3231 RTC Module

Postby eriksl » Tue Aug 29, 2017 1:20 am

BTW I couldn't find the espconn sources in the NON-OS tree. Also I doubt whether the LWIP sources there are a drop-in replacement for the precompiled library.

User avatar
pratik
Posts: 467
Joined: Wed Jun 29, 2016 7:17 pm
Location: India
Contact:

Re: I2C Communication Fails with DS3231 RTC Module

Postby pratik » Tue Sep 05, 2017 8:44 pm

The LwIP sources are here:
https://github.com/espressif/ESP8266_NO ... hird_party

Also, the espconn APIs are just an interface over LwIP that simplify things. Using LwIP raw APIs can be a pain when low level code is closed source. That is no longer the case with ESP32 and that is why LwIP is used as is on the ESP32.
I have used modified LwIP sources for tasks like getting 12 mbps continuous transfer speed. The ESP8266 can do a lot if you have the patience.
Hopefully we will improve documentation soon.
Regards,
Pratik Panda
Website: http://www.PratikPanda.com

Custom firmware, Knowledge base and freelancing (ESP8266/ESP32):
http://www.iot-bits.com

eriksl
Posts: 157
Joined: Fri May 22, 2015 6:22 pm

Re: I2C Communication Fails with DS3231 RTC Module

Postby eriksl » Wed Sep 06, 2017 12:06 am

I think the LWIP interface is difficult to use anyway, anyhow, especially if all you need is a very few TCP and UDP sockets. But that may be caused by bad documentation just as well. In the LWIP documentation I never found a "proper" way where to "start".

FWIW my firwmare implements OTA upgrading using RBoot and my own mechanism to transfer the code either using TCP or UDP to the flash, where each uploaded block is checksummed with CRC32 and the whole file is checksummed using MD5 (code for which appears to be in the ESP8266 ROM :-)), and identical sectors are skipped. With all that, I can get a persistent performance of 520 kbps/s, which is quick enough for writing the flash without delay. I didn't try it in another context, because I don't have purpose for it. What's slowing it down, is that every packet received is parsed and broken down into space separated chunks, for command processing. If I where to skip that, I'd probably get a higher throughput, but as said, I don't really have a purpose for higher performance there.

User avatar
pratik
Posts: 467
Joined: Wed Jun 29, 2016 7:17 pm
Location: India
Contact:

Re: I2C Communication Fails with DS3231 RTC Module

Postby pratik » Wed Sep 06, 2017 10:08 pm

Put large loops in iRAM and use 80MHz QIO flash with 160 MHz core speed. That is the best you can do.
Also, you can test your LwIP skills on ESP-IDF. I'm frustrated with crashes. Proper LwIP documentation is non-existent. That could be a good personal task, making that documentation.
Regards,
Pratik Panda
Website: http://www.PratikPanda.com

Custom firmware, Knowledge base and freelancing (ESP8266/ESP32):
http://www.iot-bits.com

eriksl
Posts: 157
Joined: Fri May 22, 2015 6:22 pm

Re: I2C Communication Fails with DS3231 RTC Module

Postby eriksl » Wed Sep 06, 2017 10:31 pm

As said I don't really have a purpose for very fast tcp or udp connections. Even if I'd want to, I have very little iram left, because the Espressif libs take up most of it. I've only about 4k left, from which I use 2k for interrupt handlers and timing critical code. I2C benefits greatly from code in iram, the SCL signal becomes very stable, which in itself is not a requirement from I2C but may help on marginal devices.

Who is online

Users browsing this forum: No registered users and 17 guests