I would like to run MyMite on a dsPIC33 on this cheap open hardware
board: http://dangerousprototypes.com/2009/12/11/prototype-web-platform/
I checked out the issue_0066_bjones_pic24port branch, opened the
p14p.mcw in MPLAB, but several files seem to be missing in the project
tree:
* main_img.c
* main_nat.c
* pic24_times.c
* pic24_delay.h
* pic24_ports.h
When I try to build the project, I get the following error output:
----------------------------------------------------------------------
Debug build of project `C:\Dokumente und
Einstellungen\Markus\Desktop\pymite\src\platform\pic24\p14p.mcp'
started.
Language tool versions: pic30-as.exe v3.23, pic30-gcc.exe v3.23,
pic30-ld.exe v3.23, pic30-ar.exe v3.23
Preprocessor symbol `__DEBUG' is defined.
Mon Feb 22 21:33:34 2010
----------------------------------------------------------------------
Executing: make -C
/cygdrive/c/Users/bjones/Documents/svns/python-on-a-chip_pic24/src/platform/pic24
bytecode
Could not spawn language tool. Check command-line options. (2)
Make: The target "C:\Dokumente und
Einstellungen\Markus\Desktop\pymite\src\platform\pic24\main.o" is out
of date.
Executing: "C:\Programme\Microchip\MPLAB C30\bin\pic30-gcc.exe"
-mcpu=24HJ64GP502 -x c -c "main.c" -o"main.o" -I"." -I"..\..\vm"
-I"include" -D__DEBUG -Wall -D__DEBUG__ -DSIM -O1
Error: File "C:\Dokumente und
Einstellungen\Markus\Desktop\pymite\src\platform\pic24\main_img.c" not
found.
Error: File "C:\Dokumente und
Einstellungen\Markus\Desktop\pymite\src\platform\pic24\main_nat.c" not
found.
Make: The target "C:\Dokumente und
Einstellungen\Markus\Desktop\pymite\src\platform\pic24\plat.o" is out
of date.
Executing: "C:\Programme\Microchip\MPLAB C30\bin\pic30-gcc.exe"
-mcpu=24HJ64GP502 -x c -c "plat.c" -o"plat.o" -I"." -I"..\..\vm"
-I"include" -D__DEBUG -Wall -D__DEBUG__ -DSIM -O1
In file included from plat.c:26:
./include/pic24_all.h:60:28: error: pic24_unittest.h: No such file or directory
./include/pic24_all.h:62:25: error: pic24_delay.h: No such file or directory
./include/pic24_all.h:63:25: error: pic24_ports.h: No such file or directory
In file included from ./include/pic24_all.h:67,
from plat.c:26:
./include/pic24_serial.h:91:2: error: #error Invalid choice of DEFAULT_UART
In file included from ./include/pic24_all.h:68,
from plat.c:26:
./include/pic24_util.h:829:2: warning: #warning
***********************************************
./include/pic24_util.h:830:2: warning: #warning * SIMULATION MODE - DO
NOT RUN ON A REAL PIC! *
./include/pic24_util.h:831:2: warning: #warning
***********************************************
In file included from plat.c:26:
./include/pic24_all.h:71:25: error: pic24_timer.h: No such file or directory
./include/pic24_all.h:72:23: error: pic24_i2c.h: No such file or directory
./include/pic24_all.h:73:23: error: pic24_spi.h: No such file or directory
./include/pic24_all.h:74:23: error: pic24_adc.h: No such file or directory
./include/pic24_all.h:75:23: error: pic24_dma.h: No such file or directory
./include/pic24_all.h:76:24: error: pic24_ecan.h: No such file or directory
./include/pic24_all.h:77:25: error: pic24_flash.h: No such file or directory
./include/pic24_all.h:78:30: error: pic24_comparator.h: No such file
or directory
plat.c: In function 'configTimer2':
plat.c:46: error: 'T2_OFF' undeclared (first use in this function)
plat.c:46: error: (Each undeclared identifier is reported only once
plat.c:46: error: for each function it appears in.)
plat.c:46: error: 'T2_IDLE_CON' undeclared (first use in this function)
plat.c:47: error: 'T2_GATE_OFF' undeclared (first use in this function)
plat.c:48: error: 'T2_32BIT_MODE_OFF' undeclared (first use in this function)
plat.c:49: error: 'T2_SOURCE_INT' undeclared (first use in this function)
plat.c:49: error: 'T2_PS_1_1' undeclared (first use in this function)
plat.c:51: warning: implicit declaration of function 'msToU16Ticks'
plat.c:51: warning: implicit declaration of function 'getTimerPrescale'
plat.c: In function 'plat_getByte':
plat.c:123: warning: implicit declaration of function 'isCharReady1'
plat.c: In function 'plat_putByte':
plat.c:144: warning: implicit declaration of function 'outChar1'
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\Dokumente und
Einstellungen\Markus\Desktop\pymite\src\platform\pic24\p14p.mcp'
failed.
Language tool versions: pic30-as.exe v3.23, pic30-gcc.exe v3.23,
pic30-ld.exe v3.23, pic30-ar.exe v3.23
Preprocessor symbol `__DEBUG' is defined.
Mon Feb 22 21:33:36 2010
----------------------------------------------------------------------
BUILD FAILED
Kind regards,
Markus
--
You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
Site: http://groups.google.com/group/python-on-a-chip
after svn updating I got the following error:
mgroovy:/cygdrive/c/Users/mgr/Desktop/PyMite/issue_0066/src/platform/pic24$
make
pic30-gcc.exe -mcpu=24HJ64GP502 -Wall -O1
-Wdeclaration-after-statement -I../../vm -D__PIC24HJ64GP502__
-Ic:/Users/mgr/Desktop/PyMite/issue_0066/src/platform/pic24
-Ic:/Users/mgr/Desktop/PyMite/issue_0066/src/platform/pic24/include
-c -o main.o main.c
pic30-gcc.exe -mcpu=24HJ64GP502 -Wall -O1
-Wdeclaration-after-statement -I../../vm -D__PIC24HJ64GP502__
-Ic:/Users/mgr/Desktop/PyMite/issue_0066/src/platform/pic24
-Ic:/Users/mgr/Desktop/PyMite/issue_0066/src/platform/pic24/include
-c -o plat.o plat.c
../../tools/pmImgCreator.py -c -u -o main_img.c --native-file=main_nat.c main.py
Traceback (most recent call last):
File "../../tools/pmImgCreator.py", line 934, in <module>
main()
File "../../tools/pmImgCreator.py", line 928, in main
pic.convert_files()
File "../../tools/pmImgCreator.py", line 317, in convert_files
co = compile(open(fn).read(), fn, 'exec')
File "main.py", line 22
def init():
^
SyntaxError: invalid syntax
make: *** [main_nat.c] Error 1
This was caused by inconsistent line-ending characters in main.py. I
manually converted them to be all LF and now it compiles. Some other
files I looked at (e.g. Makefile, README) also have inconsistent line
ending characters, so maybe this should be fixed for all files in the
tree.
I will report back when I receive my ordered Web Platform board if I
got it working on the silicon :)
One question: RAM usage of 7.7 kB is quite high. Not much left on a
device with 8 kB. What takes up all this space, and would it be
possible to make some of this date const so that it gets placed in the
auto_psv area?
A final remark: In the README file you mention "Bully Bootloader".
From the website it seems not being updated for quite some time. The
Web Platform uses "ds30 Loader" which is actively being developed:
http://mrmackey.no-ip.org/elektronik/ds30loader/
Kind regards,
Markus
It's great to see someone trying the new PIC port. Thanks for helping
out and providing feedback.
Usually the biggest RAM consumer is the number of libraries and
functions that are included. Look through the standard libraries and
platform libraries and remove the ones from the build that you don't
need.
!!Dean
Kind regards,
Markus
--
You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
Site: http://groups.google.com/group/python-on-a-chip
Still inconsistent line endings:
mgroovy:/cygdrive/c/Users/mgr/Desktop/PyMite/issue_0066/src/platform/pic24$ make
../../tools/pmImgCreator.py -c -u -o main_img.c --native-file=main_nat.c main.py
Traceback (most recent call last):
File "../../tools/pmImgCreator.py", line 934, in <module>
main()
File "../../tools/pmImgCreator.py", line 928, in main
pic.convert_files()
File "../../tools/pmImgCreator.py", line 317, in convert_files
co = compile(open(fn).read(), fn, 'exec')
File "main.py", line 104
^
SyntaxError: invalid syntax
make: *** [main_nat.c] Error 1
> On the bootloader, thanks for taking a look. I'm a co-author and update it
> regularly. However, I've obviously forgotten to update the web page cited
> with the latest features. I'll do that. One nice thing about this bootloader
> is the ability to use it both as a simple terminal program to communicate
> with the PIC and as a bootloader, rather than switching between two
> applications.
I see. I agree that one rather uses the own software :) Just for
completeness: ds30 Loader also has an integrated terminal. Activating
'Advanced mode' in the 'View' menu displays some additional tabs, one
of them being the 'Terminal'.
Kind regards,
Markus
Kind regards,
Markus
--
You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
Site: http://groups.google.com/group/python-on-a-chip
Now it compiles out of the box :) The MPLAB simulator shows the
following output in the SIM Uart1 tab:
Reset cause: Power-on.
**** SIMULATION MODE: cannot read device and revision ID ****
Fast RC Osc
plat.c, built on Feb 23 2010 at 21:42:01
Python initialized.
Welcome to PIC24 Python! Free space: (4130, 7000)
Starting interactive mode.
Is it also possible to send characters to the simulated UART?
Kind regards,
Markus
Kind regards,
Markus
--
You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
Site: http://groups.google.com/group/python-on-a-chip
main.py uses both, spaces and tabs for indentation, which should of
course be avoided. Your editor seems to use a tab as 4 spaces, which
gives bad indentation in my editor which assumes one tab being 8
spaces.
All tab indentation should be converted to 4 spaces.
Kind regards,
Markus
Kind regards,
Markus
--
You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
Site: http://groups.google.com/group/python-on-a-chip
the source files in your branch contain mixed line ending characters.
The majority is using LF, but I assume the lines inserted with MPLAB
end in CR + LF. Maybe you can run a script before checking in, which
converts all line endings so LF. (We already resolved this issue for
main.py.)
Kind regards,
Markus
Kind regards,
Markus
--
You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
Site: http://groups.google.com/group/python-on-a-chip
Kind regards,
Markus
--
You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
Site: http://groups.google.com/group/python-on-a-chip
Looking forward to any advice or insight concerning the Web Platform
UART communication issue.
Markus
--
You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
Site: http://groups.google.com/group/python-on-a-chip
To unsubscribe from this group, send email to python-on-a-chip+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.