turgu1 / EPub-InkPlate

An EPub Reader for the ESP32 based InkPlate e-Ink devices.
224 stars 7 forks source link

Soldered Inkplate 6 PLUS boot loop #18

Open gigawatts opened 1 year ago

gigawatts commented 1 year ago

I can't get either the 2.0.0 or 2.0.1 release for the Inkplate 6 Plus to start. This is using the "Soldered" variant of the device (https://soldered.com/product/soldered-inkplate-6plus-with-enclosure-e-paper-display-with-touchscreen-copy/), I am not sure if that makes a difference.

Here is the boot sequence I get, followed by a reboot, over and over, with or without an SD card inserted.

I (721) psram: This chip is ESP32-D0WD
I (722) spiram: Found 64MBit SPI RAM device
I (723) spiram: SPI RAM mode: flash 40m sram 40m
I (724) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (731) cpu_start: Pro cpu up.
I (735) cpu_start: Starting app cpu, entry point is 0x40083c64
I (0) cpu_start: App cpu up.
I (1626) spiram: SPI SRAM memory test OK
I (1635) cpu_start: Pro cpu start user code
I (1635) cpu_start: cpu freq: 240000000
I (1636) cpu_start: Application information:
I (1638) cpu_start: Project name:     EPub-InkPlate
I (1644) cpu_start: App version:      2.0.1
I (1649) cpu_start: Compile time:     May  1 2022 18:56:00
I (1655) cpu_start: ELF file SHA256:  1f56aaecd8043574...
I (1661) cpu_start: ESP-IDF:          4.3.2
I (1666) heap_init: Initializing. RAM available for dynamic allocation:
I (1673) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (1679) heap_init: At 3FFC13C0 len 0001EC40 (123 KiB): DRAM
I (1686) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1692) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1699) heap_init: At 4009FDD0 len 00000230 (0 KiB): IRAM
I (1705) spiram: Adding pool of 4084K of external SPI memory to heap allocator
I (1714) spi_flash: detected chip: generic
I (1718) spi_flash: flash io: dio
I (1729) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (1732) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
This is esp32 chip with 2 CPU core(s), WiFi/BT/BLE, silicon revision 3, 4MB external flash
Minimum free heap size: 4373811 bytes
Heap summary for capabilities 0x00000C06:
  Totals:
    free 0 allocated 0 min_free 0 largest_free_block 0
I (1762) main: EPub-Inkplate Startup.
I (1782) MCP23017: MCP at address 0x20 has been detected
I (1792) MCP23017: MCP at address 0x22 has NOT been detected
E (1792) MCP23017: The MCP at address 0x22 has not been detected.
E (1792) MCP23017: The MCP at address 0x22 has not been detected.
I (1932) gpio: GPIO[36]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 1| Intr:2 
E (3982) Wire: Unable to complete request_from: ESP_ERR_TIMEOUT.
E (3982) main: InkPlate6Ctrl Error.
E (3982) main: Config Error.
E (3982) Fonts: Unable to read fonts definition file fonts_list.xml.
E (3992) main: Font loading error.
E (3992) Fonts: Fonts.get(): Wrong index: 0 vs size: 0

abort() was called at PC 0x401ec55a on core 0

Backtrace:0x400838de:0x3ffdd9b0 0x4009255d:0x3ffdd9d0 0x4009a32a:0x3ffdd9f0 0x401ec55a:0x3ffdda60 0x401ec587:0x3ffdda80 0x401e9ddf:0x3ffddaa0 0x401d58bb:0x3ffddac0 0x400f8157:0x3ffddd60 00

ELF file SHA256: 1f56aaecd8043574

Rebooting...

I have tested that the SD card can be read from, with the MicroPython firmware and this example: https://github.com/SolderedElectronics/Inkplate-micropython/blob/master/Examples/Soldered_Inkplate6PLUS/exampleSd.py

gigawatts commented 1 year ago

I asked the Soldered Electronics Inkplate support folks about the hardware differences, here is their reply:

yes, there is a difference in the hardware and pin connections. See this link for some useful info - the main difference is the GPIO expanders: https://inkplate.readthedocs.io/en/latest/arduino.html?highlight=mcp#io-expander-functions

There would have to be some modifications in the code for it to run on 'Soldered' variants of the product. They have to do with the GPIO expander and how the driver communicates with the ePaper via the GPIO expander - this is also one of the reasons used a different board definition.

