I have been trying to port my app from Fastrack Supreme (with 7.4.0.00) to the new Fastrack Xtend (7.4.0.a) and have experienced serious difficulties with configuring UART settings on both UARTs.
Basically I am trying to set UART2 to 9600, 8E1 and am getting 9600, 8N1 instead (the required Even parity parameter is not getting set). The same happens when I try to set UART1. Manually setting either UART from the command line seems to work OK.
I can reproduce the problem on my original Fastrack Supreme if I ‘upgrade’ it to 7.4.0.a. I’ve also tried upgrading to 7.43.0 but the problem persists. Restoring to 7.4.0.00 fixes everything.
So its not the new modem, its something to do with 7.4.0.a (and above) or with the way I am using it.
I am using M2M 1.1.1 and have been especially careful to create a new project using apropriate settings each time, but to no avail.
I’ve tried delaying serial config a few seconds until after the modem has initialised, but this does not make any difference.
If it helps, I have managed to condense the problem down to its smallest form using the hello_world sample. But I don’t know how to include code samples on the forum - If I use the Code button and put a code snippet between the two markers and hit the preview button the page seems to seize up and after several seconds it just times out.
Apologies for presentation, but here are the three key lines, lifted directly from my modified hello world prog.
Interestingly if I change the order around (eg set the parity first) then its the baud rate that seems to get missed (stays at default). Its almost like the first AT command works OK, but the two subsequent ones aren’t handled correctly. Even though all three result codes are OK.
Interesting. Now I did try adding response handlers but had trouble interpreting their results - am I looking for the OK/ERROR result ?
I know from documentation and examples how to get the result from a query command - add a null-terminated list of strings for the response to subscribe to (eg “+IPR” then NULL) and then to use wm_strGetParameterString to extract any returned values (eg parameter 1, the baud rate). But I’m not sure how to capture/interpret the OK/ERROR result from a configuration command.
Thanks I will have a look at that. I have seen the “*” thing before but haven’t used it, I’m always a bit uncomfy with undocumented stuff.
Meantime I have done some digging and discovered what I think might be some useful details. I’ve got rid of my FCM subscription and am now just using the IPR, ICF and IFC commands as above. This means that I can now go in with my Hyperterminal session and (with a bit of trial and error) easily deduce which of the three settings have taken and which have been ignored. The original hello world message is still in the sample and is broadcast on all open ports, and this provides a useful debug facility. With very interesting results.
It appears at first that only the first of the three commands is accepted. So if that first command is IPR=9600 then the baud rate will be set but the framing/flow control retain their default settings. If you swap things around and send ICF=2,1 as the first command, then the parity is set to even but the baud rate etc stays at 115200.
However, as soon as you enter any command on that port with hyperterminal, even just AT, all three settings take immediate effect. How amazing is that! Almost like the last two commands have been accepted but are stuck in a buffer/queue somewhere waiting for something to flush them out. Only the first one gets actioned properly.
I tried adding \r\n characters but that doesn’t work at all.
Adding a two second delay between the three commands makes no difference.
Ignoring the prog altogether and just typing in the config commands on either port works fine.