stm32f7xx_hal_driver
stm32f7xx_hal_driver copied to clipboard
[HAL][NOR] Fix support for 8-bit NOR that uses the AMD command set. C…
…hanges should be backwards compatible.
In reference to this issue, #14
TThe previous version of the HAL_NOR did not accurately handle 16-bit and 8-bit NOR devices. There were many instances of typecasting to a 16-bit pointer which, when used with 8-bit addressing, results in Misalligned Memory Access faults.
Additionally, the NOR_ADDR_SHIFT already handles the address shifting; There does not need to be 2 different address values for 8-bit vs 16-bit.
I also turned the NOR_WRITE into a wrapper for a function pointer; This ensures backwards compatibility, while ensuring the correct NOR_WRITE is used in all circumstances.
Do note: I was unable to find any Coding Standard for contributing, so i attempted to follow existing code.
Additionally, there are still potential issues in HAL_NOR that I could not adequately address without rewriting; HAL_NOR_ReadCFI, anything in the NOR_INTEL_SHARP_EXT_COMMAND_SET.
Finally, I am not overly happy with exposing the extern WriteNORFunc NORWriteFunction; /* Function Pointer to active NOR_Write*/. I'd much rather have that function pointer be private to the HAL_NOR .c file. But to support backwards compatibility with projects that use NOR_WRITE, it has to be exposed.
IMPORTANT INFORMATION
Contributor License Agreement (CLA)
- The Pull Request feature will be considered by STMicroelectronics after the signature of a Contributor License Agreement (CLA) by the submitter.
- If you did not sign such agreement, please follow the steps mentioned in the CONTRIBUTING.md file.