Compilation Error regarding to portmacro.h file

Hello,
I’m trying to port free rtos on LPC1768 microcontroller. I’m using keil Uvision 4, details are shown below :
Toolchain RealView MDK-ARM Version 4.02
C Compiler Armcc.Exe (V4.0.0.524)
Assembler Armasm.Exe (V4.0.0.524)

I’ve selected port files from below location :
FreeRTOSv202012.00\FreeRTOS\Source\portable\RVDS\ARM_CM3

I’m getting below errors for compiling assembly code in portmacro.h file :

rtos\portmacro.h(171): error: #1113: Inline assembler not permitted when generating Thumb code

I’ve used #pragma arm and #pragma thumb above and below assembly code but got below error
rtos\portmacro.h(170): error: #1114-D: this feature not supported on target architecture/processor

I’ve read threads regarding to same which advise to use embedded assembler instead inline assembler , but how to select/use embedded assembler I don’t have idea about it ?
Kindly suggest solution for above mentioned problem. Thank you .

If this version of the C compiler is based on LLVM (so the newer compiler shipped with MDK-ARM), then try using the port in /FreeRTOS/Source/portable/GCC/ARM_CM3. Thanks.

Thank you for your reply . I tried with port files in path : /FreeRTOS/Source/portable/GCC/ARM_CM3

but getting same error as : rtos\portmacro.h(135): error: #1113: Inline assembler not permitted when generating Thumb code

above error I’m getting for below mentioned line in portmacro.h file:
__asm volatile ( “clz %0, %1” : “=r” ( ucReturn ) : “r” ( ulBitmap ) : “memory” );

Thank you.

I suspect the compiler is not being set for the right device, or there is some other project configuration mismatch. Are you able to share the command line you are using to build? Normally the command line would be output to a console window within the IDE.

Looking at this page, the version 4 of armcc is based on RealView Development Suite (RVDS): Arm Compiler | Legacy Arm Compilers – Arm Developer

So you probably need the RVDS port at portable\RVDS\ARM_CM3. This seems a pretty old toolchain though - is there a reason you cannot use latest toolchain?

Thanks.

Thank you @rtel and @aggarg for your suggestion , it might be dute older version of Keil. I tried with latest version of keil and it is working now.