cortex-m3

linking arbitrary data using GCC ARM toolchain

我们两清 提交于 2019-11-27 19:32:42
I want to link in raw binary data. I'd like to either put it at a particular address, or have it link to a symbol (char* mydata, for instance) I have defined in code. Since it's not an obj file, I can't simply link it in. A similar post ( Include binary file with GNU ld linker script ) suggests using objcopy with the -B bfdarch option. objcopy responds with "archictecture bfdarch unknown". Yet another answer suggests transforming the object into a custom LD script and then include that from the main LD script. At this point, I may as well just be using a C include file (which is what I am

Cycle counter on ARM Cortex M4 (or M3)?

大城市里の小女人 提交于 2019-11-27 12:54:44
I'm trying to profile a C function (which is called from an interrupt, but I can extract it and profile it elsewhere) on a Cortex M4. What are the possibilities to count the number of cycles typically used in this function ? Function shall run in ~4000 cycles top, so RTC isn't an option I guess, and manually counting cycles from disassembly can be painful - and only useful if averaged because I'd like to profile on a typical stream with typical flash / memory usage pattern. I have heard about cycle counter registers and MRC instructions, but they seem to be available for A8/11. I haven't seen

GCC alias to function outside of translation unit -AKA- is this even the right tool for the job?

拈花ヽ惹草 提交于 2019-11-27 06:01:23
问题 I'm working with FreeRTOS on an STM32 (Cortex-M3), and using the CMSIS library from ST to bootstrap everything. The CMSIS library defines the weak symbol SVC_Handler in the startup ".s" file. It must be overridden somewhere in order to get your ISR in the interrupt vector table. FreeRTOS defines vPortSVCHandler , which is the ISR I want to have handle the SVC interrupt. I would like to "glue" the two together using my application code (i.e. w/o modifyng FreeRTOS or the CMSIS source code). I

linking arbitrary data using GCC ARM toolchain

醉酒当歌 提交于 2019-11-26 18:11:51
问题 I want to link in raw binary data. I'd like to either put it at a particular address, or have it link to a symbol (char* mydata, for instance) I have defined in code. Since it's not an obj file, I can't simply link it in. A similar post (Include binary file with GNU ld linker script) suggests using objcopy with the -B bfdarch option. objcopy responds with "archictecture bfdarch unknown". Yet another answer suggests transforming the object into a custom LD script and then include that from the

Cycle counter on ARM Cortex M4 (or M3)?

断了今生、忘了曾经 提交于 2019-11-26 16:09:08
问题 I'm trying to profile a C function (which is called from an interrupt, but I can extract it and profile it elsewhere) on a Cortex M4. What are the possibilities to count the number of cycles typically used in this function ? Function shall run in ~4000 cycles top, so RTC isn't an option I guess, and manually counting cycles from disassembly can be painful - and only useful if averaged because I'd like to profile on a typical stream with typical flash / memory usage pattern. I have heard about