Data mover R5 to A53#
Idea#
The goal is to move sampled data from the R5 processor via the A53 to the host PC running a GUI, which displays and logs the data. Important requirements are
no data is lost, all samples are transfered and logged
on the R5 side, it has to run synchronous to the control ISR, since all the data is updated in each call of the ISR, i.e., in each time step.
the sampling frequency can be up 100kHz
minimal effort for R5 to avoid stealing computation time from the control ISR
At the same time, a data path in the opposite direction GUI -> A53 -> R5 is needed to enable and disable the system and set references. This path is not time critical and is described in detail at the end of this section.
Please see also the matching description of the APU code.
Selection of transmitted channels#
In javascope.h
an enumeration variable enum JS_OberservableData
is defined that is used to identify the observable data with a unique name.
enum JS_OberservableData {
JSO_ZEROVALUE=0,
JSO_ia,
JSO_ib,
JSO_Speed_rpm,
//...//
JSO_ENDMARKER
};
In javascope.c
in function JavaScope_initalize(DS_Data* data)
, the array float * js_ch_observable
is initialized and holds the pointers to all observable data.
float *js_ch_observable[JSO_ENDMARKER];
int JavaScope_initalize(DS_Data* data)
{
js_ch_observable[JSO_Speed_rpm] = &data->av.mechanicalRotorSpeed;
js_ch_observable[JSO_ia] = &data->av.I_U;
js_ch_observable[JSO_ib] = &data->av.I_V;
// ... //
}
In ipc_ARM.c
, the selected channels are written to js_ch_selected
. The selection is decided in the JavaScope application.
extern float *js_ch_observable[JSO_ENDMARKER];
extern float *js_ch_selected[JS_CHANNELS];
void ipc_Control_func(uint16_t msgId, uint16_t value, DS_Data* data)
{
if (msgId == 1) {}
else if (msgId == 204) // SELECT_DATA_CH1_bits{
if ( value >= 0 && value < JSO_ENDMARKER ) {
js_ch_selected[0] = js_ch_observable[value];
}
}
else if (msgId == 205) // SELECT_DATA_CH2_bits{
if ( value >= 0 && value < JSO_ENDMARKER ){
js_ch_selected[1] = js_ch_observable[value];
}
}
// ... same for all other channels //
}
Where value
relates to an entry in enum JS_OberservableData
which is also known to the JavaScope application.