Can I compile smartBASIC with UWTerminal without being attached to a module?

When you compile a smartBASIC program with UWTerminalX, a connection to a module is required so that the product number and its firmware version can be checked. This is required because each firmware version requires the use of a particular cross compiler. Behind the scenes, UWTerminalX sends AT I 0 and AT I 13 to get the product number and required cross compiler version.

To compile a smartBASIC program without being connected to a module, you need to supply the product version and cross compiler version as arguments to the xcomp.exe. To get the product number and cross compiler version, you need to use AT I 0 and AT I 13 with a module or dev board that has the firmware you intend to use. This should only be done once unless the firmware version changes and you need to use a new cross compiler version.

Copy the relevant version of cross compiler to the folder that contains your smartBASIC application. Say, your cross compiler is called xcomp_bl652_1234_5678.exe and your smartBASIC app is called lairdrocks.sb. You then open a command prompt window in that folder and issue the following command:

xcomp_bl652_1234_5678.exe   lairdrocks.sb

If there are no errors you will see a file called lairdrockrocks.uwc being created.

Notes:

  • .sb files are smartBASIC source (text)
  • .uwc is the compiled byte code file required for loading into a smartBASIC module
  • xcomp is short for cross-compiler