New Lolin D32 Pro with 4MB PSRAM

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

Re: New Lolin D32 Pro with 4MB PSRAM

Post by patvdleer » Fri Sep 14, 2018 12:29 pm

without the issue of the 1uF capacitor?
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: New Lolin D32 Pro with 4MB PSRAM

Post by Roberthh » Sat Sep 15, 2018 6:52 am

That#s hard to tell without knowing the exact reason @mike teachman had. The obvious observation is, that in his set-up the timing of reset and GPIO0 do not match. GPIO0 low is too late with respect to the end of the reset pulse. But the reasons could be:

- GPIO0 is scanned too early (-> Lolin)
- the USB/UART bridge or the transistor circuit switche too slow (->Lolin)
- the controlling PC send the switch command too late (->PC)

Assuming that Wemos is testing their devices, I tend to the third explanation. But without testing it#s hard to tell.

User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

Re: New Lolin D32 Pro with 4MB PSRAM

Post by patvdleer » Sun Sep 16, 2018 8:08 am

So I bought them... somehow I have a feeling that was going to happen either way :P

I'm currently running into compile errors (viewtopic.php?f=18&t=5262) so I can't really test anything myself.

Is there a guide I can follow to setup Lolin with SD card support? I have only used MicroPython on boards without build-in SD card readers.
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: New Lolin D32 Pro with 4MB PSRAM

Post by Roberthh » Sun Sep 16, 2018 9:31 am

I just have tried and succeeded to use the built-in SD card on my Wemos LoLin32 Pro. It uses the sdcard.py script from the drivers/sdcard section and the following statements for mounting.

Code: Select all

import machine, sdcard, os
sd = sdcard.SDCard(machine.SPI(1, sck=machine.Pin(14), mosi=machine.Pin(15),
                   miso=machine.Pin(2)), machine.Pin(13))
os.mount(sd, "/sd")
For the new Lolin D32 pro, the Pins for the SPI interface have to be adapted into:

Code: Select all

import machine, sdcard, os
sd = sdcard.SDCard(machine.SPI(1, sck=machine.Pin(18), mosi=machine.Pin(23),
                   miso=machine.Pin(19)), machine.Pin(4))
os.mount(sd, "/sd")
You can also use the software SPI. In that case, the SPI device number is -1

User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

Re: New Lolin D32 Pro with 4MB PSRAM

Post by patvdleer » Sun Sep 16, 2018 10:02 am

I bought 2 of them, somehow I'm unable to flash them...

Code: Select all

root@patrick-X470-AORUS-ULTRA-GAMING:/home/patrick/Downloads# esptool.py --chip esp32 -p /dev/ttyUSB0 erase_flash
esptool.py v2.5.0
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Invalid head of packet (0x08)
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

Re: New Lolin D32 Pro with 4MB PSRAM

Post by patvdleer » Sun Sep 16, 2018 10:14 am

Playing with the reset button while attempting to flash fixed it...
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: New Lolin D32 Pro with 4MB PSRAM

Post by Roberthh » Sun Sep 16, 2018 10:35 am

That is the reset problem mentioned above. You can also tie GPIO0 to GND, then push reset and then start the upload. That is reproducibly.

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: New Lolin D32 Pro with 4MB PSRAM

Post by OutoftheBOTS_ » Sun Sep 16, 2018 8:28 pm

Well this probably indicates there is a hardware problem with the auto boot select on this board.

This is surprising as I have built over 20 boards using the Wrover module and a CP2014 USB serial convert and just a standard MMBT2222A transistor and 10k pullups on the RTS and DTR lines and every time the auto boot select worked perfectly.

ARTaylor
Posts: 29
Joined: Fri Mar 23, 2018 4:04 pm
Contact:

Re: New Lolin D32 Pro with 4MB PSRAM

Post by ARTaylor » Thu Sep 20, 2018 10:53 pm

Roberthh wrote:
Sun Sep 16, 2018 9:31 am
I just have tried and succeeded to use the built-in SD card on my Wemos LoLin32 Pro. It uses the sdcard.py script from the drivers/sdcard section and the following statements for mounting.

Code: Select all

import machine, sdcard, os
sd = sdcard.SDCard(machine.SPI(1, sck=machine.Pin(14), mosi=machine.Pin(15),
                   miso=machine.Pin(2)), machine.Pin(13))
os.mount(sd, "/sd")
For the new Lolin D32 pro, the Pins for the SPI interface have to be adapted into:

Code: Select all

import machine, sdcard, os
sd = sdcard.SDCard(machine.SPI(1, sck=machine.Pin(18), mosi=machine.Pin(23),
                   miso=machine.Pin(19)), machine.Pin(4))
os.mount(sd, "/sd")
You can also use the software SPI. In that case, the SPI device number is -1
I came here to ask about exactly this on the D32 Pro - if I enter your code from the REPL without a micro SD card, I get an error back that says "No SD Card" - as expected. If I insert the SD card however I get a new error that says "SPI Busy" - any idea why this might be? SD is formatted to FAT32. - Am I missing something?

Using software SPI seems to work ok, I can browse the files on the sd card with os.listdir()
Grow something!

ARTaylor
Posts: 29
Joined: Fri Mar 23, 2018 4:04 pm
Contact:

Re: New Lolin D32 Pro with 4MB PSRAM

Post by ARTaylor » Fri Sep 21, 2018 7:45 pm

Is it because opening a serial port uses SPI?
Grow something!

Post Reply