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

Mk3 new lang #767

Merged
merged 29 commits into from
May 28, 2018
Merged

Mk3 new lang #767

merged 29 commits into from
May 28, 2018

Conversation

XPila
Copy link
Collaborator

@XPila XPila commented May 24, 2018

No description provided.

XPila added 28 commits May 20, 2018 13:24
all variants verified according to lang_en.txt (release only)
config.h updated (enabled ML support)
 make_lang_en.sh - english dictionary generator script
 make_lang - english dictionary generator script (new)
 lang_en.txt - english dictionary (format changed)
 lang_en_cz.txt - czech dictionary (new file)
lang_en.txt - fix missing empty line
progmem.sh, postbuild.sh - improved
textaddr.sh, update_lang.sh - new files
postbuild.sh, make_lang.sh - fixed (id and offset calculation)
language.c, language.h - fixed (==||==)
config.h - reserved space for _SEC_LANG changed
Marlin_main.cpp - debug output + hardcoded lang_select(1) //means cz
@PavelSindler PavelSindler merged commit db57354 into prusa3d:MK3 May 28, 2018
#define _i(s) _I(s)
#define _T(s) s
#else //(LANG_MODE == 0)
#define _I(s) (__extension__({static const char __c[] PROGMEM_I1 = "\xff\xff"s; &__c[0];}))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, try to compile the firmware but get allways:

language.h:37: error: unable to find string literal operator 'operator"" s'

and

exit status 1
unable to find string literal operator 'operator"" s'

What do i miss? Using Arduino IDe 1.6.8 portable with Arduino AVR Boards 1.6.11 (because later updates 1.6.12-1.6.21 give more errors) as the Arduino IDE 1.8.5

@XPila
Copy link
Collaborator Author

XPila commented May 28, 2018

@3d-gussner recommended version is 1.6.8, GCC version 4.8.1, please follow build instructions. We want upgrade to latest AVR GCC (without Arduino IDE), but it needs some time.

@hhoffman23
Copy link

I am having the same issue when attempting to compile. I am using 1.6.8 downloaded from the link in the instructions.

@XPila
Copy link
Collaborator Author

XPila commented May 29, 2018

@hhoffman23 you installed clear installation of Arduino ide or you have previously installed other version? One known issue is Arduino installer that keeps newer version of avr-gcc (must be manualy removed). Please verify avr-gcc version, should be 4.8.1.

@maximlevitsky
Copy link

@XPila Have you seen my bugreport on compiling on recent gcc-avr. It seems that one variable is declared volatile in one file and non volatile in another which is sort of violation of C/C++ in my opintion. If I make it volatile in both files, the firmware compiles fine on latest avr-gcc

@XPila
Copy link
Collaborator Author

XPila commented May 29, 2018

