A summary of new features introduced in Astrobe for Cortex-M4 since version 7.0.0:
Runtime Error Tracing
The library module Traps has been enhanced so that when a runtime error occurs a callback trace of the sequence of procedure calls that led to the error is reported. Each line of the trace shows the module name, procedure name and the absolute address of the location of the call in the executable. The relevant source code line number of each procedure is also shown if the configuration option, Line Numbers, is enabled:
A full application disassembler is included in the Professional Edition. Each procedure and its address is identified as shown in this screenshot:
The Application disassembler does not replace the Module disassembler - they are separate menu items, Project > Module Disassembler and Project Application Disassembler. They are both implemented very differently. The Module disassembler requires the source code and compiler to be present; the Application disassembler requires neither.
The number of levels of record extensions allowed is now configurable with the limit increased from 4 to 8.
The syntax colouring configuration scheme is stored in the file Oberon.xml. When Astrobe is started it looks for this file in the Astrobe Folder e.g.
If it does not exist there it looks for it in the Astrobe Program Folder e.g.
C:\Program Files (x86)\AstrobeM4 Professional Edition
If syntax colours are changed, the changes are stored in the Oberon.xml file in the Astrobe folder. The Syntax colouring configuration details are no longer stored in the Windows registry.
A maximum of three levels of nested comments, instead of two, are now allowed for in the syntax colouring scheme.
User-customisable Tools Menu
You can now add up to ten new menu commands of your own choice to the Astrobe Tools Menu. These can be used to launch a Windows application, a command-line console application or a DOS command.
You can include the following context-sensitive parameters in the commands:
They are substituted with values corresponding to the file currently showing in the editor.
You can also use the parameter
as the working folder or parameter for the command. The name of the folder where the Astrobe configuration files, library modules and examples are located is substituted when the command is executed. This is the folder which you specified when you installed Astrobe e.g.
You can create new menu items by editing a Tools.ini text file which is located with the configuration files in the Astrobe Configs folder. The ini file supplied with Astrobe includes three commands:
Open Containing Folder ...
Open Examples Folder ...
View Map File
These commands perform the following functions:
- Opens Windows Explorer in the folder containing the file currently showing in the editor.
- Opens Windows Explorer in the folder containing the example applications supplied with Astrobe.
- Displays the map file of the main module currently showing in the editor.
Cortex-M4 Oberon Language Extensions and Features
Bitfield Operators - BFI and BFX:
The bitfield extract and insert procedures BFX and BFI are predefined procedures which generate efficient inline code for common shift and mask operations. They are replacements for SYSTEM.UBFX and SYSTEM.BFI. For example:
SYSTEM.UBFX(bitfield, word, msb, lsb);
SYSTEM.BFI(word, msb, lsb, bitfield);
should now be written as:
bitfield := BFX(word, msb, lsb);
BFI(word, msb, lsb, bitfield);
Oberon Language Features
The latest version of the Oberon Language Report is dated May 2016. A copy of the report is included in the Astrobe distribution.
The following are implementation restrictions:
- Pointers to anonymous records are identified with a compiler warning message.
Pointer types declared in an external module can only be extended in a client module if they point to a named record.
Pointers to anonymous records cannot reference themselves.
Anonymous records should be declared as named types instead to avoid these problems and ensure compatibility with Project Oberon.
- A client module requires an imported module to precede any module which indirectly imports it in the IMPORT list.
For example, if B imports A, and C imports both A and B, then A must appear before B in C's IMPORT list. If it does not, the error is detected and reported with a compiler error message.
If this checkbox option is enabled (the default) the relevant source code line number of each procedure in the callback trace is shown when runtime errors are reported. Whenever this setting is changed, the application must be relinked to ensure that all modules have been compiled with the same setting, otherwise an error will be reported when the application is linked.
Library Pathnames are used by Astrobe to search for dependent module files when compiling, building and linking applications. The number of these pathnames that you can define for each application has been increased from five to ten.
The foldername parameter
%AstrobeM4% has replaced the parameter
%astrobe% to allow for several different versions of Astrobe to co-exist on a single PC. It is substituted with the name of the folder where the Astrobe configuration files, library modules and examples are located. This is the folder which you specified when you installed Astrobe for Cortex-M4 e.g.
STM32 Microcontrollers Modules and Examples
The following Cortex-M4 microcontrollers from STMicroelectronics are now supported:
New library modules and examples that target these devices are included:
- An updated common GPIO library module
- The standard Astrobe device-specific library modules: Clock, I2C, Main, MCU, Serial, SPI and Timers
- Additional examples
The corresponding Nucleo-32, Nucleo-64 and Nucleo-144 development boards from STMicroelectronics which use these microcontrollers have been added to our list of supported boards.
Library Modules - General
The error codes used in ASSERT statements in the library modules have been rationalised and are now referenced by named constants. These are defined in the Error library module e.g. Error.timeout. Each error code is associated with an error message that is displayed when the assertion is handled by the Traps module.
The common modules HCDrive, HCDir and HCFiles used by HCFiler, the SDHC Filesystem, are now included with the General library modules.
An ASSERT statement with a code in the range 200 .. 255 can now be assigned a user-defined trap handler. A new example, UserTraps, shows how it can be used.
The new Bits module can be used to perform bitwise operations on INTEGERs.
Library Modules - STM32
The STM32 library modules have been reworked for greater consistency to make it easier to develop applications for multiple targets.
A single SPI module for each target microcontroller is now used for all examples. e.g. HCFiler now uses the standard Astrobe library SPI module.
All transfers are assumed to be 8 bits. The nBits parameter has been removed from SPI.Init whose signature is now:
PROCEDURE Init*(bus: INTEGER; ConfigurePins: ConfigurePinsProc);
The unreferenced MCU module has been removed from the import list.
The GPIO module is now located in the General library folder.
The Main and MCU modules all configure the HSE oscillator, PLL, AHB and APB clocks in a similar way to the corresponding STM32 modules in Astrobe for Cortex-M3 and Cortex-M7.
Source Code Examples
- UserTraps shows how a user-defined trap handler can be created.
- DRAMTest can be used to test DRAM chips found in retrocomputing projects.
- HCTest and HCReadSpeed, the HCFiler SDHC file system example applications, are now supported on all STM32 targets.
- SlideDemo, the graphics example which uses an Arduino-compatible TFT Display, is now supported on all STM32 Nucleo-64 and Nucleo-144 boards.
- Info examples are now target-specific.
Subscribe to the Cortex-M4 Source code examples of the Astrobe forum to receive notification of the availability of new source code examples.
- The compiler now generates correct code when INC and DEC operate on BYTE fields of records.
- The Build and View Import commands now process comments in IMPORT lists without problems.
- The compiler reports an error if a variable declared as a POINTER is passed as an actual parameter to a procedure with a formal parameter declared as a BYTE array. If there was a good reason for doing this SYSTEM.VAL can be used to cast the POINTER to an INTEGER before calling the procedure..
- When the first parameter of the standard functions INC and DEC is declared as a BYTE the compiler now correctly generates LDRB and STRB instructions (instead of LDR and STR). This prevents potential problems particularly when the parameter is an element of a BYTE array.
- The linker confirms that all modules have been compiled with the same number of Extension Levels (see Preferences above) and the same Line Number option setting (see Configuration Options above). The source code of MAU is now included to allow it to be recompiled when the settings are changed.
- Applications with total code size > 512 KBytes can now be built.
- If the import lists in the modules that make up an application contain the same module name, except that the case is different, only one instance of the module should be linked by the application.
- Exporting a field from a private record is now a compilation error.
- A real constant parameter followed by a period instead of a comma e.g. InitEllipse(e, 10.0. 20.0) is now a compilation error.
- A superfluous comma in an IMPORT list e.g. IMPORT M1, M2, (* M3 *); is now a compilation error.
- Assigning an array to a VAR open array parameter is now a compilation error.
- RETURN "A" when the procedure result type is a CHAR now compiles successfully.
- Astrobe no longer terminates if a Tools.ini file cannot be found in the current configuration folder.
- Applications with a codestart range other than 0 and string constants are more reliably handled by the Application Disassembler.
- The Application Disassembler can now handle large executables e.g. *.bin files larger than 200 KB.
- Type tests on VAR record parameters in Leaf Procedures now work as expected.
- If you have associated Astrobe for Cortex-M4 with the .mod file extension, Astrobe launches successfully without an error message when you double-click on a .mod file.
- A correct copy of the ARM Cortex-M Oberon Programmers Guide is included.
- NEW returns NIL instead of terminating if there is insufficient memory to be allocated.
- The system handlers for Memory Manage and Bus faults are enabled via the NVIC register SHCSR in the library module Traps so that these exceptions are identified more clearly.
- A pointer alias declared in an indirectly imported module does not need that module to be explicitly imported in a client module.
- INCL and EXCL report a compiler error if the variable parameter is read-only.
- Prevent module disassembler exceptions resulting from large CASE statements.
- Configuration > Open displays an error message instead of an unhandled exception if an invalid configuration file is opened.
- The tools menu will not be populated with custom tools if the Tools.ini file is not a valid tools ini file.
- The Linker terminates with an error message if Main is not imported in the module being linked.
- Type Tests are allowed in leaf procedures.
- Type tests on expressions (e.g. array elements and individual fields of records) are handled correctly in IS expressions. Type tests using CASE statements can only be performed on (qualified) identifiers, not expressions.
- in the serial library module for the STM32L432 eval board, the USART2_RX Alternate Function 7 instead of 3 was assigned erroneously. The USART bit CR1/UE is now finally enabled after the configuration process for all STM32 eval boards.
- The compatibility of references to a module which is imported with an alias in more than one module is now correctly determined.
- Aliased imported Types no longer cause side-effects that result in runtime exceptions.