djmuhlestein / fx2lib Goto Github PK
View Code? Open in Web Editor NEWLibrary routines for creating firmware for the Cypress FX2 (CY7C68013 and variants) with SDCC
License: GNU Lesser General Public License v3.0
Library routines for creating firmware for the Cypress FX2 (CY7C68013 and variants) with SDCC
License: GNU Lesser General Public License v3.0
https://fx2lib.wiki.sourceforge.net/
is down.
I'm trying to add a configuration descriptor to a firmware. I belive this is not supported by lib/setupdat.c, as it always returns the descriptor at pDevConfig, which is either highspd_dscr or fullspd_dscr from dscr.a51 .
I've succeeded adding support for several descriptors, but I cannot figure of a backward-compatible way without involving several #ifdef as I require new exports from dscr.a51.
Please review my patch: vpelletier/fx2lib@f98866cc4bb88c0179d3f9c05c77fc2ebecfe2dc .
I'm unsure of intended coding style (indentation especially).
Build is failing with Arch Linux because of the newer version of SDCC (3.6.0-4)
make
for a in dscr.a51; do \
cp $a build/; \
cd build && sdas8051 -logs `basename $a` && cd ..; done
for s in bulkloop.c; do \
THISREL=$(basename `echo "$s" | sed -e 's/\.c$/\.rel/'`); \
sdcc -mmcs51 --code-size 0x3c00 --xram-size 0x0200 --xram-loc 0x3c00 -Wl"-b DSCR_AREA=0x3e00" -Wl"-b INT2JT=0x3f00" -c -I ../..//include -I "" $s -o build/$THISREL ; done
bulkloop.c:177: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
bulkloop.c:178: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
sdcc -mmcs51 --code-size 0x3c00 --xram-size 0x0200 --xram-loc 0x3c00 -Wl"-b DSCR_AREA=0x3e00" -Wl"-b INT2JT=0x3f00" -o build/bulkloop.ihx build/bulkloop.rel build/dscr.rel fx2.lib -L ../..//lib
make: *** [../../lib/fx2.mk:85: build/bulkloop.ihx] Error 1
Failing commands:
sdcc -mmcs51 --code-size 0x3c00 --xram-size 0x0200 --xram-loc 0x3c00 -Wl"-b DSCR_AREA=0x3e00" -Wl"-b INT2JT=0x3f00" -o build/bulkloop.ihx build/bulkloop.rel build/dscr.rel fx2.lib -L ../..//lib -V
+ /usr/bin/sdld -nf build/bulkloop.lk
+ /usr/bin/sdld -nf build/bulkloop.lk returned errorcode 139
/usr/bin/sdld -f build/bulkloop.lk
ASlink >> -f build/bulkloop.lk
ASlink >> -muwx
ASlink >> -i build/bulkloop.ihx
ASlink >> -M
ASlink >> -Y
ASlink >> -X 0x0200
ASlink >> -C 0x3c00
ASlink >> -b HOME = 0x0000
ASlink >> -b XSEG = 0x3c00
ASlink >> -b PSEG = 0x3c00
ASlink >> -b ISEG = 0x0000
ASlink >> -b BSEG = 0x0000
ASlink >> -b DSCR_AREA=0x3e00
ASlink >> -b INT2JT=0x3f00
ASlink >> -k ../..//lib
ASlink >> -k /usr/bin/../share/sdcc/lib/small
ASlink >> -k /usr/share/sdcc/lib/small
ASlink >> -l fx2.lib
[1] 21459 segmentation fault (core dumped) /usr/bin/sdld -f build/bulkloop.lk
If sdcc is downgraded to 3.6.0-3 the examples builds successfully:
downgrade sdcc
The official SDK has a DR_GetDescriptor() function that you can implement to handle HID descriptors, etc.
fx2lib currently requires modifying setupdat.[hc] to support HID.
Ideally there should be a way to hook into this without modifying the core library.
When I run this tool, I get an error:
$ python ihx2iic.py
File "/e/src/fx2lib/utils/ihx2iic.py", line 35
raise ValueError, "Length must be even"
I am not very good at Python, is it not compatible for python3?
If so how to fix it :)
I have problems build the examples with latest svn version of sdcc (built from source today). Tested under Ubuntu Linux 20.04 as well as Windows 10/11.
There are no issues if I build with sdcc 3.8 version from Ubuntu 20.04.
mcuee@UbuntuSwift3:~/build/8051/fx2lib$ sdcc -v
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502 TD- 4.2.14 #14088 (Linux)
published under GNU General Public License (GPL)
cuee@UbuntuSwift3:~/build/8051/fx2lib$ make -i
make -C lib
make[1]: Entering directory '/home/mcuee/build/8051/fx2lib/lib'
sdcc -mmcs51 -I../include -c serial.c -o serial.rel
../include/serial.h:55: warning 283: function declarator with no prototype
serial.c:72: warning 283: function declarator with no prototype
sdcc -mmcs51 -I../include -c i2c.c -o i2c.rel
sdcc -mmcs51 -I../include -c delay.c -o delay.rel
sdcc -mmcs51 -I../include -c setupdat.c -o setupdat.rel
../include/setupdat.h:152: warning 283: function declarator with no prototype
setupdat.c:34: warning 283: function declarator with no prototype
setupdat.c:39: warning 283: function declarator with no prototype
setupdat.c:48: warning 283: function declarator with no prototype
setupdat.c:50: warning 283: function declarator with no prototype
setupdat.c:53: warning 283: function declarator with no prototype
setupdat.c:57: warning 283: function declarator with no prototype
setupdat.c:72: warning 283: function declarator with no prototype
setupdat.c:161: warning 283: function declarator with no prototype
setupdat.c:206: warning 283: function declarator with no prototype
setupdat.c:236: warning 283: function declarator with no prototype
setupdat.c:310: warning 283: function declarator with no prototype
sdcc -mmcs51 -I../include -c gpif.c -o gpif.rel
sdcc -mmcs51 -I../include -c eputils.c -o eputils.rel
...
sdas8051 -logs usbav.a51
sdar -rc fx2.lib serial.rel i2c.rel delay.rel setupdat.rel gpif.rel eputils.rel interrupts/spare_isr.rel interrupts/usbreset_isr.rel interrupts/ep6ff_isr.rel interrupts/ep6ef_isr.rel interrupts/ep0ping_isr.rel interrupts/sutok_isr.rel interrupts/ep6ping_isr.rel interrupts/ep4_isr.rel interrupts/ep4ping_isr.rel interrupts/ep1ping_isr.rel interrupts/ep1out_isr.rel interrupts/ep4ef_isr.rel interrupts/errlimit_isr.rel interrupts/ep8isoerr_isr.rel interrupts/gpifwf_isr.rel interrupts/ep6_isr.rel interrupts/ep6isoerr_isr.rel interrupts/gpifdone_isr.rel interrupts/ep4isoerr_isr.rel interrupts/suspend_isr.rel interrupts/ep2ping_isr.rel interrupts/ep8_isr.rel interrupts/ep0in_isr.rel interrupts/ep2pf_isr.rel interrupts/ep2_isr.rel interrupts/ep8pf_isr.rel interrupts/ep8ff_isr.rel interrupts/ep1in_isr.rel interrupts/sof_isr.rel interrupts/ep0ack_isr.rel interrupts/ep2ff_isr.rel interrupts/sudav_isr.rel interrupts/ep2ef_isr.rel interrupts/ep0out_isr.rel interrupts/hispeed_isr.rel interrupts/ep2isoerr_isr.rel interrupts/ep8ef_isr.rel interrupts/ibn_isr.rel interrupts/ep8ping_isr.rel interrupts/ep4ff_isr.rel interrupts/ep6pf_isr.rel interrupts/ep4pf_isr.rel usbav.rel
make[1]: Leaving directory '/home/mcuee/build/8051/fx2lib/lib'
make -C examples
make[1]: Entering directory '/home/mcuee/build/8051/fx2lib/examples'
make -C bulkloop
make[2]: Entering directory '/home/mcuee/build/8051/fx2lib/examples/bulkloop'
mkdir -p build
sdcc -mmcs51 -c -o build/bulkloop.rel -I ../..//include -I "" build/../bulkloop.c
...
build/../bulkloop.c:201: syntax error: token -> 'SUDAV_ISR' ; column 38
make[2]: [../../lib/fx2.mk:83: build/bulkloop.rel] Error 1 (ignored)
...
build/../debugdev.c:204: syntax error: token -> 'SUDAV_ISR' ; column 38
make[2]: [../../lib/fx2.mk:83: build/debugdev.rel] Error 1 (ignored)
...
build/../debugdev.c:310: syntax error: token -> 'SUDAV_ISR' ; column 38
make[2]: [../../lib/fx2.mk:83: build/debugdev.rel] Error 1 (ignored)
...
build/../eeprom.c:159: syntax error: token -> 'SUDAV_ISR' ; column 38
make[3]: [../../../lib/fx2.mk:83: build/eeprom.rel] Error 1 (ignored)
...
build/../serial.c:33: syntax error: token -> '3' ; column 31
make[2]: [../../lib/fx2.mk:83: build/serial.rel] Error 1 (ignored)
...
build/../timers.c:29: syntax error: token -> 'TF0_ISR' ; column 37
make[2]: [../../lib/fx2.mk:83: build/timers.rel] Error 1 (ignored)
...
build/../usbmon.c:205: syntax error: token -> 'SUDAV_ISR' ; column 38
make[2]: [../../lib/fx2.mk:83: build/usbmon.rel] Error 1 (ignored)
sdas8051 -logs build/dscr.rel build/../dscr.a51
sdcc -mmcs51 -o build/usbmon.ihx build/usbmon.rel build/dscr.rel fx2.lib --code-size 0x3c00 --xram-size 0x0200 --xram-loc 0x3c00 -Wl"-b DSCR_AREA=0x3e00" -Wl"-b INT2JT=0x3f00" -L ../..//lib
?ASlink-Error-<cannot open> : "build/usbmon.rel"
make[2]: [../../lib/fx2.mk:80: build/usbmon.ihx] Error 1 (ignored)
make[2]: Leaving directory '/home/mcuee/build/8051/fx2lib/examples/usbmon_c'
make[1]: Leaving directory '/home/mcuee/build/8051/fx2lib/examples'
Can anyone help with this. What am I missing here?
make -C lib
sdcc -mmcs51 -I../include -c serial.c -o serial.rel
../include/fx2regs.h:43: syntax error: token -> 'at' ; column 8
make[1]: *** [serial.rel] Error 1
make: *** [all] Error 2
sdcc:
SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.2.0 #8008 (Feb 26 2013) (Mac OS X x86_64)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.