OpenOCD relies on the symbol 'chSysInit' being present to identify ChibiOS for rtos thread support. However, if link-time optimisation (LTO) is enabled for the ChibiOS build, as it is by default, this function may be inlined and its symbol dropped from the linked binary.
The symbols 'ch' and 'ch_debug' are also required (currently if 'ch' is found and 'ch_debug' is not, recognition of ChibiOS will fail with an info message) so the chances of a false positive would be resonably small even if the reliance on chSysInit were removed.
To recreate: Fresh build of OpenOCD 0.9.0, fresh build of the STM32F4DISCOVERY demo project from ChibiOS 14.1.4 using default settings. OpenOCD is unable to identify ChibiOS because the chSysInit symbol is missing from the binary.
Hello,
Thank you for the report.
On Tue, Mar 08, 2016 at 11:36:25AM +0000, Andy Pomfret wrote:
So do you basically suggest to remove chSysInit mentioning from
OpenOCD altogether and rely solely on "ch"?
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@gmail.com
Yes, that would be my suggestion. I'm happy to submit a patch myself. Note that both 'ch' and 'ch_debug' are actually required for successful detection, which is good - I'd be nervous about relying on the presence of a single two-character symbol for the detection (false positives would be more likely).
On Tue, Mar 08, 2016 at 11:50:38AM +0000, Andy Pomfret wrote:
Please feel free then :)
Patch submitted (change 3381).
Last edit: Andy Pomfret 2016-03-08
gerrit patch merged.