spif icon indicating copy to clipboard operation
spif copied to clipboard

SPIF_WritePage corrupting source buffer

Open wolfgangbregel opened this issue 1 year ago • 6 comments

Hi all,

I experience that SPIF_WritePage function corrupts the source buffer (other write operations will do so aswell). This is due to the fact that SPIF_WriteFn calls SPIF_TransmitReceive() which in turn sets its rx and tx buffer to source buffer, and by this corrupts the source buffer. Wouldn't it be better to call a transmit only function here?

Best regards.

Wolf

wolfgangbregel avatar Dec 24 '23 14:12 wolfgangbregel

Hello. Thanks for your response. I had not this problem. But if you are sure about that, i will use transmit insted of transmitreceive.

nimaltd avatar Dec 24 '23 14:12 nimaltd

Hello,

I'm sure about this, as I tested it on real hardware (Blackpill STM32F411CE + 64Mbit Flash 25Q64JVS). BTW the same applies to the read functions, where a receive only function would be the better choise.

I'll do some more testing and stress tests and will report if issues arrive.

Thanks for your work and the seemless integration into the STMCube ecosystem.

Best regards, Wolf

wolfgangbregel avatar Dec 24 '23 14:12 wolfgangbregel

your welcome, I have updated the package. please try again.

nimaltd avatar Dec 24 '23 15:12 nimaltd

That was fast!

I updated to the new version. It works as expected, the source buffer stays untouched! The SPIF_Receive function is updated too - good job. I'll do some more in depth testing an will report. One more thing to consider for fututre releases:

Im tinkering with Azure RTOS. You might add a selection in the conf file togehther with CMSIS V1/V1 in order to use the RTOS sleep function.

Regards,

Wolf

wolfgangbregel avatar Dec 24 '23 17:12 wolfgangbregel

Thanks. I am waiting for your response after test. ;)

nimaltd avatar Dec 24 '23 18:12 nimaltd

I have updated the LIB. please try again for any devices you have.

nimaltd avatar Mar 28 '24 09:03 nimaltd