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

Update Simulator Config #834

Merged
merged 2 commits into from
Nov 26, 2022
Merged

Update Simulator Config #834

merged 2 commits into from
Nov 26, 2022

Conversation

thisiskeithb
Copy link
Member

@thisiskeithb thisiskeithb commented Oct 28, 2022

Description

  • Add #define TOUCH_SCREEN as part of the Classic / Touch UI TFT build since it will fail with a bunch of TOUCH_*_PIN errors without it.
  • Add REPRAP_DISCOUNT_SMART_CONTROLLER to supported LCD list
Full TOUCH_*_PIN error output:
.pio/libdeps/simulator_macos_debug/MarlinSimUI/src/MarlinSimulator/virtual_printer.cpp: In static member function 'static void VirtualPrinter::build()':
.pio/libdeps/simulator_macos_debug/MarlinSimUI/src/MarlinSimulator/virtual_printer.cpp:86:151: error: 'TOUCH_SCK_PIN' was not declared in this scope; did you mean 'TOUCH_CS_PIN'?
   86 |     root->add_component<ST7796Device>("ST7796Device Display", spi_bus_by_pins<TFT_SCK_PIN, TFT_MOSI_PIN, TFT_MISO_PIN>(), TFT_CS_PIN, spi_bus_by_pins<TOUCH_SCK_PIN, TOUCH_MOSI_PIN, TOUCH_MISO_PIN>(), TOUCH_CS_PIN, TFT_DC_PIN, BEEPER_PIN, BTN_EN1, BTN_EN2, BTN_ENC, BTN_BACK, KILL_PIN);
      |                                                                                                                                                       ^~~~~~~~~~~~~
      |                                                                                                                                                       TOUCH_CS_PIN
.pio/libdeps/simulator_macos_debug/MarlinSimUI/src/MarlinSimulator/virtual_printer.cpp:86:166: error: 'TOUCH_MOSI_PIN' was not declared in this scope; did you mean 'TOUCH_CS_PIN'?
   86 |     root->add_component<ST7796Device>("ST7796Device Display", spi_bus_by_pins<TFT_SCK_PIN, TFT_MOSI_PIN, TFT_MISO_PIN>(), TFT_CS_PIN, spi_bus_by_pins<TOUCH_SCK_PIN, TOUCH_MOSI_PIN, TOUCH_MISO_PIN>(), TOUCH_CS_PIN, TFT_DC_PIN, BEEPER_PIN, BTN_EN1, BTN_EN2, BTN_ENC, BTN_BACK, KILL_PIN);
      |                                                                                                                                                                      ^~~~~~~~~~~~~~
      |                                                                                                                                                                      TOUCH_CS_PIN
.pio/libdeps/simulator_macos_debug/MarlinSimUI/src/MarlinSimulator/virtual_printer.cpp:86:182: error: 'TOUCH_MISO_PIN' was not declared in this scope; did you mean 'TOUCH_CS_PIN'?
   86 |     root->add_component<ST7796Device>("ST7796Device Display", spi_bus_by_pins<TFT_SCK_PIN, TFT_MOSI_PIN, TFT_MISO_PIN>(), TFT_CS_PIN, spi_bus_by_pins<TOUCH_SCK_PIN, TOUCH_MOSI_PIN, TOUCH_MISO_PIN>(), TOUCH_CS_PIN, TFT_DC_PIN, BEEPER_PIN, BTN_EN1, BTN_EN2, BTN_ENC, BTN_BACK, KILL_PIN);
      |                                                                                                                                                                                      ^~~~~~~~~~~~~~
      |                                                                                                                                                                                      TOUCH_CS_PIN
.pio/libdeps/simulator_macos_debug/MarlinSimUI/src/MarlinSimulator/virtual_printer.cpp:86:197: error: no matching function for call to 'spi_bus_by_pins<<expression error>, <expression error>, <expression error> >()'
   86 |     root->add_component<ST7796Device>("ST7796Device Display", spi_bus_by_pins<TFT_SCK_PIN, TFT_MOSI_PIN, TFT_MISO_PIN>(), TFT_CS_PIN, spi_bus_by_pins<TOUCH_SCK_PIN, TOUCH_MOSI_PIN, TOUCH_MISO_PIN>(), TOUCH_CS_PIN, TFT_DC_PIN, BEEPER_PIN, BTN_EN1, BTN_EN2, BTN_ENC, BTN_BACK, KILL_PIN);
      |                                                                                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from .pio/libdeps/simulator_macos_debug/MarlinSimUI/src/MarlinSimulator/hardware/ST7796Device.h:9,
                 from .pio/libdeps/simulator_macos_debug/MarlinSimUI/src/MarlinSimulator/virtual_printer.cpp:10:
