Skip to main content
9 events
when toggle format what by license comment
Jan 18, 2021 at 14:36 vote accept Thanatheos
Jan 18, 2021 at 14:36 answer added Thanatheos timeline score: 3
Dec 29, 2020 at 7:05 comment added Thanatheos Thank you for your help. The volatile don't help. Still the same issue. I tried to force the SPI to use the slave 4 (SD) and not the 9 (CANbus) digitalWrite(4,LOW); digitalWrite(9,HIGH); if (!SD.begin(4)) { print error } print success myFile = SD.open("can.txt", FILE_WRITE); and put ss 9 to low right after that. It show a success It read as usual but still nothing on the SD. Look like the spi is saturated by the mcp2515. If I remove the sd card, I got an error.
Dec 28, 2020 at 21:43 comment added timemage I did more digging, but I'm not turning up anything clear. In their example flagRecv should be volatile qualified, as volatile unsigned char flagRecv = 0; But I have little confidence that this is actually the problem. I kind of expect that as a bug it would manifest differently if at all in this usage. It should be fixed though in any case. If it actually solves it though, let me know and I'll stick it as an answer.
Dec 28, 2020 at 16:51 comment added timemage That is more or less what I think, but I didn't find anything confirming that when I went looking through the code of the two libraries. At some point I may try setting up an UNO with an SD card and some SPI device as a stand-in for your MCP2515 (I don't have one of these). Though, by then someone else may already have answered.
Dec 28, 2020 at 6:04 history edited Thanatheos CC BY-SA 4.0
added 83 characters in body
Dec 28, 2020 at 6:01 comment added Thanatheos I got the same "bad idea" but even with the close() (and withouthe the if(myFile)) The SD card don't write anything. If I process to write before using MCP2515, it works fine. It look like a problem with the ISP to determinate the slave to talk to. My board is a seeeduino V4.0
Dec 27, 2020 at 13:11 comment added timemage I don't have any good ideas, so here's one bad idea: print something showing that it made it to myFile.close(); You may not have any writes until you close(), flush(), or fill a sector. Given what you've shown and what I've read about the shield etc, it seems like this shoudn't be a problem though. Which Arduino are you using? You did not change the CS selection on the board right?
Dec 23, 2020 at 14:23 history asked Thanatheos CC BY-SA 4.0