7 years, 3 months ago.

Comilation error MBED-RTOS LPC1768 with IAR

Hi,

I try to compile RTOS library for LPC1768 with IAR and I have next error:

[Error] RTX_CM_lib.h@120: [Pe020]: identifier "WORDS_STACK_SIZE" is undefined [Error] RTX_CM_lib.h@120: [Pe028]: expression must have a constant value [Error] RTX_CM_lib.h@277: [Pe020]: identifier "HEAP_START" is undefined

I type next command from cmd line: python.exe workspace_tools/build.py -m LPC1768 -t IAR -r -o debug-info

How to fix this error?

Best regards Milan Stevanovic

Question relating to:

1 Answer

7 years, 3 months ago.

Hello,

RTOS in mbed does not support IAR. only ARM GCC and ARMCC is supported currently. you can add IAR support, use github https://github.com/mbedmicro/mbed

Regards,
0xc0170

Accepted Answer

Hi,

I am using githhub https://github.com/mbedmicro/mbed and I try with next command to build mbed with rtos and IAR: python.exe workspace_tools/build.py -m LPC1768 -t IAR -r -o debug-info

but, I have these errors because WORDS_STACK_SIZE and HEAP_START is not defined.

I can add these defines but I am not sure aboute values.

Thanks a lot Best regards Mila Stevanovic

posted by Milan Stevanovic 08 Oct 2014

Each core has own HAL and SVC Table. This 2 assembly files should be added for IAR. look at rtos/rtx/TARGET_M0/

posted by Martin Kojtal 08 Oct 2014

Hi Martin,

Thanks a lot for your answer. I added these two files to support RTOS with IAR. But, my main problem is to find HEAP_START. There is GNUC example (different for other compiler): extern unsigned char end[];

  1. define HEAP_START (end)

But how to do this with IAR? Can you provide me some help?

Thanks a lot Best regards Milan

posted by Milan Stevanovic 10 Oct 2014

You can find those 2 files (for IAR) as part of RTX . I assume it might be available online through KEIL webpages.

I found them in Keil for example, downloaded through Package manager (in Keil v5)

posted by Martin Kojtal 10 Oct 2014

Hi Martin,

Yes your are right. I used these two files and this is not a problem. I found the solution for this in IAR documentation. I need to update code with next for HEAP_START:

  1. pragma section = "HEAP"

section_begin("HEAP"); thsi command return value for HEAP_START

Also, I need to add set_main_stack(); in section for ICCARM

After that everythings works fine

Thnaks a lot

posted by Milan Stevanovic 10 Oct 2014