Using Espressif standard SD CARD example program, modified to write "Hello\n” 10 million times, and then read it back 10 million times... Here is what I get with OVMS v3 developer-release hardware using release version of ESP IDF v2.1: I (50) boot: ESP-IDF v2.1.1-8-g5ae2c0d0 2nd stage bootloader I (51) boot: compile time 08:28:36 I (83) boot: Enabling RNG early entropy source... I (84) boot: SPI Speed : 40MHz I (84) boot: SPI Mode : DIO I (94) boot: SPI Flash Size : 16MB … I (910) cpu_start: Pro cpu start user code I (967) cpu_start: Starting scheduler on PRO CPU. I (972) example: Initializing SD card I (972) cpu_start: Starting scheduler on APP CPU. E (1112) sdmmc_cmd: sdmmc_card_init: send_scr returned 0x107 E (1112) example: Failed to initialize the card (263). Make sure SD card lines have pull-up resistors in place. Using latest (bleeding edge, not released) ESP IDF v3.1, using 1 line mode: I (31) boot: ESP-IDF v3.1-dev-168-ga1b59679 2nd stage bootloader I (31) boot: compile time 08:35:38 I (42) boot: Enabling RNG early entropy source... I (42) boot: SPI Speed : 40MHz I (42) boot: SPI Mode : DIO I (45) boot: SPI Flash Size : 16MB … I (195) cpu_start: Pro cpu up. I (199) cpu_start: Starting app cpu, entry point is 0x40080e38 I (0) cpu_start: App cpu up. I (209) heap_init: Initializing. RAM available for dynamic allocation: I (216) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (222) heap_init: At 3FFB2A48 len 0002D5B8 (181 KiB): DRAM I (228) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM I (235) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (241) heap_init: At 40089270 len 00016D90 (91 KiB): IRAM I (247) cpu_start: Pro cpu start user code I (265) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (267) example: Initializing SD card I (267) example: Using SDMMC peripheral Name: SB16G Type: SDHC/SDXC Speed: default speed Size: 15193MB CSD: ver=1, sector_size=512, capacity=31116288 read_bl_len=9 SCR: sd_spec=2, bus_width=5 I (347) example: Opening file I (347) example: write count = 0 ... I (25397) example: write count = 1000000 ... I (50417) example: write count = 2000000 ... I (75737) example: write count = 3000000 ... I (101277) example: write count = 4000000 ... I (127417) example: write count = 5000000 ... I (154087) example: write count = 6000000 ... I (180247) example: write count = 7000000 ... I (206977) example: write count = 8000000 ... I (232807) example: write count = 9000000 ... I (259647) example: File written I (259647) example: Renaming file I (259657) example: Reading file I (259657) example: read count = 0 ... I (278507) example: read count = 1000000 ... I (297367) example: read count = 2000000 ... I (316427) example: read count = 3000000 ... I (335347) example: read count = 4000000 ... I (354327) example: read count = 5000000 ... I (373157) example: read count = 6000000 ... I (391637) example: read count = 7000000 ... I (410097) example: read count = 8000000 ... I (428517) example: read count = 9000000 ... I (446807) example: Read from file: 'Hello' I (446807) example: Card unmounted and using v3.1 with 4-line mode: I (247) cpu_start: Pro cpu start user code I (265) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (267) example: Initializing SD card I (267) example: Using SDMMC peripheral Name: SB16G Type: SDHC/SDXC Speed: default speed Size: 15193MB CSD: ver=1, sector_size=512, capacity=31116288 read_bl_len=9 SCR: sd_spec=2, bus_width=5 I (347) example: Opening file I (357) example: write count = 0 ... I (24187) example: write count = 1000000 ... I (47637) example: write count = 2000000 ... I (71277) example: write count = 3000000 ... I (94927) example: write count = 4000000 ... I (119567) example: write count = 5000000 ... I (143517) example: write count = 6000000 ... I (168297) example: write count = 7000000 ... I (192597) example: write count = 8000000 ... I (216847) example: write count = 9000000 ... I (240587) example: File written I (240727) example: Renaming file I (240727) example: Reading file I (240737) example: read count = 0 ... I (257697) example: read count = 1000000 ... I (274507) example: read count = 2000000 ... I (291327) example: read count = 3000000 ... I (308117) example: read count = 4000000 ... I (325157) example: read count = 5000000 ... I (341647) example: read count = 6000000 ... I (358397) example: read count = 7000000 ... I (375097) example: read count = 8000000 ... I (391787) example: read count = 9000000 ... I (408247) example: Read from file: 'Hello' I (408247) example: Card unmounted Smiling so much my face hurts... This has been such a PITA, but it looks like Espressif have finally solved it with their latest pre-release SDK. Very little performance difference between 1 line and 4 line modes (4 line is about 8% faster), so probably not worth using up those GPIO lines for that. I’m working with Espressif to see if this fix can be back-ported to v2.1. I doubt it, but no harm asking… This all, of course, brings into top priority the work Steve and I are doing trying to get OVMS v3 firmware working against ESP IDF v3.x. Here’s a hastily hacked together kludge based on bleeding edge ESP IDF v3.1: OVMS > metrics list m.version m.version 3.0.0/factory/main build (idf v3.1-dev-168-ga1b59679) Jan 8 2018 10:09:53 OVMS > sd mount Name: SB16G Type: SDHC/SDXC Speed: default speed Size: 15193MB CSD: ver=1, sector_size=512, capacity=31116288 read_bl_len=9 SCR: sd_spec=2, bus_width=5 Mounted SD CARD OVMS > vfs ls /sd .Spotlight-V100 .fseventsd component.mk sd_card_example_main.c FOO.TXT OVMS > vfs cp /sd/FOO.txt /sd/FOO2.txt VFS copy complete OVMS > vfs ls /sd .Spotlight-V100 .fseventsd component.mk sd_card_example_main.c FOO2.TXT FOO.TXT That FOO.TXT file is about 60MB in size. Now finalising hardware with the china manufacturer. I think at this point, it is worth: Use 1 line SD CARD (which frees up GPIOs SD_DATA1/SD_DATA2/SD_DATA3, but also avoids the conflict between GPIO12/SD_DATA2 and VDD_SDIO bootstrap pin). Add some capacitors for power line smoothing, as per Espressif’s example in their test board. Double-check power on SIMCOM module, to ensure it is as expected (following issues reported with low-amperage USB ports). Change to use Analog Lamb WROOM-32 module and their 16MB flash + 4MB ram. Change #4 should be the only controversial one. It has the advantages of much more RAM, and no need for external flash, but the disadvantage is that we would have to move GPIOs for simcom async (as those are using by Analog Lamb for their chip). It also depends on Analog Lamb’s lead time, and future plans for this module. Regards, Mark
Mark, Steve, that's really a great relief! I also doubt the fix will be backported. I tried applying the idf v3 commits involved in the fix you also commented on some weeks ago, but the issue wasn't solved. I got the impression it's not an isolated issue of the driver. We should go idf-3.x anyway. Regarding last hardware fixes, please don't forget… 5. Support active GPS antennas I hope we can use the Wroom module. Regards, Michael Am 08.01.2018 um 03:37 schrieb Mark Webb-Johnson:
Using Espressif standard SD CARD example program, modified to write "Hello\n” 10 million times, and then read it back 10 million times...
Here is what I get with OVMS v3 developer-release hardware using release version of ESP IDF v2.1:
I (50) boot: ESP-IDF v2.1.1-8-g5ae2c0d0 2nd stage bootloader I (51) boot: compile time 08:28:36 I (83) boot: Enabling RNG early entropy source... I (84) boot: SPI Speed : 40MHz I (84) boot: SPI Mode : DIO I (94) boot: SPI Flash Size : 16MB … I (910) cpu_start: Pro cpu start user code I (967) cpu_start: Starting scheduler on PRO CPU. I (972) example: Initializing SD card I (972) cpu_start: Starting scheduler on APP CPU. E (1112) sdmmc_cmd: sdmmc_card_init: send_scr returned 0x107 E (1112) example: Failed to initialize the card (263). Make sure SD card lines have pull-up resistors in place.
Using latest (bleeding edge, not released) ESP IDF v3.1, using 1 line mode:
I (31) boot: ESP-IDF v3.1-dev-168-ga1b59679 2nd stage bootloader I (31) boot: compile time 08:35:38 I (42) boot: Enabling RNG early entropy source... I (42) boot: SPI Speed : 40MHz I (42) boot: SPI Mode : DIO I (45) boot: SPI Flash Size : 16MB … I (195) cpu_start: Pro cpu up. I (199) cpu_start: Starting app cpu, entry point is 0x40080e38 I (0) cpu_start: App cpu up. I (209) heap_init: Initializing. RAM available for dynamic allocation: I (216) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (222) heap_init: At 3FFB2A48 len 0002D5B8 (181 KiB): DRAM I (228) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM I (235) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (241) heap_init: At 40089270 len 00016D90 (91 KiB): IRAM I (247) cpu_start: Pro cpu start user code I (265) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (267) example: Initializing SD card I (267) example: Using SDMMC peripheral Name: SB16G Type: SDHC/SDXC Speed: default speed Size: 15193MB CSD: ver=1, sector_size=512, capacity=31116288 read_bl_len=9 SCR: sd_spec=2, bus_width=5 I (347) example: Opening file I (347) example: write count = 0 ... I (25397) example: write count = 1000000 ... I (50417) example: write count = 2000000 ... I (75737) example: write count = 3000000 ... I (101277) example: write count = 4000000 ... I (127417) example: write count = 5000000 ... I (154087) example: write count = 6000000 ... I (180247) example: write count = 7000000 ... I (206977) example: write count = 8000000 ... I (232807) example: write count = 9000000 ... I (259647) example: File written I (259647) example: Renaming file I (259657) example: Reading file I (259657) example: read count = 0 ... I (278507) example: read count = 1000000 ... I (297367) example: read count = 2000000 ... I (316427) example: read count = 3000000 ... I (335347) example: read count = 4000000 ... I (354327) example: read count = 5000000 ... I (373157) example: read count = 6000000 ... I (391637) example: read count = 7000000 ... I (410097) example: read count = 8000000 ... I (428517) example: read count = 9000000 ... I (446807) example: Read from file: 'Hello' I (446807) example: Card unmounted
and using v3.1 with 4-line mode:
I (247) cpu_start: Pro cpu start user code I (265) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (267) example: Initializing SD card I (267) example: Using SDMMC peripheral Name: SB16G Type: SDHC/SDXC Speed: default speed Size: 15193MB CSD: ver=1, sector_size=512, capacity=31116288 read_bl_len=9 SCR: sd_spec=2, bus_width=5 I (347) example: Opening file I (357) example: write count = 0 ... I (24187) example: write count = 1000000 ... I (47637) example: write count = 2000000 ... I (71277) example: write count = 3000000 ... I (94927) example: write count = 4000000 ... I (119567) example: write count = 5000000 ... I (143517) example: write count = 6000000 ... I (168297) example: write count = 7000000 ... I (192597) example: write count = 8000000 ... I (216847) example: write count = 9000000 ... I (240587) example: File written I (240727) example: Renaming file I (240727) example: Reading file I (240737) example: read count = 0 ... I (257697) example: read count = 1000000 ... I (274507) example: read count = 2000000 ... I (291327) example: read count = 3000000 ... I (308117) example: read count = 4000000 ... I (325157) example: read count = 5000000 ... I (341647) example: read count = 6000000 ... I (358397) example: read count = 7000000 ... I (375097) example: read count = 8000000 ... I (391787) example: read count = 9000000 ... I (408247) example: Read from file: 'Hello' I (408247) example: Card unmounted
Smiling so much my face hurts... This has been such a PITA, but it looks like Espressif have finally solved it with their latest pre-release SDK.
Very little performance difference between 1 line and 4 line modes (4 line is about 8% faster), so probably not worth using up those GPIO lines for that.
I’m working with Espressif to see if this fix can be back-ported to v2.1. I doubt it, but no harm asking…
This all, of course, brings into top priority the work Steve and I are doing trying to get OVMS v3 firmware working against ESP IDF v3.x. Here’s a hastily hacked together kludge based on bleeding edge ESP IDF v3.1:
OVMS > metrics list m.version m.version 3.0.0/factory/main build (idf v3.1-dev-168-ga1b59679) Jan 8 2018 10:09:53
OVMS > sd mount Name: SB16G Type: SDHC/SDXC Speed: default speed Size: 15193MB CSD: ver=1, sector_size=512, capacity=31116288 read_bl_len=9 SCR: sd_spec=2, bus_width=5 Mounted SD CARD
OVMS > vfs ls /sd .Spotlight-V100 .fseventsd component.mk sd_card_example_main.c FOO.TXT
OVMS > vfs cp /sd/FOO.txt /sd/FOO2.txt VFS copy complete
OVMS > vfs ls /sd .Spotlight-V100 .fseventsd component.mk sd_card_example_main.c FOO2.TXT FOO.TXT
That FOO.TXT file is about 60MB in size.
Now finalising hardware with the china manufacturer. I think at this point, it is worth:
1. Use 1 line SD CARD (which frees up GPIOs SD_DATA1/SD_DATA2/SD_DATA3, but also avoids the conflict between GPIO12/SD_DATA2 and VDD_SDIO bootstrap pin). 2. Add some capacitors for power line smoothing, as per Espressif’s example in their test board. 3. Double-check power on SIMCOM module, to ensure it is as expected (following issues reported with low-amperage USB ports). 4. Change to use Analog Lamb WROOM-32 module and their 16MB flash + 4MB ram.
Change #4 should be the only controversial one. It has the advantages of much more RAM, and no need for external flash, but the disadvantage is that we would have to move GPIOs for simcom async (as those are using by Analog Lamb for their chip). It also depends on Analog Lamb’s lead time, and future plans for this module.
Regards, Mark
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
On Mon, 8 Jan 2018, Mark Webb-Johnson wrote:
Now finalising hardware with the china manufacturer. I think at this point, it is worth:
1. Use 1 line SD CARD (which frees up GPIOs SD_DATA1/SD_DATA2/SD_DATA3, but also avoids the conflict between GPIO12/SD_DATA2 and VDD_SDIO bootstrap pin).
I just go with the flow on this one.
2. Add some capacitors for power line smoothing, as per Espressif’s example in their test board.
Always a good idea.
3. Double-check power on SIMCOM module, to ensure it is as expected (following issues reported with low-amperage USB ports).
As I've been testing with release/v3.0 of esp-idf, I had to disable the brownout trap entirely. Even the lowest configured voltage would trap repeatedly. This is with a powered hub (SIIG brand, I think decent quality). Sometimes it seemed I could get by this by flashing again, but when it was happening it would repeat with every reset.
4. Change to use Analog Lamb WROOM-32 module and their 16MB flash + 4MB ram.
Would it be feasible to add our own SPIRAM chip to use with the WROOM module? -- Steve
4. Change to use Analog Lamb WROOM-32 module and their 16MB flash + 4MB ram.
Would it be feasible to add our own SPIRAM chip to use with the WROOM module?
Unfortunately, the only SPIRAM chips supported are the ESP-PSRAM32 and IS25WP032; those are1.8V devices, but the Espressif standard WROOM-32 module uses 3.3V flash. Can’t combine the two as they are on the same SPI bus. There is an Espressif WROVER module (the one with 4MB flash and 4MB SPIRAM) that is a 1.8V device. It has a slightly bigger footprint than the WROOM-32, but should still fit. We could change to that, and switch to use an external 1.8V 16MB flash - minimal changes to our design. I suspect it will come down to a choice between WROVER + external 1.8V flash (similar to our current design), and Analog Lamb WROOM-32 (16MB flash + 4MB SPIRAM) with no external flash. The Analog Lamb choice has a long lead time and is very pricey, but is a simpler drop-in replacement. I’m a little wary of Analog Lamb - unknown entity, the sample modules we bought came with old Rev0 ESP32 chips (not good), long lead times, unknown certification status, etc. That said, here is OVMS v3 running on an Analog Lamb WROOM-32 with 8MB flash and 4MB SPIRAM: I (30) boot: ESP-IDF v3.1-dev-168-ga1b59679 2nd stage bootloader I (31) boot: compile time 08:29:22 I (44) boot: Enabling RNG early entropy source... I (44) boot: SPI Speed : 40MHz I (44) boot: SPI Mode : DIO I (47) boot: SPI Flash Size : 8MB … I (489) spiram: SPI RAM mode: flash 40m sram 40m I (493) spiram: PSRAM initialized, cache is in low/high (2-core) mode. … I (1350) spiram: SPI SRAM memory test OK I (1350) heap_init: Initializing. RAM available for dynamic allocation: I (1350) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM I (1357) heap_init: At 3FFCC7F8 len 00013808 (78 KiB): DRAM I (1363) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM I (1369) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (1376) heap_init: At 4009B618 len 000049E8 (18 KiB): IRAM I (1382) cpu_start: Pro cpu start user code I (1387) spiram: Adding pool of 4096K of external SPI memory to heap allocator I (1395) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations … Welcome to the Open Vehicle Monitoring System (OVMS) - Async Console OVMS > metric list m. m.freeram 4276328 m.hardware OVMS WIFI BLE BT cores=2 rev=ESP32/0 There is an option to simply add the SPIRAM to the malloc pool, and to move as much of Wifi and LWIP to SPIRAM as possible. It would take some work to get it all going, but that extra 4MB gives us a huge amount of breathing room. Regards, Mark.
On 9 Jan 2018, at 12:57 AM, Stephen Casner <casner@acm.org> wrote:
On Mon, 8 Jan 2018, Mark Webb-Johnson wrote:
Now finalising hardware with the china manufacturer. I think at this point, it is worth:
1. Use 1 line SD CARD (which frees up GPIOs SD_DATA1/SD_DATA2/SD_DATA3, but also avoids the conflict between GPIO12/SD_DATA2 and VDD_SDIO bootstrap pin).
I just go with the flow on this one.
2. Add some capacitors for power line smoothing, as per Espressif’s example in their test board.
Always a good idea.
3. Double-check power on SIMCOM module, to ensure it is as expected (following issues reported with low-amperage USB ports).
As I've been testing with release/v3.0 of esp-idf, I had to disable the brownout trap entirely. Even the lowest configured voltage would trap repeatedly. This is with a powered hub (SIIG brand, I think decent quality). Sometimes it seemed I could get by this by flashing again, but when it was happening it would repeat with every reset.
4. Change to use Analog Lamb WROOM-32 module and their 16MB flash + 4MB ram.
Would it be feasible to add our own SPIRAM chip to use with the WROOM module?
-- Steve_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
participants (3)
-
Mark Webb-Johnson -
Michael Balzer -
Stephen Casner