Compilation error

Hello, I am trying to compile (using Keil) an app into an STM32F407IG and get these errors:

Error: L6218E: Undefined symbol FLASH_segment_end (referred from port.o).
Error: L6218E: Undefined symbol FLASH_segment_start (referred from port.o).
Error: L6218E: Undefined symbol SRAM_segment_end (referred from port.o).
Error: L6218E: Undefined symbol SRAM_segment_start (referred from port.o).
Error: L6218E: Undefined symbol privileged_data_end (referred from port.o).
Error: L6218E: Undefined symbol privileged_data_start (referred from port.o).
Error: L6218E: Undefined symbol privileged_functions_end (referred from port.o).
Error: L6218E: Undefined symbol syscalls_flash_end (referred from port.o).
Error: L6218E: Undefined symbol syscalls_flash_start (referred from port.o).

I have founded in port.c this conditional extern variables:

static void prvSetupMPU( void )
{
#if defined( __ARMCC_VERSION )
/* Declaration when these variable are defined in code instead of being
* exported from linker scripts. /
extern uint32_t * privileged_functions_end;
extern uint32_t * FLASH_segment_start;
extern uint32_t * FLASH_segment_end;
extern uint32_t * privileged_data_start;
extern uint32_t * privileged_data_end;
#else
/
Declaration when these variable are exported from linker scripts. */
extern uint32_t privileged_functions_end[];
extern uint32_t FLASH_segment_start[];
extern uint32_t FLASH_segment_end[];
extern uint32_t privileged_data_start[];
extern uint32_t privileged_data_end[];
#endif

and these:

static void prvSVCHandler( uint32_t pulParam )
{
uint8_t ucSVCNumber;
uint32_t ulPC;
#if( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 )
#if defined( __ARMCC_VERSION )
/
Declaration when these variable are defined in code instead of being
* exported from linker scripts. /
extern uint32_t * syscalls_flash_start;
extern uint32_t * syscalls_flash_end;
#else
/
Declaration when these variable are exported from linker scripts. /
extern uint32_t syscalls_flash_start[];
extern uint32_t syscalls_flash_end[];
#endif /
#if defined( __ARMCC_VERSION ) /
#endif /
#if( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 ) */

Does anybody know what might be missing to cause these error messages?
I am using this port for my app: FreeRTOS\Source\portable\GCC\ARM_CM4_MPU
Thank you for your help

That is the port with memory protection unit (MPU) support. Was that your intention? If so the variables that are currently missing are linker variables and need to be defined in your linker script - which Keil call a scatter file. There are examples in the FreeRTOS download if you look in FreeRTOS/Demo/CORTEX_MPU_*. Otherwise, if you didn’t intend to use the MPU port build the port files from the directory that doesn’t have MPU in its name.

Hello, I have changed the port to FreeRTOS\Source\portable\GCC\ARM_CM4F and it compiles fine. I think just made a mistake by selecting the wrong port. I was thinking because STM32F407IG includes a memory protection feature, then i should choose ARM_CM4_MPU port.
Sorry I am new to FreeRTOS.
Thank you