I just had a look at that repository expecting our official version of the Inkplate library to be included somewhere (searched for #include "inkplate.h") but I can't seem to find that, so this user wrote their own driver for the ePaper and just used our hardware. So, it seems to me you're gonna have to see with them is this a feature which they can implement.

I have done this adaptation from MCP to PCAL for a few boards in Arduino within our native drivers and in micropython and didn't have too many problems. My best advice would be to find any place where the GPIO expander is used to drive the screen and change the functions accordingly. Also, check the schematics for Soldered Inkplate 6PLUS in the hardware repository: https://github.com/SolderedElectronics/Soldered-Inkplate-6PLUS-hardware-design You can also use our arduino driver as a reference.

I may take a crack at porting this, but figured I would post their reply here, as you can likely adapt the changes much more efficiently than I can.

Edit: I see now after looking a bit closer that you use the ESP-IDF framework, and that their docs point to your Inkplate ESP-IDF library, but it looks like your library does not yet support the Soldered Electronics variant of Inkplates using the PCAL GPIO expander. Is that something that can be added to your library? I'll open up an Issue/Request over on that repo.

gigawatts commented 3 months ago

@turgu1 I'm attempting to port support for this PCAL GPIO expander in myself, but I can't find a combination of versions between any ESP-IDF-InkPlate library branches/versions, this repo's branches, and platformio/framework-espidf versions that compiles as is without a massive list of errors.

What combinations are supposed to work as is?

turgu1 commented 3 months ago

Hello, sorry for the delay to look at this issue as I’m very busy under contract.

I will look at your issue in the next days. I may generate a new version of the code, replacing de MCP with the PCAL. This is for the Inkplate 6Plus?

turgu1 commented 3 months ago

As I don’t have rhe hardware, you may have to be my tester!

gigawatts commented 3 months ago

Yeah, 6 Plus, from Soldered. Happy to test anything!

I bought my Inkplate specifically to use with your firmware, then was disappointed when I learned their hardware had changed and it was no longer compatible. I'm pretty comfortable with the Arduino framework, but have not worked with the Esp-Idf before.

gigawatts commented 3 months ago

@turgu1 any progress and anything I can help test?

turgu1 commented 3 months ago

Hello! Not yet I'm afraid. I'm porting it to the last version of the ESP-IDF and got some issues. Hope to have something soon. You will be the first to ear about it.

swlxe commented 2 months ago

@gigawatts @turgu1 Has there been any update on this issue? I'm having the same issue and also bought this device just for this use case...

turgu1 commented 2 months ago

Hello, I’m still working under contract so the time I can take on this is very limited. As I didn’t touch this software for the last 2 years is also requesting more time to regain the insights of how things were done.

I found my issue with the last esp-idf release. I have a portion of the new PCAL driver completed (30%). Some changes in the use of the i/o port request some other changes to the code (enabling the SD card at boot time) and maybe other things as I need to check the changes between 6PLUS v1 and v2 schematics. Hope to complete a first cut in the next 2 or 3 weeks.

gigawatts commented 2 months ago

Sounds good, my offer still stands on any beta testing you need performed on hardware!

swlxe commented 2 months ago

I'm also willing to beta test if you need another! I look forward to any progress.

turgu1 commented 1 month ago

I'm almost there. In both ESP-IDF-INKPLATE and EPUB-INKPLATE projects you will find a branch named 6plusv2-integration that contain the current updates done, required to support the PCAL6416 and the creation of the Inkplate 6Plusv2 app.

THIS IS NOT READY YET! Still remains some adjustments to the code on both side. Can't work on it for the next 2-3 days, but we are close to be able to compile and do some testing.

Before integrating these branches to the main one, I will have to test with the other MCP23017-based devices as the changes may have an impact on their stability.

So stay tuned!

gigawatts commented 1 month ago

Awesome! Looking forward to testing!

swlxe commented 1 month ago

Great, I look forward to more updates and also hopefully some testing.

turgu1 commented 1 month ago

Some news: modifications completed at 99%, will update github tonight. Here are the issues I still have to resolve:

gigawatts commented 1 month ago

Thank you for the update! Is there anywhere I can kick you a donation / buy you a coffee for an awesome project and keeping it maintained?

turgu1 commented 1 month ago

Thanks for the offer. I never asked any money for this project and all other projects available in my account on GitHub. This is my way of returning to the developers’ community for everything that is made freely available on the net, that I was able to access for the last 40 years.

turgu1 commented 1 month ago

Some other news:

gigawatts commented 1 month ago

As always, thanks for the update!

Interesting, is the Flick the replacement for the battery powered 6 Plus? They seem to have similar specifications.

turgu1 commented 1 month ago

I don't know enough about the Flick yet. I understand that it is very close to the 6PLUS V2. It uses a different touch layer on top of the display and used the PCAL chip instead of the MCP as per the V2. I've seen some added filtration capacitors in the schematic. Still a lot of analysis to do...

BTW the PCAL driver is able to be compiled now. Remains to do a double check comparing my code with the Solderer's Arduino library.

turgu1 commented 3 weeks ago

Some news…

swlxe commented 6 days ago

Any updates?