This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello All
The error of compilation occurred when I tried to change the list of functions called before module startup.
The table "List of functions called before module startup" has the path SYS/BIOSSystem/Startup/All Options
When I selected other function from drop list, the all functions of this table were disappeared, The *.cfg file was changed.
The string like this
Startup.firstFxns[2] = Task.yield;
Startup.firstFxns[1] = BIOS.start;
were added. Where Task.yield and BIOS.start are selected new functions.
And compilation was unsuccessful with some error.
When I commented these lines, the previous function came back and compilation as well was with success.
Can somebody explain me how to initialize the list of functions ?
And where I can find description of available functions ?
Best regards
Andrii Shevchuk
Andrill,
Startup.firstFxns are functions that you would like to call very early in your application before any SYSBIOS modules are initialized.
You definitely can not call 'Task.yield' or 'BIOS.start' in a Startup.firstFxns.
Its not clear to me what you are trying to accomplish? What are you trying to do with the Startup.firstFxns module?
Judah
Hello Judan
1 )
You have wrote
You definitely can not call 'Task.yield' or 'BIOS.start' in a Startup.firstFxns.
But to know which function I can call I have to have documentation about this functions.
So that is why I asked my question - And where I can find description of available functions ?
Becouse I have some set of functions in drop list, but I do not know exactly how to use it.
2)
But I gave these functions only as examle.
( Startup.firstFxns[2] = Task.yield;
Startup.firstFxns[1] = BIOS.start; )
Does not matter which functions I want to change in list of Startup.firstFxns
For example can I assign the null ? or another example - Clock.tickStop?
Startup.firstFxns[0] = Clock.tickStop;
or
Startup.firstFxns[1] = null;
But It leads to the above-mentioned behavior.
Or for example how to add my own function ?
So my question
Can somebody explain me how to initialize the list of functions ?
Is still active.
Best regards
Andrii Shevchuk.
Andrii,
In the Getting Startup Guide section 6.5 it says
The Startup module manages the very early startup initialization that occurs before C's main() function is invoked. This initialization typically consists of setting hardware specific registers that control watchdog timers, access to memory, cache settings, clock speeds, etc. In addition to configuration parameters that allow the user to add custom startup functions, this module also provides services that allow modules to automatically add initialization functions to the startup sequence. Configuration files (*.cfg) that configure the Startup module should enable this module as follows: var BIOS = xdc.useModule('xdc.runtime.Startup'); See Section 3.1 for an overview of the startup process, including the sequence in which functions configured for the Startup module are run and an example configuration script excerpt that installs a usersupplied startup function at every possible control point in the startup sequence.
You've already highlighted Section 3.1 the SYSBIOS Startup Sequence.
I'm not sure what drop list you are referring to but any function that is already plugged in to the 'Reset.fxns' or the 'Startup.firstFxns' is because SYSBIOS plugged those in because you need them. If you have some of your own functions that need to be plugged in, you can do that via your .cfg file.
If you do not, then no other function or functions should be plugged in. There is no list of available function to be plugged in.
Again, I ask what you are trying to do with Startup.firstFxns? Ideally, don't touch it. Whatever is in there is because SYSBIOS thinks you need it and you should not be adding to it unless you know what you are trying to do. No SYSBIOS kernel functions should be called from there...for examples task, semaphore, clock, Hwi, etc...should never be called because those modules have not been initialized yet. You might find Boot calls because Boot module needs to happen very early.
In the getting started guide section 3.1, it has an example of how to add your own function (I'll post it for your benefit):
/* get handle to xdc Startup module */
var Startup = xdc.useModule('xdc.runtime.Startup');
/* install a "first function" */
Startup.firstFxns[Startup.firstFxns.length++] = '&myFirst';
Hope that helps
Judah
Hello Judahvang
I would like to add my own function but I see these is not posible now.
Thank you for yours answer.
Best regards
Andrii Shevchuk
Andrii,
Like I said, It all depends on what you are trying to do. Adding a function is easy to do but is it the right thing to do is the real question.
Judah