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

Which toolchain should I use #45

Open
e135193 opened this issue Jul 2, 2018 · 5 comments
Open

Which toolchain should I use #45

e135193 opened this issue Jul 2, 2018 · 5 comments

Comments

@e135193
Copy link

e135193 commented Jul 2, 2018

Hello,

 I want to compile the source code. Which toolchain should I use ? could someone provide a link ?
@VigibotDev
Copy link

VigibotDev commented Jul 2, 2018

Hi, if I remember it need g++ and sdcc (+ git and make lol)
Just launch make inside the Firmware directory (Makefile)

@e135193
Copy link
Author

e135193 commented Jul 2, 2018

thanks. it works well

@akissu
Copy link

akissu commented Aug 27, 2019

Which version of SDCC and the STDLIB are you compiling against? I keep running into errors.

@akissu
Copy link

akissu commented Aug 28, 2019

Disregard #50 (comment)

@spth
Copy link

spth commented Oct 21, 2019

It probably works with some rather old SDCC out-of-the-box.

Using current SDCC, the firmware compiles for me using this patch:

diff --git a/Firmware/bootloader/product.mk b/Firmware/bootloader/product.mk
index d3b9f5d..9d647ea 100644
--- a/Firmware/bootloader/product.mk
+++ b/Firmware/bootloader/product.mk
@@ -34,7 +34,7 @@ PRODUCT_DIR	:=	$(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
 PRODUCT_INSTALL	 =	$(foreach frequency,$(FREQUENCIES), $(OBJROOT)/$(PRODUCT)~$(frequency).hex)
 
 CFLAGS		+=	-DBL_VERSION=$(VERSION)
-CFLAGS		+=	--model-small --no-xinit-opt --opt-code-size --Werror
+CFLAGS		+=	--model-small --no-xinit-opt --opt-code-size
 #CFLAGS		+=	--fverbose-asm
 
 # Set limits for the low (CSEG) and high (HIGHCSEG) code segments.
diff --git a/Firmware/radio/product.mk b/Firmware/radio/product.mk
index cf21a15..74880ad 100644
--- a/Firmware/radio/product.mk
+++ b/Firmware/radio/product.mk
@@ -34,7 +34,7 @@ PRODUCT		 =	radio~$(BOARD)
 PRODUCT_DIR	:=	$(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
 
 CFLAGS		+=	-DAPP_VERSION_HIGH=$(VERSION_MAJOR) -DAPP_VERSION_LOW=$(VERSION_MINOR)
-CFLAGS		+=	$(CFLAG_MODEL) --opt-code-speed --Werror --std-sdcc99 --fomit-frame-pointer
+CFLAGS		+=	$(CFLAG_MODEL) --opt-code-speed --std-sdcc99 --fomit-frame-pointer
 #CFLAGS		+=	--fverbose-asm 
 PRODUCT_SUPPORT_BANKING = 1
 INC_DIR_AES	 = AES
diff --git a/Firmware/radio/serial.c b/Firmware/radio/serial.c
index 1320273..ac80aeb 100644
--- a/Firmware/radio/serial.c
+++ b/Firmware/radio/serial.c
@@ -537,12 +537,13 @@ serial_read_space(void)
 	return space;
 }
 
-void
-putchar(char c) __reentrant
+int
+putchar(int c) __reentrant
 {
 	if (c == '\n')
 		_serial_write('\r');
 	_serial_write(c);
+	return c;
 }

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

4 participants