I'm doing nvmem_read on tiwi-sl rev2
res = nvmem_read(NVMEM_MAC_FILEID, 6, 0, buff);
(also tried NVMEM_WLAN_CONFIG_FILEID, NVMEM_WLAN_DRIVER_SP_FILEID)
which constantly gives res == 1 independent of the file type. The spi packet received in response to the HCI_CMND_NVMEM_READ is (hex)
02 00 00 00 05 04 01 02 01 01
which, I beleive, is a valid answer for HCI_CMND_NVMEM_READ (0x201) event (0x4) but with a status of 0x1 which prevents actual data read transaction (as follows from the nvmem_read source code)
The nvmem_read is called after tiwi-sl initialization:
wlan_init( CC3000_AsyncCallback, 0, 0, 0, ReadWlanInterruptPin, WlanInterruptEnable, WlanInterruptDisable, WifiEnable);
wlan_start(0);
// Mask out all non-required events from CC3000
wlan_set_event_mask(HCI_EVNT_WLAN_KEEPALIVE|HCI_EVNT_WLAN_UNSOL_INIT|HCI_EVNT_WLAN_UNSOL_DHCP|HCI_EVNT_WLAN_ASYNC_PING_REPORT);
res = nvmem_read(NVMEM_WLAN_CONFIG_FILEID, 6, 0, buff);
So, how do I actually read the eeprom?