rzel / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Fix port to Arduino Mega #195

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The Arduino Mega port worked with an older version of avr-gcc, but not 4.3.3.  
The symptom (for me) is that ipm does not respond to input, times out, but does 
not print anything (not even the typical error message: "Connection write 
error, type Ctrl+D to quit."

Original issue reported on code.google.com by dwhall...@gmail.com on 16 Mar 2011 at 8:57

GoogleCodeExporter commented 9 years ago
Problem: The heap is not aligned to 4-byte boundary.  heap_init() detects this 
and exits with an error code.

Try: The following fix did not work, the heap was still only 2-byte aligned.

int main(void)
{
    uint8_t heap[HEAP_SIZE] __attribute__((aligned(4)));
...

Original comment by dwhall...@gmail.com on 16 Mar 2011 at 11:33

GoogleCodeExporter commented 9 years ago
- "Fixed" heap alignment by easing the alignment based on architecture bit 
size.  Now, arch's with a 16-bit pointer width only need to align to 2-byte 
boundaries.  
- Also had to reduce the heap size for the Arduino Mega platform; I guess 
avr-gcc 4.3.3 produces less-compact code.
- Added "VARIANT=2560" option to Makefile to allow build for Arduino Mega 2560

Original comment by dwhall...@gmail.com on 18 Mar 2011 at 8:47

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 46c0e3df818b.

Original comment by dwhall...@gmail.com on 18 Mar 2011 at 8:57

GoogleCodeExporter commented 9 years ago
It still is not working. I just cloned from svn and still having the same issue 
with Mega 2560
I can compile and upload the program but I can't interact with it using ipm. No 
error, no exceptions returned but only a delay then the prompt back.

Original comment by pen...@gmail.com on 12 Aug 2011 at 9:37

GoogleCodeExporter commented 9 years ago
I have heard the same thing from others, but forgot to do this paperwork.  
Thank you for the reminder; I've reopened this issue.  I still don't have an 
Arduino Mega 2560, so I can't fix this one myself.  My 'Mega is the 1280.

Original comment by dwhall...@gmail.com on 12 Aug 2011 at 11:57

GoogleCodeExporter commented 9 years ago
I just tried to compile with avr-gcc 3.4.6 without the VARIANT=2560 and upload 
the program using make program with VARIANT=2560 now ipm works for list, dict 
and print but doesn't work for anything involved with integers, so if I do a = 
[1] print a will not print stuff in the list but empty

if I do a= ['1'] print a however it will print the list ['1'] as it is. This is 
weird consider that the program wasn't compiled for 2560 but it works on 2560 
and ipm got the response I guess your makefile should be corrected for 2560. 
You should definitely buy one to test it out. Comeon, it doesn't cost too much 
for one right?

Original comment by pen...@gmail.com on 12 Aug 2011 at 1:48

GoogleCodeExporter commented 9 years ago
It is definitely an issue with the new compiler, right now if I compile with 
avr-gcc 4.3.3 without VARIANT=2560, ipm would not return anything as before on 
the 2560

Original comment by pen...@gmail.com on 13 Aug 2011 at 8:19

GoogleCodeExporter commented 9 years ago
Hi guys, I have one of these and am getting the same response (or no response 
as the case may be) from ipm. If anybody would like me to test a patch for them 
just let me know.

Original comment by carl.nob...@gmail.com on 14 Aug 2011 at 1:07