Skip to content

Instantly share code, notes, and snippets.

@jgoizueta
Created August 12, 2019 20:48
Show Gist options
  • Select an option

  • Save jgoizueta/a0c0baf53180783a5c6b9f0d39ef7d10 to your computer and use it in GitHub Desktop.

Select an option

Save jgoizueta/a0c0baf53180783a5c6b9f0d39ef7d10 to your computer and use it in GitHub Desktop.
Numworks symbolic computation

Fork of Numworks epsilon to re-enable symbolic computation which was removed in version 11.2.0 (2019-06-26):

It is reenabled in:

Note: at the present time (2019-08-10) the master branch seems to contain version 11.1 for the new model N0110:

Branch symb11 of this fork is based on the origin/version-11 branch and contains a reversion of the symbolic computation removal.

Install SDK

Following https://www.numworks.com/resources/engineering/software/sdk/macos/

But gcc-arm-embedded has been removed from homebrew casks:

Workaround:

brew cask install https://raw.githubusercontent.com/Homebrew/homebrew-cask/b88346667547cc85f8f2cacb3dfe7b754c8afc8a/Casks/gcc-arm-embedded.rb

So the final procedure is (with Homebrew previously installed):

brew reinstall fltk freetype dfu-util libpng pkg-config
brew cask install https://raw.githubusercontent.com/Homebrew/homebrew-cask/b88346667547cc85f8f2cacb3dfe7b754c8afc8a/Casks/gcc-arm-embedded.rb

Compile

Following https://www.numworks.com/resources/engineering/software/sdk/

Compile and run emulator:

make PLATFORM=simulator clean
make PLATFORM=simulator
./build/simulator/epsilon.elf

### Compile to flash calc:

Using information from https://en.wikibooks.org/wiki/Unofficial_Guide_To_Expanding_Your_Numworks/Getting_your_development_environment_set_up#Uploading_the_firmware_to_your_calculator

The current (version-11, master) flash build procedure is broken (the epsilon.elf produced used to be placed in the base directory, but now it doesn't): numworks/epsilon#1044 (comment)

The work around is, when the make process fails, to copy the file manually and re-run make:

make clean
rm epsilon.elf
make EPSILON_BOOT_PROMPT=none epsilon_flash
cp ./build/device/epsilon.elf ./
make EPSILON_BOOT_PROMPT=none epsilon_flash

Then the calculator can be connected via USB and it will be updated (no need to press RESET).

EPSILON_BOOT_PROMPT defined as none to override the default value update from platform.device.mak which would cause a boarding messege prompting to update the firmware every time the calc switches on.

Complete update procedure (for Mac with Homebrew installed):

brew reinstall fltk freetype dfu-util libpng pkg-config
# workaround because gcc-arm-embedded cask was removed (use specific commit)
brew cask install https://raw.githubusercontent.com/Homebrew/homebrew-cask/b88346667547cc85f8f2cacb3dfe7b754c8afc8a/Casks/gcc-arm-embedded.rb
git clone https://github.com/jgoizueta/epsilon.git --branch symb11
cd epsilon
make clean
rm epsilon.elf
make EPSILON_BOOT_PROMPT=none epsilon_flash
# workaround defect in Makefile (epsilon.elf win wrong directory)
cp ./build/device/epsilon.elf ./
make EPSILON_BOOT_PROMPT=none epsilon_flash
# connect calculator by USB now
@jgoizueta
Copy link
Author

2020-05-18:
created symb13 branch in fork tracking upstream version-13
Will need to rework the symbolic activation, specially after numworks/epsilon@424ee9f

could it be simply a matter of changing the default value of parameter symbolicComputation in Expression::ParseAndSimplify and ParseAndSimplifyAndApproximate ?

@jgoizueta
Copy link
Author

@jgoizueta
Copy link
Author

2020-05 update to v13

Update from upstream, create new branch from version 13 branch (13.2 at the moment).

git remote add upstream https://github.com/numworks/epsilon.git
git fetch upstream
git checkout -b symb13 upstream/version-13

Install new SDK (see https://www.numworks.com/resources/engineering/software/build/#macos)

brew install numworks/tap/epsilon-sdk
brew unlink python@2
brew link python3

Modifications to restore symbolic mode are in:

Compile

make PLATFORM=simulator clean
make PLATFORM=simulator

The background image needs to be in the same directory as the executable directory, otherwise
the simulator works but the keyboard is not visible, so:

cd output/release/simulator/macos/x86_64
cp ../app/Payload/Epsilon.app/Contents/Resources/background.jpg ./
./epsilon.bin

@jgoizueta
Copy link
Author

Check Omega (in simulator)

git clone --recursive https://github.com/Omega-Numworks/Omega.git
cd Omega/
git checkout omega-master
make MODEL=n0100 clean
make MODEL=n0100 PLATFORM=simulator USERNAME=jgoizueta OMEGA_THEME=epsilon_light -j2

Add patched omega-based branch https://github.com/jgoizueta/epsilon/tree/omega-master

git remote add omega https://github.com/Omega-Numworks/Omega.git
git fetch omega
git checkout -b omega-master omega/omega-master

Apply this patch to omit 'undef' results:

diff --git a/apps/calculation/calculation.cpp b/apps/calculation/calculation.cpp
index 90f2de0f0..d1c0156e8 100644
--- a/apps/calculation/calculation.cpp
+++ b/apps/calculation/calculation.cpp
@@ -248,7 +248,7 @@ Calculation::DisplayOutput Calculation::displayOutput(Context * context) {
   if (m_displayOutput != DisplayOutput::Unknown) {
     return m_displayOutput;
   }
-  if (shouldOnlyDisplayExactOutput()) {
+  if (shouldOnlyDisplayExactOutput() || (GlobalPreferences::sharedGlobalPreferences()->isInExamModeSymbolic() && strcmp(approximateOutputText(NumberOfSignificantDigits::UserDefined), Undefined::Name()) == 0)) {
     m_displayOutput = DisplayOutput::ExactOnly;
   } else if (
       /* If the exact and approximate outputs are equal (with the

@jgoizueta
Copy link
Author

2020-10-02 update
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source emsdk_env.sh
cd ..
git clone --recursive https://github.com/Omega-Numworks/Omega.git
cd Omega/
git checkout omega-master
make clean
PLATFORM=simulator TARGET=web OMEGA_USERNAME=jgoizueta -j4

make MODEL=n0100 clean
make MODEL=n0100 OMEGA_USERNAME=jgoizueta OMEGA_THEME=epsilon_light -j2
make MODEL=n0100 OMEGA_THEME=epsilon_light epsilon_flash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment