EZBL - ezbl_comm fix for Linux
It seems to me that ezbl_comm API from EZBL v2.11 is not ready to use in Linux. Firstly, it is not possible to build in Linux via gcc because some defined macros are missing in the header of MCP2221A API. Secondly, in I2C and UART Linux part the "Disable I/O buffering to make fread fwrite compatible" configuration is totaly missing in the code. It is important to set in Linux too, as it was set in Windows serial communication part.
Finally i fixed those things in ezbl_update.cpp and mcp2221_dll_um.h, so now i can build it and use it in Linux, feel free to use it. Pls Microchip use my fixes in your next EZBL versions! You can download the modification in the attachment.
Fix ezbl_comm for Linux:
Changes in ezbl_update.cpp to able to build and use in Linux:
- forced to use include i2c-dev.h
- i2c-0 acceptable in lower case, too. Only I2C-0 was acceptable before it but it was not a correct name for Linux I2C interface.
- "Disable I/O buffering to make fread fwrite compatible" was fixed in UART and I2C part for Linux.
- Removed B128000, B256000 UART baud rate, it is not supported in Linux kernel.
Changes in mcp2221_dll_um.h to able to build in Linux:
- WIN32 macro for MCP2221A API related function declarations
post edited by Benjamin_hu - 2020/02/28 14:45:19