Developments of a Large-Spin-Code into GCC under PropC3
nomad
Posts: 276
hi,
in the moment i working on a Quadcopter with 2 Propeller-Boards:
- 1) PropC3: (with spin)
- LaserRangeFinder
- GPS
- XBEE (1 Module) send Datas to my Laptop
- Intercom (Master) send Datas to PPB
- ev. SD-Card
verry problematic to run not standAllone
Under Spin the stuff running and its ok
- 2) PPB: (with spin)
- RC-6-channel-receiver-interface
- L3G4200D 3-axis gyroscope
- PID-controller
- ESC-output (brushless-ESC) 4 channel
- Intercom (slave) receive datas from C3
under spin the stuff running and its ok
as attachment: c3-quadV2-GXB-05.spin
i have experience with low-level programming with GCC under Linux
(Simple IDE 0.72 or 0.85 unter win7)
now my questions:
- on the C3-board: can i converting this spin-file into GCC ??
- or have this idea no go's ??
- i think the XBEE-Module make some Problems ??
why i do this:
- ev. better performance
- learning
thanks for tips and hints
regards
nomad
in the moment i working on a Quadcopter with 2 Propeller-Boards:
- 1) PropC3: (with spin)
- LaserRangeFinder
- GPS
- XBEE (1 Module) send Datas to my Laptop
- Intercom (Master) send Datas to PPB
- ev. SD-Card
verry problematic to run not standAllone
Under Spin the stuff running and its ok
- 2) PPB: (with spin)
- RC-6-channel-receiver-interface
- L3G4200D 3-axis gyroscope
- PID-controller
- ESC-output (brushless-ESC) 4 channel
- Intercom (slave) receive datas from C3
under spin the stuff running and its ok
as attachment: c3-quadV2-GXB-05.spin
i have experience with low-level programming with GCC under Linux
(Simple IDE 0.72 or 0.85 unter win7)
now my questions:
- on the C3-board: can i converting this spin-file into GCC ??
- or have this idea no go's ??
- i think the XBEE-Module make some Problems ??
why i do this:
- ev. better performance
- learning
thanks for tips and hints
regards
nomad
Comments
As a learning process, sure, I would highly recommend it. Just a suggestion though, start out small, in fact, just try to convert one of your module drivers to C first.
Ray
thanks for your answer.
on Sunday i have make some experiments with spin2cpp-Version 0.100
gcc-elf is in the SimpleIDE-Version 0.72
on the powershell i make the convert-step with
- 1) .\spin2cpp --elf -Os -mxmmc c3-quadV2-GXB-05.spin
- compile with warnings:
- on GPS_Str_NMEA_Lite.cpp
- warnings:
cast to pointer from integer of different size[-Wint-to-pointer-cast]
- in the prog its:
- memcpy( (void *)&(*(uint8_t *)&dat[20]), (void *)C0, 1*(C1));
- run ok with a.out all *.cpp and *.h - files ok
- 2) then a second step:
- loading a.out to PropC3 with usb-Connections with
- propeller-load.exe with
- propeller-load -r -t a.out -b eeprom
- output on power-shell:
- Propeller Version 1 on COM5
Loading the serial helper to hub memory
9528 bytes send
Verifying RAM... OK
Loading cache driver 'eeprom_cache.dat'
1532 bytes sent
loading program image to flash
22464 bytes sent
Loading .xmmkernel
1720 bytes sent
[ Entering terminal mode. Type ESC or Control-C to exit. ]
ading GPS...r LRF module ... (icon) ady!
- this output comes from my program
- with ESC terminate the programm
i think for a first experiment, this are good results ???
a dumb question:
the last output make me not so happy
on the c3 gps-Led blink, but the Laser Range Finder - this is "ady" above should be "Ready"
i think that the program hanging
what are the next step after propload ok to start my program on the C3
i think the program is on the EEPROM, should i make a restart or what shoulld i do
after this, i starting with the PropTool
-> clearEEPROM.spin then; compile my spin-programm and run on RAM the stuff
-> all stuff running.
have you some hints and tricks for me....
regards nomad
Eric
thanks for your answer.
today i make some experiments with your tips
thanks and regards
nomad
i make some Tests with following optimizations
1) : -O1:
.\spin2cpp --elf -O1 -mxmmc c3-quadV2-GXB-05.spin
- 1) compile:
- the same warning on GPS_String_NMEA_Lite.cpp
- a.out is here
- 2) loading:
- propeller-load -r -t a.out -b eeprom
- propeller Version 1 on COM5
Loading the serial helper to hub memory
9528 bytes sent
Verifying RAM ... OK
loading cache driver 'eeprom_cache.dat'
1532 bytes sent
Loading program image to flash
27544 bytes sent
Loading .xmmkernel
1720 bytes sent
[ Entering terminal mode. Type ESC or Control-C to exit. ]
- program output:
Reading GPS...r LRF-module...:) (icon) (icon) Ready!
- hardware results:
- LaserRangeFinder (Laser) not blinking
- terminate with ESC OK
2) : -O:
.\spin2cpp --elf -O -mxmmc c3-quadV2-GXB-05.spin
- 1) compile with the warnings
- 2) propeller-load -r -t a.out -b eeprom
- output from program
Reading GPS...r LRF module...:):) (icons)Ready!
- Terminate with ESC OK
- but the programm hanging i think so..
i think the propeller-load make troubles ?
eventuell wrong -r -t -b ??
what you are thinking about this failure....
now i make some research for spin2cpp and prop-load....
regards
nomad
today i make some experiments with spin2cpp and prop-loader:
after some improvements:
1) changing the spin-code: works only with LaserRangeFinder + Intercom.
look at c3-quadV2-GXB-051.spin
2) spin2cpp: compiling without Opimizations: aka
.\spin2cpp --elf -mxmmc c3-QuadV2-GXB-051.spin
- no failure : a.out vorhanden
- loading:
- propeller-load -r -t a.out -b eeprom
- Results:
- Run Program verry ok
- some icons, datas correct, laser ok, ESC OK
- access with pst-terminal ok
- look at c3-noO-LoadOK-0602-2.jpg
3) about the icons:
i think its a failure of the powerShell
and pst.terminal = pst.Position(n,n)
i think its good-stuff
attachments:
- c3-quadV2-GXB-051.spin
- c3-noO-LoadOK-0602-2.jpg
what are thinking about this and
thanks for your help
regards
nomad
Eric
thanks for your answers )
@ eric:
Thank you, today i work with your [-t....]
about the results i make a new reply.
@David Betz:
i make now some experiments...
thanks all
regards
nomad
thanks for this tip.
my results proploader: propeller-load -r a.out -b eeprom:
- 1) propload with new (eric) without -t
as: propeller-load -r a.out -b eeprom
- Load-OK
then starting pst.terminal com5, 115_200 baud
- results: Verry OK
- no failure
- ok
- 2) experiments david Betz
- starting ide 0.72 terminal emulations
- starting ide (starting terminal-emulations on ide:)
com 5 baud 115_200
- terminal-output : OK
- some cryptical icons on every loop
- hardware are running ok
please have a look on attachment: propLoad-ide-terminal-1.jpg
today i make some experiments with all my devices (gps,XBEE)
regards nomad
https://code.google.com/p/propside/downloads/detail?name=Simple-IDE_0-8-5_setup.zip
Since you are using windows, the Parallax PST may fit your needs:
http://www.parallax.com/Portals/0/Downloads/sw/propeller/Parallax-Serial-Terminal.zip
thanks but i have
1) SimpleIDE 0.85, 0.72 (0.72 is running)
2) the propeller-gcc-elf package
3) pst-terminal
thanks for the hints
regards nomad