Code:
if (spi_read(&(board->llio), HM2_COOKIE_REG, &buf, sizeof(buf)) < 0) {
return;
}
if(memcmp(buf, cookie, sizeof(cookie))) {
fprintf(stderr, "Unexpected cookie at 0000..000c:\n%08x %08x %08x\n",
buf[0], buf[1], buf[2]);
return;
}
mesaflash is trying to read the cookie at the normal location (HM2_COOKIE_REG is 0x0100), just the message is incorrect about what location it tried to read. The expected value of the cookie is
Code:
u32 cookie[] = {0x55aacafe, 0x54534f48, 0x32544f4d};
It looks like two independent users of spidev are both reading all zeroes instead of the expected value (hm2_spi and mesaflash do not share any source code, though I think I wrote both sets of code), so I would look at the kernel driver or the wiring as the source of the problem.
There are
spidev test programs out there
and you can just loop the output back to the input to see whether the kernel driver and hardware are working properly. I'd do that before continuing with mesaflash or linuxcnc, just so you know the odroid's spi hardware and the kernel driver are working like you expect