I was compiling FreeRTOS v10.0.1 in the latest IAR v3.10.
But in \FreeRTOS\Source\portable\IAR\RL78\portasm.s87
COMMON INTVEC:CODE:ROOT(1)
ORG configTICK_VECTOR
gives below error:
COMMON directive is not supported in ELF mode
ORG directive is not supported in ELF mode
I found the reason is that IAR 1.x compiler uses UBROF but IAR 2.x and 3.x use ELF/DWARF.
In the new compiler, COMMON, ORG and some other syntx are deleted.
This has been noted by others on the forum who have been able to work
around it - but I don’t have visibility into what they did. I have not
tried myself, but if I were I would assume it was necessary to at least
update the linker script, and then maybe the C start up code if it
referenced any of the linker constants. To do that I would take the
linker script and C start up code from an example provided by IAR or
Renesas.
Thank you for reply.
I found an offical document EW_MigrationFromUBROF, which briefly introduces how to migrate from UBROF to ELF. I’m looking into it now.
Hi Richrad,
I’ve learnt the EW_MigrationFromUBROF, and run the Demo project successfully.
We should consider below things when migrating from UBROF to ELF:
C/C++ source code syntax
No special change for RL78 demo
assembler source code syntax
Assembler directives are changed a lot.
the call symbol between C code and asm code.
I didn’t find a way to install an ISR with assembler code.
linker configuration
RL78 demo uses default linker configuration. We should pay more attention to it if we need some special section configuration
Refer to the doc for more differences.
The changes I made:
The variables and function names in asm code must start with _ , and in c code without _ . Compiler will explain them as one symbol.
Comment out the ISR install code in the portasm file.
; COMMON INTVEC:CODE:ROOT(1)
; ORG configTICK_VECTOR
; DW vPortTickISR
; COMMON INTVEC:CODE:ROOT(1)
; ORG 126
; DW vPortYield
Then install ISR in c code, by using #pragma vector: