--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.
Is that really the minimum required, in the sense that anything you'd remove would make the problem disappear? Also some things are missing, e.g. where the response buffer being defined and why are you comfortable sharing it across asynchronous calls.
When an Android app crashes, an error message an stack trace gets written to the log. What's in your log?
Also, in order to wait for completion just call writeRead() instead of Async(). Another option is using the object returned from Async() to await completion.
public class dataRecCountDownTimer extends CountDownTimer {
public dataRecCountDownTimer(long startTime, long interval) {
super(startTime, interval);
}
@Override
public void onTick(long millisUntilFinished) {
try {
read_ack = twi.writeReadAsync(addressDSP3, false, RB,
RB.length, response,
response.length);
} catch (ConnectionLostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void onFinish() {
if(read_ack.equals(1))
{
try {
twi.writeReadAsync(addressDSP1, false, stim_off,
stim_off.length, null, 0);
} catch (ConnectionLostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
iWrite("Stim stopped");
}
}
}
public class dataRecCountDownTimer extends CountDownTimer {
public dataRecCountDownTimer(long startTime, long interval) {
super(startTime, interval);
}
@Override
public void onTick(long millisUntilFinished) {
try {
read_ack = twi.writeRead(addressDSP3, false, RB, RB.length, response,
response.length);
} catch (ConnectionLostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void onFinish() {
if(read_ack == true)
{
try {
twi.writeRead(addressDSP1, false, stim_off,
stim_off.length, null, 0);
} catch (ConnectionLostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
iWrite("Stim stopped");
}
}
}
public void onFinish() {
iWrite("Read ack? :" + read_ack_bool);
try {
read_ack = twi.writeReadAsync(addressDSP1, false, stim_off,
stim_off.length, null, 0);
read_ack_bool = read_ack.waitReady();
iWrite("Read ack? :" + read_ack_bool);
--
You received this message because you are subscribed to a topic in the Google Groups "ioio-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ioio-users/1eSftDUOSvo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.
As it is, no LEDs light up and I don't see anything in the logging, no "***** Hello from app-layer! *******", nothing... Even my bluetooth dongle doesn't seem to light up anymore.
I did configure everything to suit my hardware (PIC24FJ256DA206) and then also changed the pins for my UART according to what I had working in my previous firmware, and changed few pins for LEDs. I also configured the ENABLE_LOGGING in the pic30-gcc preprocessor macros.
libusb, libconn, libbtstack, libadb, Bootloader and AppLayerV1 all build without errors.
There are too many things that can go wrong in your setup: custom IOIO, custom forward with changes that are very likely to break stuff and a fair amount of complexity in your app.
I recommend that you start by eliminating some possible causes (e.g. test your app on a stock IOIO with stock firmware or run a rigorous test on your custom hardware/firmware, such as the IOIO torture test.
Otherwise you'd be wasting our time.
--
Okay, I will try to ask more specific questions. I also saw that a similar problem was reported here: Maximum TWI transaction size . This might be related?Questions:1. I cannot find the files for for previous versions of the Firmware. I downloaded all the files contained in the GitHub. I would like to take a look at the files of Firmware version IOIO0326 to compare them with my slightly modified versions to see the differences. Especially the i2c.c/.h and the protocol.c/.h. Is there a way to find such files somewhere else?
2. The problem I have seems to be related to latency or drops of bytes (because of a full buffer?). Which lead to disconnection of the PIC IOIO and freezing my App. I am able to receive the first few bytes and then after a few writeRead() the PIC sends a AppProtocolSendMessageWithVarArgSplit then the Android App freezes. Obviously, now I get writeRead acknowledges for the correct reads, when it drops I don't get the aknowledge. This AppProtocolSendMessageWithVarArgSplit seems to occur because of a latency problem which provokes a lost of bytes (0 bytes at beginning and 183 bytes at the end? when I am supposed to have 4 bytes , see screenshot attached). Please note that psd_buff_ptr contains the value I'm reading (in my UART logging) and I am able to see this value appear in my LogCat sometimes or partly see attached LogCat excerpt.I tried increasing Interrupt Priority level from 4 to 2, as you did in the change from V3.x to V5.x of the Firmware. Then my Device seems to bootup faster because of all my i2c calls which now have higher priority, but my latency or dropout problem still occurs. As soon as I get the drop and then reboot my App, my Device also reboots to reconnect with the App. Please find my versions of i2c and protocol.c attached (based on V3.x), I think the problem would mainly be there. Again I did compare these files with the V5.x version and didn't see major changes other than optimization of some functions like atomic16 and AssignMI2CxIF. The problem occurs no matter if I use twi.writeRead() or twi.writeReadAsync().Maybe I need a better explanation of how to use twi.writeRead() and twi.writeReadAsync()?
Also explanation on the use of buffers RX_BUF_SIZE in i2c.c and DEFINE_STATIC_BYTE_QUEUE in protocol.c could help me? Would it be useful to clear these buffers after a few reads?
I included an excerpt of the problematic code section of my Android App in attachment. If I take out the writeRead() call everything is fine since the i2c would not be used.
3. I am starting to think that it could be the reading of the DSP register that could cause the latency and crash the connection? According to the 0 bytes received in the logging...What do you think?
I am deeply sorry if all my messages bother you. I am simply doing my best to find the problem and solve it.
case STATE_STOP_WRITE_ONLY:
if (reg->stat >> 15) { goto error; }
if(bootup==0)
ByteQueuePushByte(&i2c->rx_queue, 0x00);
goto done;