.pio/libdeps/simulator_macos_debug/MarlinSimUI/src/MarlinSimulator/hardware/bus/spi.h:88:9: note: candidate: 'template<short int CLK, short int MOSI, short int MISO> SpiBus& spi_bus_by_pins()'
   88 | SpiBus& spi_bus_by_pins();
      |         ^~~~~~~~~~~~~~~
.pio/libdeps/simulator_macos_debug/MarlinSimUI/src/MarlinSimulator/hardware/bus/spi.h:88:9: note:   template argument deduction/substitution failed:
.pio/libdeps/simulator_macos_debug/MarlinSimUI/src/MarlinSimulator/virtual_printer.cpp:86:197: error: template argument 1 is invalid
   86 |     root->add_component<ST7796Device>("ST7796Device Display", spi_bus_by_pins<TFT_SCK_PIN, TFT_MOSI_PIN, TFT_MISO_PIN>(), TFT_CS_PIN, spi_bus_by_pins<TOUCH_SCK_PIN, TOUCH_MOSI_PIN, TOUCH_MISO_PIN>(), TOUCH_CS_PIN, TFT_DC_PIN, BEEPER_PIN, BTN_EN1, BTN_EN2, BTN_ENC, BTN_BACK, KILL_PIN);
      |                                                                                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
compilation terminated due to -fmax-errors=5.
*** [.pio/build/simulator_macos_debug/debug/libd2c/MarlinSimUI/MarlinSimulator/virtual_printer.o] Error 1

Benefits

Simulator will build out of the box.

Related Issues

None. Found while setting up a simulator build using this config.

@thisiskeithb
Copy link
Member Author

thisiskeithb commented Oct 28, 2022

Touch calibration crashes the simulator for TFT_CLASSIC_UI with a "floating point exception" error, so I'm not sure how to get around that.

I'm running an Intel-based Mac on Monterey 12.6 if that helps with debugging.

@thisiskeithb
Copy link
Member Author

I decided to test the other LCD options and LIGHTWEIGHT_UI doesn't build, but I'm not sure what the fix is on this either.

Full error output:
Linking .pio/build/simulator_macos_debug/debug/MarlinSimulator
Undefined symbols for architecture x86_64:
  "__Z14ST7920_set_cmdv", referenced from:
      __ZN25ST7920_Lite_Status_Screen3cmdEh in status_screen_lite_ST7920.o
  "__Z14ST7920_set_datv", referenced from:
      __ZN25ST7920_Lite_Status_Screen10begin_dataEv in status_screen_lite_ST7920.o
  "__Z17ST7920_write_byteh", referenced from:
      __ZN25ST7920_Lite_Status_Screen3cmdEh in status_screen_lite_ST7920.o
      __ZN25ST7920_Lite_Status_Screen9write_strEPKc in status_screen_lite_ST7920.o
      __ZN25ST7920_Lite_Status_Screen9write_strEPKch in status_screen_lite_ST7920.o
      __ZN25ST7920_Lite_Status_Screen9write_strEPK19__FlashStringHelper in status_screen_lite_ST7920.o
      __ZN25ST7920_Lite_Status_Screen11clear_ddramEv in status_screen_lite_ST7920.o
      __ZN25ST7920_Lite_Status_Screen11clear_gdramEv in status_screen_lite_ST7920.o
      __ZN25ST7920_Lite_Status_Screen15load_cgram_iconEtPKv in status_screen_lite_ST7920.o
      ...
  "__Z9ST7920_csv", referenced from:
      __ZN25ST7920_Lite_Status_Screen6updateEb in status_screen_lite_ST7920.o
      __ZN25ST7920_Lite_Status_Screen8on_entryEv in status_screen_lite_ST7920.o
      __ZN25ST7920_Lite_Status_Screen7on_exitEv in status_screen_lite_ST7920.o
      __ZN25ST7920_Lite_Status_Screen17clear_text_bufferEv in status_screen_lite_ST7920.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
*** [.pio/build/simulator_macos_debug/debug/MarlinSimulator] Error 1

@thinkyhead thinkyhead force-pushed the import-2.1.x branch 2 times, most recently from 948dbda to 0bd7526 Compare November 9, 2022 05:21
@thinkyhead
Copy link
Member

Since LIGHTWEIGHT_UI depends on the display doing most of the drawing, it would require a more full DOGLCD simulation to work with the simulator. So, if simulator is in use, an error should be thrown for this and other unsupported displays.

@thinkyhead thinkyhead merged commit 34b03bf into MarlinFirmware:import-2.1.x Nov 26, 2022
@thisiskeithb
Copy link
Member Author

So, if simulator is in use, an error should be thrown for this and other unsupported displays.

So why is it duplicated at the top of the config / in the supported simulator display section? It implies that it’s supported. Since it’s not, it should have been removed before this was merged.

@thisiskeithb thisiskeithb deleted the pr/update_sim_config branch November 26, 2022 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants