# UART Raw Access - a very bad example!

**URL:** <https://forum.sierrawireless.com/t/uart-raw-access-a-very-bad-example/4133>\
**Category:** Open AT\
**Created:** [January 25, 2010, 7:06pm UTC](https://forum.sierrawireless.com/t/uart-raw-access-a-very-bad-example/4133 "2010-01-25T19:06:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [January 25, 2010, 7:06pm UTC](https://forum.sierrawireless.com/t/uart-raw-access-a-very-bad-example/4133/1 "2010-01-25T19:06:14Z")

</div>

The explanation of how to use the UART Raw Access sample is very poor - in particular that it makes no mention whatsoever of the fact that AT+WMFM has to be used to “disable” a UART before it can be “opened” by the sample! 😠

See: [viewtopic.php?f=78&t=4504&p=18186#p18186](http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?f=78&t=4504&p=18186#p18186)

Thus the UART specified in the AT+WDU command must be different from the one on which the command is issued!

This must also mean that the sample is unusable on any device with only 1 UART ❓

It also generates 3 warnings in the build - atoi, atol, and isalpha are not prototyped

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [January 26, 2010, 9:43am UTC](https://forum.sierrawireless.com/t/uart-raw-access-a-very-bad-example/4133/2 "2010-01-26T09:43:55Z")

</div>

```auto
/ *************************************************************************** /
/* Mandatory variables */
/*-------------------------------------------------------------------------*/
/* wm_apmCustomStackSize */
/*-------------------------------------------------------------------------*/
/ *************************************************************************** /
const u16 wm_apmCustomStackSize = 1024*3;

const adl_InitTasks_t adl_InitTasks [] =
{
    { mtInit, 4096, "MainTask", 2 },
    { stInit, 4096, "SecondTask", 1 },
    { NULL, 0, NULL, 0 }
};
```

As the application has an adl\_InitTasks table, is wm\_apmCustomStackSize really mandatory ❓

In fact, is it actually required at all ❓😕

It certainly isn’t documented in the ADL User Guide for Open AT® OS v6.21 😠  
See: [viewtopic.php?f=23&t=4514](http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?f=23&t=4514)

---

<div class="post-metadata">

**Author:** ![paruthiv](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@paruthiv](https://forum.sierrawireless.com/u/paruthiv)\
**Post date:** [January 27, 2010, 10:26am UTC](https://forum.sierrawireless.com/t/uart-raw-access-a-very-bad-example/4133/3 "2010-01-27T10:26:09Z")

</div>

But isn’t there a trace received when we try to open an already open UART through WDU command which states that this cannot be done…?? i Thought it did… 😊

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [January 27, 2010, 10:35am UTC](https://forum.sierrawireless.com/t/uart-raw-access-a-very-bad-example/4133/4 "2010-01-27T10:35:51Z")

</div>

All the trace says is that it failed - it does not give any reason for the failure.

This is partly becuase the error reporting from the Device Service itself is pretty pathetic - there’s pretty much just one error code that covers all failures for all reasons! 😠

---

<div class="post-metadata">

**Author:** ![paruthiv](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@paruthiv](https://forum.sierrawireless.com/u/paruthiv)\
**Post date:** [January 27, 2010, 11:31am UTC](https://forum.sierrawireless.com/t/uart-raw-access-a-very-bad-example/4133/5 "2010-01-27T11:31:45Z")

</div>

oops…!! that means the developer has to waste a lot of time before he actually realizes that the problem is coz the uart was already opened which is certainly not acceptable…

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [January 27, 2010, 11:49am UTC](https://forum.sierrawireless.com/t/uart-raw-access-a-very-bad-example/4133/6 "2010-01-27T11:49:34Z")

</div>

> [@paruthiv](#):
>
> that means the developer has to waste a lot of time before he actually realizes that the problem is

Exactly!

See also: [viewtopic.php?f=16&t=2733&hilit=wip+berr#p10154](http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?f=16&t=2733&hilit=wip+berr#p10154)

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [January 27, 2010, 3:57pm UTC](https://forum.sierrawireless.com/t/uart-raw-access-a-very-bad-example/4133/7 "2010-01-27T15:57:47Z")

</div>

> [@paruthiv](#):
>
> that means the developer has to waste a lot of time

In addition to the time wasted due to errors in the documentation: [viewtopic.php?f=23&t=4521](http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?f=23&t=4521)
