DS 1.2.0: Create a "tradional" app - NO task table.

How to create a “traditional” Open-AT application in DS 1.2.0 :question:

ie, with just the adl_main entry point - no task table.

It’s a little bit tricky.
First of all, create an empty OpenAT project in DS 1.2.0. Then go to generated.c file and click on Task Table gear icon to modify his entris, click on main task and delete it. Click back on gear icon to disable Task Table editing.

Go to main.c file and, for example, put this code:

#include "adl_global.h"

const u16 wm_apmCustomStackSize = 1024*3;

void adl_main ( adl_InitType_e InitType )
{

}

And enjoy!

I tried this, and it didn’t work!

It left an empty task table, and the application failed to start:
AT+WOPEN=7 gave OatState = 16, “no tasks declared; The application tasks table is empty, no task is declared”

Maybe task table must be deleted completely? My code with traditional adl_main (and without any task definition) works just fine on old (3.22) and new SDK.

Here is content of generated.c for new SDK project:

// List of embedded components
const char mos_headerSEList[] =
"Developer Studio\0" "1.2.0.201012171243-R6026\0"
"Open AT Embedded Software Suite package\0" "2.34.0.201009161320\0"
"Open AT OS Package\0" "6.34.0.201007281407\0"
"Firmware Package\0" "7.44.0.201008311212\0"
"WIP Plug-in Package\0" "5.40.0.201007290812\0"
"\0";

// Principal ADL header include
#include "adl_global.h"

And here some commented info from adl_AppliInit.h

/**
  @brief Single task application entry point

  @deprecated   Former way to declare the entry point of a single task application, kept for ascendant compatibility. If this function is used, the #adl_InitTasks table has not to be declared.

  @param[in]    adlInitType     Wireless CPU initialization type (please refer to #adl_InitType_e description for more information)
 */
void adl_main ( adl_InitType_e adlInitType );

The question was specifically how does one create a “traditional” app - not how does one hack what DS produces to turn it into a “traditional” app!

In my opinion, there should be an option in the Project creation to select either “traditional” or task-table.

The “official” way is indeed to disable the task table generation in Application Settings editor. Take a look at the generated.c file content once disabled, the task table shouldn’t exist anymore, and your good old adl_main will be called.

By the way, we proceed like this because:

  • “adl_main” is considered as a deprecated method for some years now
  • Technically speaking, there is no difference (ok, except the init type argument – that you can get from another API) between using adl_main or a task table with a single task.

This has never been specifically documented.

All mention of adl_main has just disappeared from the ADL User guide - it has never been actually stated that this method is now deprecated.

And all of the supplied examples (except the ones specifically using multitasking) have, until very recently, used adl_main.

I’m sorry but this is not true: please have a look to chapter 3.1.2.3 in ADL User Guide. I’m pretty sure this chapter is present since Open AT 6.00 release.

On this point you’re right. Samples are currently being revamped; I’ll get in touch with the concern people to check if this point has been addressed.

Which version?

ADL User Guide for Open AT® OS 6.32 has no section 3.1.2.3;
v6.31 doesn’t number the sub-sections at all.

I’ll have to check…

Just noticed that lots of the code examples within the ADL User Guide for Open AT® OS 6.32 still use adl_main !

Sorry, I forgot to mention it: 6.34

True also; I’ll ask for documentation update also on that point.

That section is, I think, new.

As I said before, previous versions of the document (since multitasking was introduced) have just ignored adl_main completely - apart from using it in examples! :unamused:

Seems you’re right: the section didn’t exist in 6.32 documentation.

Better late than never, I suppose… :wink: