Microchip-MPLAB-Harmony / core

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

Static variable lastUsedIndex is used simultaneously by any spi driver #27

Closed pustekuchen91 closed 1 year ago

pustekuchen91 commented 2 years ago

Hello @vishalnxt ,

with https://github.com/Microchip-MPLAB-Harmony/core/commit/ecafccc50664d1b84a6fbea8b3b9b5a8fbfb3823 you introduced a new bug to the SPI Driver.

lastUsedIndex (https://github.com/Microchip-MPLAB-Harmony/core/blob/master/driver/spi/src/async/drv_spi.c.ftl#L326) is a static variable and is not part of the DRV_SPI_OBJ. If two SPI Drivers willl be used with different sizes of DRV_SPI_QUEUE_SIZE_IDX* , the optimization will be broken. lastUsedIndex will be used simultaneously for any spi driver instance.

vishalnxt commented 2 years ago

@pustekuchen91 , Yes, thanks for pointing that out. I am raising a ticket to get it fixed.

vishalnxt commented 2 years ago

To fix the issue, unzip the drv_spi.zip and replace the drv_spi.c.ftl and drv_spi_local.h.ftl files in the core\driver\spi\src\async path

vishalnxt commented 1 year ago

@pustekuchen91 , were you able to resolve the issue with the latest core v3.11.1 release?

vishalnxt commented 1 year ago

@pustekuchen91 , closing the issue as it is resolved. Please feel free to reopen if you are still running into issue.