Reset modem

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 ??? :frowning:

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

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

In documentation is written - 128 Kb ? :frowning:

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

In documentation is written - 128 Kb ? :frowning:

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

In documentation is written - 128 Kb ? :frowning:

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 :question: :question: :question:

( We have a pretty big application and we only use u32 wm_apmCustomStack[640]…
—edited— this application does not use TCP/IP :wink: )

Best Regards,
Jan

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

In documentation is written - 128 Kb ? :frowning:

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 ]:wink: then volum (u8 * Data)

become more, it true???

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

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?

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

Hi Jan.

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

Thanks Jan, I there was not attentive :frowning:

indeed u32 = 4 byte , I’m sorry Jan :frowning: