Hi,
I have some troubles with basic usage of the MidSys component.
Here is mine trXEnterKernelParam struct:
CONST RX_ENTERKERNEL_PARAM_T trXEnterKernelParam=
{
/* CPU clock rate */
NETX_FREQUENCY_100MHZ,
/* Timer interrupt task priority */
{TSK_PRIO_DEF_RX_TIMER, 350},
/* Pointer to static Task-List */
{atrXStaticTasks, MAX_CNT(atrXStaticTasks)},
/* Pointer to rx kernel modules list */
{0, 0},
/* Pointer to the Peripherals-List */
{atrXCfgPre, MAX_CNT(atrXCfgPre)},
/* Pointer to the Post Peripherals-List / LoadDrivers included into */
{atrXDrvCfgPost, MAX_CNT(atrXDrvCfgPost)},
/* Pointer to optional Jump Table */
{0, 0},
/* Callback for special initialization */
NULL,
/* Pointer to the Middleware List */
{atrXMidCfgPost, MAX_CNT(atrXMidCfgPost)},
/* Scheduler component (if another scheduler is desired) */
0,
/* Cache enable flags */
{FALSE,FALSE},
/* Disable Idle measurement */
{FALSE},
/* Early callback */
NULL,
/* MMU TTB start address */
{0x8000}
};
And here is mine middleware array:
CONST FAR RX_MIDDLEWARE_CONFIG_T atrXMidCfgPost[] = {
{MidDatabaseInit},
{MidSysInit},
{MidSysDpmInit, &atrXMidSysDpmInit, MAX_CNT(atrXMidSysDpmInit)},
};
where atrXMidSysDpmInit is:
CONST FAR MID_SYS_DPM_SET_T atrXMidSysDpmInit[] =
{
{
{
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
},
0,
0,//0, /* Number of Dualport channel */
MAX_CNT(tChannels),
&tChannels[0]
}
};
The problem is that I cannot get a queue handle to the "MID_SYS_QUE" - when I call the IdentifyQueue (rX API or TLR macro), I get 0x0906 - RX_QUE_UNKNOWN.
I tried to change some task priorities, to perform the identification later in my code (to allow some time for the internal initialization) but without success.
Is there any specific way to perform middleware initialization?
I can try to call the individual middleware components dynamically (in my task), but should this happen before or after the TaskInitialized() call of the creation task?
What else could I check to locate the problem? Is there a variable that holds the list of all queue in the rcX?
If I try to identify another, existing queue (that I have created), the function returns RX_OK and I get correct handle.
I've tried it (using exactly your structure, and verifying that in HIF drv init structure the pointer and the number of channels is NULL/0) - same result - the queue
If I use "RCX_QUE" instead of "MID_SYS_QUE", the queue is found and your function seem to run.
Then I get 2 answers to my TLR task (probably because your function sends 2 commands) - the firsts one has status=0xC02B0012 ("TLR_E_RCX_LOG_QUE_NOT_SET") - the queue cannot be set; the second packet has status = 0 and I think it is OK.
But (it seems) that packets from host to the comm channel 0 are not appearing on my TLR task's queue.
I suppose using "RCX_QUE" is not ok - I should find the reason why the "MID_SYS_QUE" is not created.
I made some assembly stepping in the MidSysInit() body and saw that it creates one queue - with name "RCX_QUE". Where is it supposed to be the creation of the "MID_SYS_QUE" ? Is it in the MidSysDpmInit()?
[Edit:]
Is it correct that when I use the MidSysDpmInit, in the HIF Drv structure I should keep the channel description pointer=NULL and the number of channels=0? And this is true even if I use my own comm channel (not the default communication channel)?
[EDIT:] Another strange thing - when I make a search for the name of the queue "MID_SYS_QUE" in all files of the rcX OS and rcX BSP (sources, includes, libraries *.a), it is not found at all ?????
If I look for "RCX_QUE", it is present in the libmid.a (as expected).
So, how is the "MID_SYS_QUE" constant string encoded when it is not present in the libraries?
M T
Hilscher Gesellschaft für Systemautomation mbH
Did you try to use default channel layout? You are currently trying to use a custom layout given through tChannel.
Also set the Channel Count to 0 for the Hif Driver Initialization, as MidSysDpmInit should create the channels itself.
Probably there is an error in your channel configuration. Try to set the number of Default Channels to 1 and CustomChannels to 0 to see if your configuration is rejected?
Like this:
CONST FAR MID_SYS_DPM_SET_T atrXMidSysDpmInit[] = { { { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }, 0, 1, /* Number of Default Dualport channels */ 0, NULL } };Regards
MT