Portage of Oberon system to stm32f429i-disco board
Version 12 released!
The main point is adding support of stored objects. This can be seen as immutable variables initialized at compile time and stored in flash.
Lot of bug fixes and improvements have also been made.
Two examples Thermometre (MSP430G2231) and nRF24l01+ relay (MSP430G2553) have been added.
The compiler with 64 bits integer support is now the OM4 default compiler. All modules have been rebuilt with it.
A module named FLASH has been added for writing the embedded flash memory of the STM32F429 microcontroller.
The 12th release contains a major improvement: the modules code and strings can be hosted
in the flash memory of the microcontroller and be executed in place.
The global data can also be placed is SRAM.
Previously, the modules had too be loaded in the SDRAM to be executed.
There are a lot of advantages doing this:
- The code executes 8 times faster, by avoiding the competition between CPU and VGA system for SDRAM access.
- More SDRAM is available for modules that remains in SDRAM and for the heap.
- If the Oberon system and the compiler are both placed in embedded flash memory, the system is guaranteed to boot and compile even if incoherent recompilation has been done on vital modules.
To put modules in embedded flash, follow this procedure:
- Prelink the modules using the command OM4L.LinkEF. Example:
OM4L.LinkEF Modules System Edit OM4P ~
This will produce a .efb file that will be later placed in the embedded flash memory. - Reboot the station in legacy SDRAM mode by pressing the SW1 button on the base board and the reset button on the SMT429I-DISCO board. This is mandatory because it is not safe to modify the embedded flash memory while executing it.
- Install the .efb file using the command OM4L.LoadEF. Example:
OM4L.LoadEF OM4P.efb
The installation can be verified by comparing the .efb file and the content of the embedded flash, using the command OM4L.CompareEF. Example:OM4L.CompareEF OM4P.efb
The installation is successful if the output of this command ends with the word "same". - Reboot the station without pressing SW1 button. The station should now execute the Oberon system and the compiler from embedded flash.
This can be checked with the command System.ShowModules. In the window that appears,
all lines refering a module stored in embedded flash will end with the number -1. Example:
OM4P 0802E7B4 0802F1F4 -1
Reminder: starting wiht the release 9, it is now easy to launch user actions immediately after system startup. Put your code in the initialization section of the OnStartup module and compile it.
QWERTY keyboard can be activated by middle clicking on the text "OM4P.Compile InputQwerty.Mod ~"
displayed in yellow in the middle of the System.Tool window. Restart the system to load the updated Input module.
Changes in oberon 07 compiler:
Registers usage control in procedures
Cortex M4 microcontrollers save automatically a set of registers on stack when servicing an interruption.
If an Oberon exception handler contains too complicated expressions, there is a risk that a non saved register is used.
To prevent that case to happen, I introduced a new notation ^n after the PROCEDURE keyword:
PROCEDURE^3 handler;
BEGIN ....
END handler;
With this information, the compiler can check that no more than n registers are used. The save/restoration instructions are automatically generated according to the declared number of used registers.
Unsafe local variables marking
This Oberon compiler allow allocation of unitialized pointers on stack.
Those pointers are not checked at runtime, so they are not safe until they are properly intialized.
I made a change in the compiler to allow detection of the declaration of local variables containing pointers. The developer must check the code to be sure that no bad use is made with these variables.
For example, assume that a Files.Rider is declared as a local variable. Using of the "file" member (eg. via Files.Base) is unsafe until the rider has been initialized with Files.Set.
When the developer has determined that the code usage of the local variable is safe, he or she must mark the variable with an exclamation mark (!) in its declaration.
Oberon runs now on the STM32F429I-DISCO base board:
Hardware side: