Hi to all ,
I'm writing an application using ARTX166 and PK166 ( all updated to last versions ) . I'm writing it for an our board that use XC167CI 32F40F with external RAM 1 Mbit ( 16 bit multiplexed bus ) , located at 0x4C0000 .
When I compile the application , the stack of OS ( size 200 byte ) is automatically located on external RAM , but I would like to locate it on Internal RAM ( maybe IDATA at 0xF600 ) .
My application is time critical ( engine control unit ) , so I realy need to do so .
How can I configure the OS to locate stack at this position ?
The memory pool for the User stack allocation is defined in AR166_Config.c configuration file. You can change the declaration to force the pool location into the internal ram (idata).
/* Memory pool for User stack allocation (+ idle demon). */ _declare_box (idata mp_stk, OS_STKSIZE*2, OS_TASKCNT-OS_PRIVCNT+1); U16 const mp_stk_size = sizeof(mp_stk);
Franc
Thank You Franc . It work fine .
I would like to made the same with global variable declared inside AR_RESOURCE.C :
OS_ID os_psq[16]; void *os_msg[16];
That the linker locate on external RAM . I try to change this with :
OS_ID NEAR_MEM os_psq[16]; void* NEAR_MEM os_msg[16];
I compile the ARTX166 for my memory model ( compact ) , and can see that it work fine . To made it working I set also ( PROJECT TARGET setting ) Near memory RAM to 16 kByte, in this way my external RAM is considered FDATA .
1) Can I can have some collateral effects with this modify to ARTX166 ?
2) Do You know a better way to force the linker to don't thread like NDATA ( Maybe linker directive ) ?
Many thanks for your help