Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building firmware fails #726

Open
twam opened this issue Dec 2, 2024 · 3 comments
Open

Building firmware fails #726

twam opened this issue Dec 2, 2024 · 3 comments

Comments

@twam
Copy link

twam commented Dec 2, 2024

I tried to build the firmware as described on http://glasgow-embedded.org/latest/develop/firmware.html with macOS and Gentoo Linux. On both systems it fails with:

$ make -C vendor/libfx2/firmware
make: Entering directory '/home/twam/glasgow/vendor/libfx2/firmware'
make[1]: Entering directory '/home/twam/glasgow/vendor/libfx2/firmware/library'
make[1]: Leaving directory '/home/twam/glasgow/vendor/libfx2/firmware/library'
make[1]: Entering directory '/home/twam/glasgow/vendor/libfx2/firmware/boot-cypress'
make[1]: *** No rule to make target 'build/main.rel', needed by 'boot-cypress.ihex'.  Stop.
make[1]: Leaving directory '/home/twam/glasgow/vendor/libfx2/firmware/boot-cypress'
make: *** [Makefile:4: all] Error 2
make: Leaving directory '/home/twam/glasgow/vendor/libfx2/firmware'

Any hints how to solve it?

@whitequark
Copy link
Member

That's odd. Does ./software/deploy-firmware.sh work?

@twam
Copy link
Author

twam commented Dec 2, 2024

I don't have a running docker setup for now. :)

I found out, that sdcc list the following changes in the manual:

• In 4.2.9, support for arguments to -MMD was dropped. The output file can be specified via -MF instead.

and I'm running sdcc 4.4.0. This explains why

 sdcc -mmcs51 --iram-size 0x100 --code-size 0x3e00 --xram-loc  0x3e00 --xram-size 0x0200 --std-sdcc99 --model-small  -I../library/include -L../library/lib/small -Wp,-MQ,build/main.rel,-MMD,build/main.d -c main.c

always deleted main.c resulting in the described the failure. Replacing the -MMD with -M,-MF makes the firmware build, but with a lot of

at 1: warning 190: ISO C forbids an empty translation unit

Flashing the created (and almost empty) firmware.ihex bricked my Glasgow 🙈

@whitequark
Copy link
Member

I found out, that sdcc list the following changes in the manual:

• In 4.2.9, support for arguments to -MMD was dropped. The output file can be specified via -MF instead.

Ah, that would be whitequark/libfx2#11. We need to update the libfx2 submodule.

Flashing the created (and almost empty) firmware.ihex bricked my Glasgow 🙈

That's not an issue. Look at the PCB to the left of the reset button; there will be two (tiny) holes with "RECOVER" written on silk next to them. Short them with tweezers or something, and plug Glasgow again. After that, it will enumerate as a generic Cypress device and you'll be able to reflash it.

Make a backup of your EEPROM to make sure you retain the serial number, which can be done with the fx2tool command.

(Ideally we should have a documentation page on this, since I've omitted some details I've assumed you can figure out.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants