vPortResetPrivilege declared implicitly warning in IAR

cliver47 wrote on Friday, April 07, 2017:

I have just started using IAR and have ported an Eclipse project I was working on into it. The project uses FreeRTOS. IAR is raising a lot of warnings on ‘vPortResetPrivilege’ and xTaskCreateRestricted.
I really would like to get rid of these warnings.
Is this a known issue and is there a fix. I cant see anything obvioulsy wrong with my project preprocessor options.
Thanks for any help.

cliver47 wrote on Friday, April 07, 2017:

Ops should have added it is mpu_wrappers.c that it seems not to like.

benwilliam10 wrote on Friday, April 07, 2017:

hi,
where did you get a MPU port for IAR?
I only see the one without MPU support in the trunk.

rtel wrote on Friday, April 07, 2017:

I get frustrated when people ask for help without helping themselves by
giving the information necessary to actually answer the question…so…

What are the warnings that are generated? If you posted them in your
original support request I might be giving you the answer now.

cliver47 wrote on Monday, April 10, 2017:

I apolgise for not being so detailed. The warnings were as per title ’ implicity declared’ from mpu_wrappers.c. I did think I had sufficient information there. Warning mostly vPortResetPrivilege. About 50 warnings.

'Warning[Pe223]:function “xTaskCreatRestricted” decalred implicity in mpu_wrappers.c
'Warning[Pe223]:function “vPortResetPrivilege” decalred implicity in mpu_wrappers.c

I am using IAR IDE 8.10.1 for the STM32F107VC

cliver47 wrote on Monday, April 10, 2017:

I used a FreeRTOS demo.

rtel wrote on Monday, April 10, 2017:

The MPU ports have portUSING_MPU_WRAPPERS set to 1 and
vPortResetPrivilege() defined in the portmacro.h files. They are
already defined in the GCC versions in the FreeRTOS download. You will
need to add them into your IAR version. For example in the
FreeRTOS/Source/portable/IAR/[your_port]/portmacro.h.

cliver47 wrote on Tuesday, April 11, 2017:

Thanks for taking time to reply. I have compared the GCC version I was using and the IAR version and I dont see anything in either that defines portUSING_MPU_WRAPPERS or vPortResetPrivilege().

rtel wrote on Tuesday, April 11, 2017:

Basic tools like grep can save you (and me in this case) a lot of time.

See lines 115 and 247 (at the time of writing) in the following file:

https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/portable/GCC/ARM_CM4_MPU/portmacro.h

cliver47 wrote on Wednesday, April 12, 2017:

But by adding them, surely I am telling FreeRTOS to use MPU. I was not using MPU in the CM3. This was not defined in my GCC version and is not currently defined in my IAR version of portMacro. I can add them but it seems the wrong thing to do. I will however bow to experience. Maybe Im being a bit dumb, not being that familiar with FreeRTOS fully. If I am not using MPU then do I not require to include the mpu_wrappers.c in my build? I have left it in because I had it in my GCC version and assumed it was a required part of FreeRTOS.

rtel wrote on Wednesday, April 12, 2017:

I assumed, given the title of the thread, and the original post, that
you were trying to use the MPU. vPortResetPrivilege() and
xTaskCreateRestricted() are only defined in the MPU port.

Are you just trying to use the normal IAR port for the Cortex-M? If so,
then you are simply building the wrong port layer - you need to build
the files from FreeRTOS/Source/portable/IAR/ARM_CM3 (or ARM_CM4F
depending). There are lots of example IAR projects in the FreeRTOS
download for you to use as a reference.

cliver47 wrote on Tuesday, April 18, 2017:

Yes I am just trying to use the normal IAR port for cortem-M3 (ARM_CM3). The files you mention are the files I am using and having the warning issues with. Im not using the MPU or the associated files. I have double checked these files and they are the correct ones, hence why I dont see the portUSING_MPU_WRAPPERS etc… in my files.