I just tried this:
EVE_cmd_flashattach();
flash_data[0] = EVE_memRead8(REG_FLASH_STATUS);
EVE_cmd_flashdetach();
flash_data[1] = EVE_memRead8(REG_FLASH_STATUS);
EVE_cmd_flashspidesel();
uint8_t tx_data[] = {0x90, 0, 0, 0, 0, 0};
EVE_cmd_flashspitx(4, tx_data);
EVE_cmd_flashspirx(0x00, 2);
EVE_cmd_flashspidesel();
EVE_cmd_flashdetach();
flash_data[2] = EVE_memRead8(0x00);
flash_data[3] = EVE_memRead8(0x01);
flash_data[4] = EVE_memRead8(0x02);
flash_data[5] = EVE_memRead8(0x03);
EVE_cmd_flashspidesel();
EVE_cmd_flashattach();
flash_data[6] = EVE_memRead8(0x00);
flash_data[7] = EVE_memRead8(0x01);
flash_data[8] = EVE_memRead8(0x02);
flash_data[9] = EVE_memRead8(0x03);
And printing this to the screen the output is:
0x02 0x01
0xef 0x15 0xff 0xff
0xef 0x15 0xff 0xff
I can not use Serial.println() since the controller-board I have currently attached
does not have serial output.
This is the same btw:
//EVE_cmd_flashattach();
flash_data[0] = EVE_memRead8(REG_FLASH_STATUS);
EVE_cmd_flashdetach();
flash_data[1] = EVE_memRead8(REG_FLASH_STATUS);
EVE_cmd_flashspidesel();
uint8_t tx_data[] = {0x90, 0, 0, 0, 0, 0};
EVE_cmd_flashspitx(4, tx_data);
EVE_cmd_flashspirx(0x00, 2);
EVE_cmd_flashspidesel();
//EVE_cmd_flashdetach();
flash_data[2] = EVE_memRead8(0x00);
flash_data[3] = EVE_memRead8(0x01);
flash_data[4] = EVE_memRead8(0x02);
flash_data[5] = EVE_memRead8(0x03);
//EVE_cmd_flashspidesel();
EVE_cmd_flashattach();
flash_data[6] = EVE_memRead8(0x00);
flash_data[7] = EVE_memRead8(0x01);
flash_data[8] = EVE_memRead8(0x02);
flash_data[9] = EVE_memRead8(0x03);
And a little condensed with only reading the two bytes that get transfered from flash to RAM_G once:
flash_data[0] = EVE_memRead8(REG_FLASH_STATUS);
EVE_cmd_flashdetach();
flash_data[1] = EVE_memRead8(REG_FLASH_STATUS);
EVE_cmd_flashspidesel();
uint8_t tx_data[] = {0x90, 0, 0, 0, 0, 0};
EVE_cmd_flashspitx(4, tx_data);
EVE_cmd_flashspirx(0x00, 2);
EVE_cmd_flashspidesel();
EVE_cmd_flashattach();
flash_data[2] = EVE_memRead8(0x00);
flash_data[3] = EVE_memRead8(0x01);
This still gives this output:
0x02 0x01
0xef 0x15
I also tried a power-cycle but it did not make a difference.
What flash chip do you have connected to your BT81x?
Is 0x90 really a valid command for it?