ChibiOS OpenOCD support
Re: ChibiOS OpenOCD support
Giovanni, I think the ch_root symbol is automatically removed by the GCC garbage collection.... 
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: ChibiOS OpenOCD support
Mh, I have to reference it somewhere...
Could you add a "keep" to the linker script in the meanwhile? or just disable the GC in the Makefile.
Giovanni
Could you add a "keep" to the linker script in the meanwhile? or just disable the GC in the Makefile.
Giovanni
Re: ChibiOS OpenOCD support
Hi Giovanni,
i did so already. Disabling my GC will result in too big executable in my test program. I'm sure you'll find a nice place to reference it.
Best,
MaBl
i did so already. Disabling my GC will result in too big executable in my test program. I'm sure you'll find a nice place to reference it.
Best,
MaBl
Re: ChibiOS OpenOCD support
Hi mabl,
maybe gcc __attribute__ ((used)) can also work for you to preserve structure. But don't know if any other commercial compilers has some similar option, so not sure about portability. Another solution would be put structure in dedicated section and use KEEP keyword for this input section in linker script.
maybe gcc __attribute__ ((used)) can also work for you to preserve structure. But don't know if any other commercial compilers has some similar option, so not sure about portability. Another solution would be put structure in dedicated section and use KEEP keyword for this input section in linker script.
Re: ChibiOS OpenOCD support
mabl wrote:Giovanni, I think the ch_root symbol is automatically removed by the GCC garbage collection....
From my ignorance in programming but, can not you just declare it as "volatile"? then the compiler will not remove it.
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: ChibiOS OpenOCD support
Hi,
I never used "volatile" in that context but probably you are right, I will give it a try.
Giovanni
I never used "volatile" in that context but probably you are right, I will give it a try.
Giovanni
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: ChibiOS OpenOCD support
I missed this:
@dandys, I believe that __attribute__ is a GCC-specific extension.
Giovanni
@dandys, I believe that __attribute__ is a GCC-specific extension.
Giovanni
Re: ChibiOS OpenOCD support
Giovanni wrote:I missed this:
@dandys, I believe that __attribute__ is a GCC-specific extension.
Agree. But there can be some similar extensions for other compilers too (as is for packed structures for example). In this case some macros like KEEP_SYMBOL_BEGIN and KEEP_SYMBOL_END can be defined in chtypes.h. Are some IAR or KEIL users arround? Anyway still not sure if this would be the best solution. Declaring as volatile won't work IMHO. At least I can't find it _must_ work in C89 spec.
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: ChibiOS OpenOCD support
Mhh, then I will just add a reference somewhere to the variable.
thanks,
Giovanni
thanks,
Giovanni