LPC43x Dual Core project - GCC Optimizations - .syntax unified

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC43x Dual Core project - GCC Optimizations - .syntax unified

452件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ehughes on Sat Dec 12 15:01:21 MST 2015
I am posting this so others who may have had an issue with enabling gcc compiler optimizations when you are compiling a dual core LPC43xx project.

Background:

I have had a dual project for  aproduct for the past 2 years.  I wanted to enable the -02 optimization to get the M4 DSP instructions.    I immediately notice that I go build failures.   Almost all of the errors were compiling the cr_startupc_lpc43xx.c.    

The issue is that when using optimization, it doesn't appear that the compiler generates asm code that uses the ARM unified syntax.    Most of the errors indicate that certain addressing modes,  registers, etc are not valid in thumb mode.

I get everything working I had to add

__asm(".syntax unified");

at the start of all the function calls for the ISRs.    This behavior does NOT happen whenever you at -O0.   It also don't not happen unless you are linking in an object file from the cortex M0 project.


Adding  __asm(".syntax unified"); seems to fix the problem.  I am not sure why GCC isn't generating .s files with the syntax unified directive in the files.


I hope this happens to help someone else!

0 件の賞賛
返信
1 返信

425件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Dec 15 10:24:57 MST 2015
GCC's way of treating assembler as unified syntax (or not) has tended to change slightly over releases, and also between different Cortex-M variants.

It always possible if your project has been underway for a long time that you are using a vintage version of the startup file which assumed a gcc behaviour that has now changed.

However your assertion that you see different behaviour at- O0 vs -O2 makes little sense, perhaps unless the code in question is being inlined (or not inlined). But without seeing your actual project and knowing what version of the tools you are using, it is hard to comment further.

Regards,
LPCXpresso Support


0 件の賞賛
返信