FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2016 Threads] Using gcc -finstrumental-functions for profiling on cortex-m1Posted by qmor on October 13, 2016 Hello, i have a project for cortex-m1 with FreeRTOS and i'm trying to find out hard faults reasons. Because of that i want to use -finstrumental-functions of GCC compiler. Unfortunatelly this option cause new Hard Fault somethere at the beginning of execution. Did someone try to use this option on ARM arch? Thich FreeRTOS function should be marked with attribute((noinstrumentfunction))? Or maybe i need to use some other tricks?
Thanks in advance
Using gcc -finstrumental-functions for profiling on cortex-m1Posted by xz8987f on October 13, 2016 Hi Oleg,
yes, I have used that function both for M0+ and M4, but not for M1 (which is available only for FPGA's?). See https://mcuoneclipse.com/2015/04/04/poor-mans-trace-free-of-charge-function-entryexit-trace-with-gnu-tools/
But I think you won't find easier your problem with that option: what you need is a hard fault handler (have you used one? See https://mcuoneclipse.com/2012/11/24/debugging-hard-faults-on-arm-cortex-m/).
I hope this helps,
Erich
Using gcc -finstrumental-functions for profiling on cortex-m1Posted by qmor on October 13, 2016 ~~~
But I think you won't find easier your problem with that option: what you need is a hard fault handler (have you used one?
~~~
Thanks. I have Hard Fault handler, but unfortunatelly it's not easy to understand that's wrong with code.For example stacked_pc points to code like
add r3,#8
Why it could cause Fault?
Using gcc -finstrumental-functions for profiling on cortex-m1Posted by xz8987f on October 13, 2016 keep in mind that the PC usually is after the instruction who caused the problem. And you need to check the stacked LR as well.
Using gcc -finstrumental-functions for profiling on cortex-m1Posted by qmor on October 13, 2016 Okay. Thanks a lot. I'll describe my problem more deeper. I've got an application with a several tasks. Couple of these tasks is using for external interface communication (CAN and 1553B) and one of the tasks is using to compute some math. If we are enable this task sooner or later app will end in Hard Fault. Usualy it's crashes at the same place, and it's looks like some unaligment access. I dont understand how function may be executed for a thousands times without any problem and then suddenly crash with unaligment memory access. Can you suggest something to check?
Using gcc -finstrumental-functions for profiling on cortex-m1Posted by xz8987f on October 13, 2016 Are you indeed running on an FPGA model? I suggest to run your code on a real M0+ as it could be that your syntesized model has an issue?
Is that unaligned access on the stack (so maybe a stack problem)?
Using gcc -finstrumental-functions for profiling on cortex-m1Posted by qmor on October 14, 2016
Are you indeed running on an FPGA model?
No, i'm using Russian SoC 1986VE1T which is real SoC.
Is that unaligned access on the stack (so maybe a stack problem)?
I think the same, because of that i want to trace execution to see which functions called just before hard fault, i hope this will help me to find a problem.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|