Microchip-MPLAB-Harmony / core

Harmony 3 Core
https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MH3_core&redirect=true
Other
15 stars 12 forks source link

SST26 Documentation Error #16

Closed wesley5040 closed 4 years ago

wesley5040 commented 4 years ago

The DRV_SST26_Read function documentation specifies that it is a blocking command, but I had issues with the data not being in the buffer, but once I treated it as non-blocking it worked as expected.

Example:

// Not working
DRV_SST26_Read(handle, buffer, len, addr);
// Accessing the data here results in getting incorrect data

// Working
DRV_SST26_Read(handle, buffer, len, addr);
for (; DRV_SST26_TransferStatusGet(handle) == DRV_SST26_TRANSFER_BUSY;);
// Accessing the data here works as expected

Tested on a PIC32MZ2064DAR169 with SST26VF064BT, with core v3.6.1.

amitraddi commented 4 years ago

@wesley5040 Thanks for reporting the issue. This API is common for both QSPI peripheral library and SQI peripheral library.

When using QSPI peripheral library on SAM devices the behavior is blocking. When using SQI peripheral library on PIC32M devices it's non blocking as it uses internal DMA. The working code you mentioned is correct way of using for PIC32 devices.

The documentation will be fixed in next release.

wesley5040 commented 4 years ago

Thanks.