-
• #2
If you check
BANGLEJS2.py
there is a line forDEFINES += -DSPIFLASH_SLEEP_CMD
- and that might help you out here? -
• #3
Thanks, Gordon. I rebuilt with that, and erased the flash (.eraseAll()) and it seems to work better, but it still seems to choke on larger files (5k or so). A file that works when sent to RAM will throw an error like:
Uncaught ReferenceError: "retur" is not defined at line 1 col 1036 ... ^ in function "connect" called from line 1 col 410 ... ^ in function "GC9A01" called from line 1 col 29 GC9A01(D25, D3, D2, D18, D26); ^ >
as if the keyword "return" were incomplete; but as I said, it IS complete, and works when sent to RAM.
After this point, trying to list files shows an empty list; but if I "reset()", the file list is restored.It's like it goes to sleep and can't wake up at some point! Insomniac flash.
-
• #4
It's like it goes to sleep and can't wake up at some point! Insomniac flash.
Odd - maybe it's some other sleep command that's required to wake it. I guess it could be a different flash chip :(
-
• #5
he CLK and SI lines are shared with the LCD (also SPI) and the accelerometer (I2C). However, I have not initialized either of those.
Maybe you could initialize it. For display at least making CS pin high may help to make sure it is not picking up the data. However the i2c device may be more probable to break stuff if SDA is shared with MISO or MOSI and clock is shared between spi and i2c too. I guess i2c device could pick up some data as i2c transfer and try to respond over SDA(?) messing up data bits randomly. just a guess.
Hey all, I've put Espruino on a smartwatch (SN80-Y from Yfit) and have figured out most of the pins and components (lcd, accel, touch) but am having trouble getting the XTX XT25F32B (4MB flash) chip to be reliable. Verified the following pins using multimeter: CS=D19, SO=D18, SI=D17, CLK=D20. Doing a wakeup, followed by getting vendor ID and capacity seems fine:
That seems fine:22 at the end should mean 2^22 bits, or 4MB. So i've included it in my board file. In the devices section I have:
And when flashed I see:
I then use this test script just to read the first few blocks of 256 bytes:
The timeout was added because I was running into issues without it. This seems to work if I save it to RAM, as I get data (remnants from previous attempts to write):
In the first line you can see the ASCII for "TEST" which was the name of the file I attempted to write in the IDE.
So the problem is when I try to save the test code to Storage (or Flash):
The other notable thing is that the CLK and SI lines are shared with the LCD (also SPI) and the accelerometer (I2C). However, I have not initialized either of those. In other tests, LCD works fine as does the accel, but I'm trying to leave out any issues with line sharing.
Any pointers greatly appreciated!