[SOLVED FOR NOW] HAL I2C and HAL SPI not initialising correctly when using a custom static library that houses HAL Library
Hi,
I have multiple projects that use the same code but use different processors (STM32F4xx). To try and solve the common code problem I have created a static library, this has the HAL driver code inside and the main applications for each processor link to this library.
Now for some reason I2C and SPI do not initialise correctly. For example I2C, it will get into the HAL_I2C_Init function, but when it tries to set the struct attribute 'instance' it always gets set to 0. The value that it should be set to is 788 but it never works. I have tried to set it when in debug mode but it always goes back to 0.
I know this code work fine as before I separated out the code into a library, it worked fine with no problems when it was all in one project. The struct 'instance' attribute would be set correctly.
Has anyone had any success in separating out the HAL library into a static library? and have I2C or SPI etc working?
