Closed Lauszus closed 11 years ago
I also added support for the Balanduino: http://balanduino.net/. It uses the ATmega1284P. Also please tell me if you want me to send you the "serialtest.balanduino.hex" ;)
I will add something like this: https://github.com/TKJElectronics/BalanduinoAndroidApp/blob/ce14dd02327acc125d70e901945566c8900ed666/src_usb/Upload.java#L37-L80 to the library as well, so it won't try to open the connection if it hasn't got permission yet. I believe it would be best to add it to AutoCommunicator: https://github.com/Lauszus/PhysicaloidLibrary/blob/master/PhysicaloidLibrary/src/com/physicaloid/lib/framework/AutoCommunicator.java.
Also I get an "Illegal .hex file." when trying to upload a large .hex file. I will try to fix that as well.
I will add something like this: https://github.com/TKJElectronics/BalanduinoAndroidApp/blob/ce14dd02327acc125d70e901945566c8900ed666/src_usb/Upload.java#L37-L80 to the library as well, so it won't try to open the connection if it hasn't got permission yet. I believe it would be best to add it to AutoCommunicator: https://github.com/Lauszus/PhysicaloidLibrary/blob/master/PhysicaloidLibrary/src/com/physicaloid/lib/framework/AutoCommunicator.java.
It's good idea. I check permission here https://github.com/ksksue/PhysicaloidLibrary/blob/master/PhysicaloidLibrary/src/com/physicaloid/lib/usb/UsbAccessor.java#L79-92 but it doesn't have a broadcast.
So my code tap upload->dialog "USB Permission?"->yes->do nothing->tap upload-> upload your code tap upload->dialog"USB Permission?"->yes->upload Right?
I think it's good that there are onPermissionAllowed/onPermissionDenied callback methods. User can write re-upload or just re-open.
Yes that is right. Mine will ask for permission if it hasn't got it already and then wait until the user allows it. Okay I will implement those callbacks then :)
I can't figure out why my .hex file for my code for my robot: https://github.com/TKJElectronics/Balanduino/tree/master/Firmware/Balanduino doesn't work. I have tried both compiling it using the Arduino IDE and a Makefile I have, but both of them simply just returns: "Illegal .hex file.".
I looks like it is triggered every time the size get's over 16 bits (65536). There must be a 16 bits variable somewhere that needs to be 32 bits instead.
I'm still getting "java.lang.Exception: EXT_SEG record not implemented", so it's failing here: https://github.com/ksksue/PhysicaloidLibrary/blob/master/PhysicaloidLibrary/src/cz/jaybee/intelhex/IntelHexParser.java#L146. Do you know how to fix this?
I thought I could solve it by increasing this value: https://github.com/ksksue/PhysicaloidLibrary/blob/master/PhysicaloidLibrary/src/com/physicaloid/lib/programmer/avr/IntelHexFileToBuf.java#L61, but that doesn't work.
I looks like I need to implement "Extended Segment Address Record" - source: http://en.wikipedia.org/wiki/Intel_HEX.
I found this C++ file that might help: https://github.com/codinghead/Intel-HEX-Class/blob/master/intelhex_class/intelhexclass.cpp#L510
I believe I got it working by adding:
case EXT_SEG:
if (record.length == 2) {
upperAddress = ((record.data[0] & 0xFF) << 8) + (record.data[1] & 0xFF);
upperAddress <<= 4; // ESA is bits 4-19 of the segment base address (SBA), so shift left 4 bits
} else {
throw new Exception("Invalid EXT_SEG record (" + recordIdx + ")");
}
break;
But I will have to test to see if there are any problems with it.
Create build.gradle in root of project, so the entire project can be build at once.