Esp8266 SD card write/read crashing #6348
Replies: 1 comment
-
Posted at 2020-01-16 by @allObjects It could be that the read/write file does time wise not fit into the window the ESP8266's wifi stack provides for other code to run before it has to answer its next own interrupt. An ESP8266 has just not much cycles left to do other (demanding) things. To stay (far or absolutely) away from this issue, go for a two processor setup: an Espruino board and just for wifi pair it with any ESP8266... that lets you skip a lot of issues and saves you tons of time... way beyond the money you spend. Reliable (1 'wire', and radio/RF IS one wire) communication requires dedicated resources, because it is all time sensitive serialized... Posted at 2020-01-16 by @MaBecker Choose the correct spi pins for ESP8266 http://www.espruino.com/EspruinoESP8266#spi-implementation Posted at 2020-01-17 by markopraakli Do you think that software SPI does not work as expected? Posted at 2020-01-17 by @allObjects Could you pls share the complete code? How do you get your code onto the board? Posted at 2020-01-17 by markopraakli Thats all my code, what else you need. I can upload here to my binaries. https://www.upload.ee/download/10990396/d43c5ce2825416a80736/espruino_2v04_esp8266_4mb.tgz Posted at 2020-01-17 by @allObjects @markopraakli sorry, was obviously not clear in my post - my bad: With complete code I was looking just for the JavaScript source and the description of the process how you uploaded it to the board. (I was not expecting the firmware / bin that you custom-build and flashed onto the board). Posted at 2020-01-17 by markopraakli I was using Espruino IDE as expected :) And it does matter if I execute code into flash or ram, crashes both ways. I suspect something else in deeper, but I 'm not able to debug it :( Posted at 2020-01-17 by @allObjects Did you put your code into an the Posted at 2020-01-17 by markopraakli I've already tried it, many different ways. Still crashing each time. Perhaps someone can try my binaries :) ? Posted at 2020-01-17 by @MaBecker If hadware SPI does not work than try software SPI and start like this and change the pins as needed.
Posted at 2020-01-17 by markopraakli Well well well... now this is strange. I'm able to list content of SD card, but still unable to read or write. I formatted SD card to FAT32 and wrote a empty file test.txt and then executed same example. Also I tried to use SoftwareSPI, different pins ... but still same behavior .
What I'm doing wrong :( Posted at 2020-01-17 by @MaBecker Just tried once to use fs but figured out in needs too much memory. so maybe you are running out of memory. you can remove Graphic from you build use process.memory() and check the difference ESP8266 for this commands
Is there a reason why you use cmd and not the WebIDE? Posted at 2020-01-18 by markopraakli I'm using WebIDE, there is possible to use "console" also :) But, still no luck. I recompiled without Graphics and still same behavior. Using this following test code:
And here is a result:
And xtensa doc says that error "Fatal exception 3(LoadStoreErrorCause)" is described as "Processor internal physical address or data error during load or store [Exception Option]". http://0x04.net/~mwk/doc/xtensa.pdf Posted at 2020-01-18 by @MaBecker Yes I see..... Now we get into very deep water's ...... some code is not aligned well for the ESP8266. To be honest for device with low vars and small heap a 4k oriented filesystem is a killer, as you painful figure out by yourself. Is using the internal memory mapped storage an alternative for you to use? Storage space is 48 x 4096 byte = 196.608 byte I use it to store code, modules, configs, web pages and images. What do you think? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-01-16 by markopraakli
Hello
I've compiled my own v204 version of Espruino, using following params:
And code in Espruino:
And constantly it crashes after "reading" or "writing" a file.
Any ideas why it crashes?
Beta Was this translation helpful? Give feedback.
All reactions