SPI problem on EHS5 | Thales IoT Developer Community
September 19, 2016 - 8:34am, 6849 views
I have a problem with SPI port on EHS engine REVISION 03.001, A-REVISION 00.000.14.
Initially I tried to open SPI port from Java midlet, but the code:
SpiConnection spiConnection = (SpiConnection)Connector.open("SPI:0;baudrate=100;clockMode=0");
thrown an javax.microedition.io.ConnectionNotFoundException, then I tried to use AT commands without any running midlet. First of all, I configured the port:
but I received a "+CME ERROR: Unknown" to all these commands:
Can you help me? Is there a wrong step in my procedure? The same commands works perfectly with BGS5 engine.
Thank you in advance.
I think the issue can't depend on the other SPI device: the connection must be always available, also without connected device. The SPI port can't detect the presence of slaves only with the connection procedure, therefore the exception can't be related to slave's presence.
As you have written before the SPI is working while you are using AT commands instead of Java. So the problem is rather not connected with SPI device.
What you do in your MIDlet is that you open COM0 interface before opening SPI. Maybe this have something to do with the problem because there is one common line shared between SPI and COM0 - DSR0. I have tried your scenario with my hardware but in my case both interfaces were open without exceptions.
Please try to open SPI only in your MIDlet to check if it makes any difference. please also make sure that you close all connections and release resources each time because if not it could also cause problems during next connection attempt.
I have tried a MIDlet with only SPI code, no COM0 initialization, but this didn't solve the problem. Wich firmware revision are you using? Can you try with REVISION 03.001, A-REVISION 00.000.14? Unfortunately this issue is blocking our hardware design, since we must to be sure before take a decision.
Is it possible to have last firmware release, in order to update our devices under development?
Thanks in advance.
I've also tried with A-REVISION 00.000.14.
I think that we might have missed one important detail - you have written that you tried with upper and lower case "spi" and you have pasted the line of code with lower case which I pasted to my code and it was working. But I've missed that in the code you have pasted later there is upper case "SPI" - and this parameter is case sensitive and it should be lower case as it is in the examples in API. Please check it again.
If it is not the case here - we should check again if it's working with AT commands and if not, verify the hardware connections.
The issue was related to missing "Oracle-MIDlet-Autostart: 2"; after this modification I left upper case "SPI". Now I've changed to lower case "spi" and the connection works without exceptions.
Thank you, your help has been very useful.