@maximlevitsky thank you, I will take a look at that.
btw: I found some invalid characters in the code - it can also break compilation (fixed in #779).

@3d-gussner
Copy link
Collaborator

@XPila As said i use a Arduino IDE 1.6.8 portable (too separate my Arduino IDE versions) and I double checked the arv-gcc.exe:

avr-gcc.exe -v
Using built-in specs.
COLLECT_GCC=avr-gcc.exe
COLLECT_LTO_WRAPPER=<path>/arduino/arduino-1.6.8-windows/arduino-1.6.8/hardware/tools/avr/bin/../libexec/gcc/avr/4.8.1/lto-wrapper.exe
Target: avr
Configured with: ../gcc-4.8.1/configure --enable-fixed-point --enable-languages=c,c++ --prefix=/c/jenkins/workspace/toolchain-avr-windows/objdir --enable-long-long --disable-nls --disable-checking --disable-libssp --disable-libada --disable-shared --enable-lto --with-avrlibc=yes --with-dwarf2 --disable-doc --target=avr
Thread model: single
gcc version 4.8.1 (GCC)

Still getting compiling error:

language.h:37: error: unable to find string literal operator 'operator"" s'

 #define _I(s) (__extension__({static const char __c[] PROGMEM_I1 = "\xff\xff"s; &__c[0];}))

                                                                    ^

sketch\Marlin.h:71:44: note: in definition of macro 'SERIAL_PROTOCOL'

 #define SERIAL_PROTOCOL(x) (MYSERIAL.print(x))

                                            ^

sketch\Marlin_main.cpp:7476:11: note: in expansion of macro 'SERIAL_ECHO'

           SERIAL_ECHO(_i("M221 Invalid extruder "));////MSG_M221_INVALID_EXTRUDER c=0 r=0

           ^

sketch\language.h:39:36: note: in expansion of macro '_I'

 #define _i(s) lang_get_translation(_I(s))

                                    ^

sketch\Marlin_main.cpp:7476:23: note: in expansion of macro '_i'

           SERIAL_ECHO(_i("M221 Invalid extruder "));////MSG_M221_INVALID_EXTRUDER c=0 r=0

                       ^

In file included from sketch\Marlin_main.cpp:53:0:

sketch\Marlin_main.cpp: In function 'void recover_print(uint8_t)':

language.h:37: error: unable to find string literal operator 'operator"" s'

 #define _I(s) (__extension__({static const char __c[] PROGMEM_I1 = "\xff\xff"s; &__c[0];}))

                                                                    ^

sketch\language.h:39:36: note: in expansion of macro '_I'

 #define _i(s) lang_get_translation(_I(s))

                                    ^

sketch\Marlin_main.cpp:8247:19: note: in expansion of macro '_i'

  lcd_setstatuspgm(_i("Recovering print    "));////MSG_RECOVERING_PRINT c=20 r=1

                   ^

exit status 1
unable to find string literal operator 'operator"" s'

and more of these

@3d-gussner
Copy link
Collaborator

@maximlevitsky Hi, saw a video that there might be some issues with IDE 1.8.x vs 1.6.8 https://www.youtube.com/watch?v=ev-Di5GVQ3Y

I never had issues compiling and running Prusa firmware with Arduino IDE 1.8.x on my MK2.
But made now portable versions to be able to follow Prusa and make sure we use the same tools and versions.

@PavelSindler
Copy link
Contributor

Pull requests #786 and #787 should fix your issue.

@3d-gussner
Copy link
Collaborator

3d-gussner commented May 30, 2018

@PavelSindler Thanks, it compiles now. Hoped that the code get smaller but compared to 3.2.1 it uses few more bytes.
Somebody who got an Ultimachine EINSY with Arduino bootloader couldn't use this firmware. A one language version was successful.

Here my results:
Arduino IDE 1.6.8 + fw3.2.1

Sketch uses 248,356 bytes (96%) of program storage space. Maximum is 258,048 bytes.
Global variables use 6,500 bytes of dynamic memory.

Arduino IDE 1.6.8 + fw.3.2.1 with pulled request

Sketch uses 251,708 bytes (97%) of program storage space. Maximum is 258,048 bytes.
Global variables use 6,489 bytes of dynamic memory.

BTW: Compiling with IDE 1.6.8 vs 1.8.5 uses much more program space. Just tried to compile my MK2_privatebuild with both versions (both are in portal mode to separate the libs, boards, etc)

Arduino IDE 1.6.8 + MK2_privatebuild

Sketch uses 255,816 bytes (99%) of program storage space. Maximum is 258,048 bytes.
Global variables use 6,104 bytes of dynamic memory.

Arduino IDE 1.8.5 + MK2_privatebuild

Sketch uses 246302 bytes (95%) of program storage space. Maximum is 258048 bytes.
Global variables use 6096 bytes of dynamic memory.

I had in the past strange things happening when the used hex file program space was above 96-97%. That's why i released serveral Hyperfine Bed Leveling firmware hex files with less languages.

@XPila
Copy link
Collaborator Author

XPila commented May 31, 2018

@3d-gussner the spared flash space with 1.8.5 is unbelieveable! Its high time to upgrade our buildsystem...

@stahlfabrik
Copy link
Contributor

Hell freezes over!;-)

@XPila
Copy link
Collaborator Author

XPila commented May 31, 2018

@stahlfabrik :) I always preferred build-system upgrade and code optimization/redesign, but have not time to solve. Now we are totally out of resources, so it is necessary.

@XPila
Copy link
Collaborator Author

XPila commented May 31, 2018

@3d-gusner you can disable secondary languages (config.h, #define LANG_MODE 0) for debugging and other purposes. It will spare ~11kb of flash.

@3d-gussner
Copy link
Collaborator

@XPila another comparison between 1.6.8 vs. 1.8.5 (portable versions) with newest MK3 branch code HEAD is now at 957b3cf, just had to change #614 (comment) to be able to compile with 1.8.5:

Exactly the same source code on Windows 10:
Arduino 1.6.8 + add violate fix with no changes to used language results to:

Sketch uses 252,300 bytes (97%) of program storage space. Maximum is 258,048 bytes.
Global variables use 6,489 bytes of dynamic memory.

and a hex files size of 693 KB (709.661 bytes)

Arduino 1.8.5 + add violate fix with no changes to used language results to:

Sketch uses 244124 bytes (94%) of program storage space. Maximum is 258048 bytes.
Global variables use 6511 bytes of dynamic memory.

and a hex file size of 670 KB (686.666 bytes)

Also with Arduino IDE 1.8.x library updates and board updates weren't never an issue if the code was ok.
On the other hand I can update in Arduino IDE 1.6.8 the library flawless BUT updating the "Arduino AVR Boards by Arduino" from 1.6.10 to higher than 1.6.11 generates compiling errors, so i have to be very careful what i update and what not as if you just hit update it fails.

Don't know if you watched the 13 min YouTube video I linked above Updating Arduino Broke my Code!! FAIL thought it is interesting and quite good investigated.

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

Successfully merging this pull request may close these issues.

6 participants