Closed Tal-seven closed 4 years ago
@mikepurvis could you please weigh in on this. Thanks
I'm afraid I don't have tons to add here except to say that it has been a challenge getting stm32plus to cooperate with other libraries, particularly where c++11 is concerned, and getting rid of the vendored-in STL would a long ways toward fixing that story.
got it Thanks. Any recommendations ,guidelines, gotchas, optimization tricks to be followed while making the shift?. Basically anything that you could throw at me :) . "out-of-the-box" gnu STL seems to be good enough without any hacking. Following is the size output of the default stm32plus static lib with SGI STL and -O3
text data bss dec hex filename
226019 10133 846 236998 39dc6 (TOTALS)
This is the result with gnu libstdc++ that ships with gcc 7.2.1 and -O3.
text data bss dec hex filename
220663 10133 814 231610 388ba (TOTALS)
The only changes that i've made to the stm32plus code thus far is using forward_list in place of slist.
Hi,
This is going to be a little longer than usual, since i intend to provide maximal info about the project and the issues i'm running into. Things to consider: Issues could be due to mistakes i'm making in integration. Or this could be a genuine problem that i could be able to fix.
Project setup: STM32F429 stm32plus + Chibios_RT (OS only) + UAVCAN.
I have been running stm32plus + chibios for a couple of weeks now without any issues. But integrating uavcan + stm32plus looks a little tricky. Uavcan depends on c++11 and isnt happy with the stm32plus provided stl implementation. For instance it requires std::function which in stm32plus's stl library is an empty header. I tried an adhoc solution by changing stm32plus provided "functional" header to. Now uavcan pulls in the right header from gnu c++. It fixed that particular issue, but "std functional" pulls in its own dependencies.
If you trace the error stack to the top, its clear that the gnu c++ headers are including stm32plus/stl headers. which can never be correct. So i changed the default stm32plus cmake file to not include the stl folder by default and any code that requires from stm32plus's stl library will have to include it as <stl/foo> instead.
This causes the following:
uavcan stand-alone points to gnu cxx headers and the test project includes uavcan header files which within the scope of the stm32plus test project are including gnu headers thus leading to re-definition errors. Is there a way to sort out this dependency mess. I cannot make libuavcan point to stm32plus's stl since that would just be a massive limitation and might even break alot of uavcan code.
Refactoring stm32plus against gnu c++ and entirely removing stm32plus stl would be a massive undertaking and something i will be doing in the near future. But is there an adhoc solution which fixes the issue for now and gives me time to work refactor the library, while making progress on the project.