# Reset modem

**URL:** <https://forum.sierrawireless.com/t/reset-modem/620>\
**Category:** Open AT\
**Created:** [August 17, 2006, 12:07pm UTC](https://forum.sierrawireless.com/t/reset-modem/620 "2006-08-17T12:07:18Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://forum.sierrawireless.com/u/Alex)\
**Post date:** [August 17, 2006, 12:07pm UTC](https://forum.sierrawireless.com/t/reset-modem/620/1 "2006-08-17T12:07:18Z")

</div>

Help me please.

I write

u32 wm\_apmCustomStack [65536];  
const u16 wm\_apmCustomStackSize = sizeof ( wm\_apmCustomStack );

## (We available 128Kb)

My modem(Fastrack) now constantly RESET and no react on my actions…

How leave thereof positions ??? ☹

---

<div class="post-metadata">

**Author:** ![jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jan](https://forum.sierrawireless.com/u/jan)\
**Post date:** [August 17, 2006, 12:18pm UTC](https://forum.sierrawireless.com/t/reset-modem/620/2 "2006-08-17T12:18:50Z")

</div>

Hi Alex,

This was something, wasn’t it… Two fatal errors in only two lines of code! You made the stack size twice as big as the RAM you have available and the stack size doesn’t even fit into a u16 anymore!

I guess at this point you can only reflash the core firmware by using the boot pin and DWLWIN. I’m not sure but I think the boot pin is accessible through the connector of the Fastrack?

You should contact your distributor to get the DWLWin Tool and the firmware. I think you should be able to get those, if not you will need to send in the modem for repair…

Best Regards,  
Jan

---

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://forum.sierrawireless.com/u/Alex)\
**Post date:** [August 18, 2006, 7:20am UTC](https://forum.sierrawireless.com/t/reset-modem/620/3 "2006-08-18T07:20:14Z")

</div>

Thank you.  
But why we available u16 - size RAM ?

In documentation is written - 128 Kb ? ☹

---

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://forum.sierrawireless.com/u/Alex)\
**Post date:** [August 18, 2006, 7:20am UTC](https://forum.sierrawireless.com/t/reset-modem/620/4 "2006-08-18T07:20:56Z")

</div>

Thank you.  
But why we available u16 - size RAM ?

In documentation is written - 128 Kb ? ☹

---

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://forum.sierrawireless.com/u/Alex)\
**Post date:** [August 18, 2006, 7:24am UTC](https://forum.sierrawireless.com/t/reset-modem/620/5 "2006-08-18T07:24:54Z")

</div>

Thank you.  
But why we available u16 - size RAM ?

In documentation is written - 128 Kb ? ☹

---

<div class="post-metadata">

**Author:** ![jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jan](https://forum.sierrawireless.com/u/jan)\
**Post date:** [August 18, 2006, 7:26am UTC](https://forum.sierrawireless.com/t/reset-modem/620/6 "2006-08-18T07:26:13Z")

</div>

Hi Alex,

The stack size should be usually a lot smaller than the RAM size, so they probably figured a 64k Stack on an embedded system is quite large ❓❓❓

( We have a pretty big application and we only use u32 wm\_apmCustomStack[640]…  
—edited— this application does not use TCP/IP 😉 )

Best Regards,  
Jan

---

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://forum.sierrawireless.com/u/Alex)\
**Post date:** [August 18, 2006, 7:55am UTC](https://forum.sierrawireless.com/t/reset-modem/620/7 "2006-08-18T07:55:48Z")

</div>

Thank you.  
But why we available u16 - size RAM ?

In documentation is written - 128 Kb ? ☹

---

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://forum.sierrawireless.com/u/Alex)\
**Post date:** [August 18, 2006, 8:37am UTC](https://forum.sierrawireless.com/t/reset-modem/620/8 "2006-08-18T08:37:16Z")

</div>

hi Jan.  
I use

ed\_SocketTCPStart( ( TeDHandle )ED\_ID\_TCPSOCKET\_1, ( u8 )0, ( ed\_ResponseCbk\_f )TCP\_Response, ( ed\_DataHandler\_f )TCP\_DataHandler, ( ed\_DataRequest\_f)TCP\_Data\_Request );

So  
in u16 TCP\_DataHandler(u16 DataLen, u8 \* Data, TeDHandle Id) - hframeter (u8 \* Data)

if enlarge (u32 wm\_apmCustomStack [4096]😉 then volum (u8 \* Data)

become more, it true???

---

<div class="post-metadata">

**Author:** ![jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jan](https://forum.sierrawireless.com/u/jan)\
**Post date:** [August 18, 2006, 9:16am UTC](https://forum.sierrawireless.com/t/reset-modem/620/9 "2006-08-18T09:16:29Z")

</div>

Hi Alex,

I don’t quite understand the question… Are you asking if you can put more data into a pointer with a bigger stack size?

If this is your question, the answer is no. Since this is only a pointer to an array of characters, you’ll have exactly so much memory as was specified at allocation time of the variable to which the pointer is passed in the function call… This does not depend on the stack size. (It will be still the array size if you passed a pointer to a global (or static) variable, or still the same size as you specify for example in an wm\_osGetHeapMemory() call (or whatever the equivalent in ADL is…) )

You would have more room for loacal variables in a function, yes, but it is probably not good practice and it will not work with the TCP/IP functions to use local variables since the data must be still available after you called a send data function - this most likely will not be the case for local variables! Considering you will exit the handler function which contains the send data call, so local variables get undefined, removed or even overwritten in the stack - and then you’ll transmit garbage instead of your data…

Best Regards,  
Jan

---

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://forum.sierrawireless.com/u/Alex)\
**Post date:** [August 18, 2006, 10:21am UTC](https://forum.sierrawireless.com/t/reset-modem/620/10 "2006-08-18T10:21:39Z")

</div>

Hi Jan.  
When I receive data in u16 TCP\_DataHandler(u16 DataLen, u8 \* Data, TeDHandle Id) and u32 wm\_apmCustomStack [265]; then modem reset!!!  
As soon as I has done— u32 wm\_apmCustomStack [4096]; then  
modem not reset!!!  
Why ???

Tell me please I may use u32 wm\_apmCustomStack [32768] (32Kb) ??? or may modem will begin be rebooted?

---

<div class="post-metadata">

**Author:** ![jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jan](https://forum.sierrawireless.com/u/jan)\
**Post date:** [August 18, 2006, 10:33am UTC](https://forum.sierrawireless.com/t/reset-modem/620/11 "2006-08-18T10:33:40Z")

</div>

Hi Alex,

u32 wm\_apmCustomStack [32768] is not 32kB of memory… it is 32kB\*4 = 128kB (since 1 u32 is 4 Byte…) - so even with this you’ll fill up the whole RAM with the stack, so I would assume that the modem will reset…

Best Regards,  
Jan

---

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://forum.sierrawireless.com/u/Alex)\
**Post date:** [August 18, 2006, 10:35am UTC](https://forum.sierrawireless.com/t/reset-modem/620/12 "2006-08-18T10:35:37Z")

</div>

Hi Jan.

If possible, send me please you ISQ UIN in my E-mail : [Shudiv@yandex.ru](mailto:Shudiv@yandex.ru).

---

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://forum.sierrawireless.com/u/Alex)\
**Post date:** [August 18, 2006, 10:42am UTC](https://forum.sierrawireless.com/t/reset-modem/620/13 "2006-08-18T10:42:11Z")

</div>

Thanks Jan, I there was not attentive ☹

indeed u32 = 4 byte , I’m sorry Jan ☹
