ST-ONE has a built-in brief help system. This is a readme.txt file, which is located in the root of the emulated disk. The file is not static, but is generated dynamically for each specific device and version of the loader. Here are the basic data for your chip and bootloader.
The values of the parameters presented in this file will help you navigate quickly. Quickly start the development or contact your product's technical support by submitting your device unique parameters.
The file is read-only and any changes to it will not be saved.
Parameter | Functionality |
---|---|
TARGET MCU | Target processor for which the loader was assembled |
UNIQUE ID | a Unique ID of the controller in HEX (12 bytes) |
OFFSET FWR | Entry Point into a main firmware |
OFFSETJACK | Entry Point in JACK |
SYSTEMTIME | Current time of the calendar of controller (RTC) |
FAT SYSTEM | Bootloader file system |
SERVICE MD | PIN and value for switching into service mode (SERVICE MODE) |
FORMATTING | PIN and the value to start system formatting |
STARTUP FW | PIN and value to start the main firmware |
FW_SIZE | Size of the main firmware from the firmware file.ini accepted to a calculation |
FW_HASH | MD5 of the main firmware to control the integrity |
For a Software Developer will be important the entry points in OFFSET FWR and OFFSETJACK programs. These parameters must be specified in the build settings of your project.
It is recommended to develop in one of the best development environments for KEIL uVision (MDK-ARM) systems. When creating the main firmware, you need to go to the project settings and set the entry point into program from OFFSET FWR:
Also, for formatting of a BIN-file of your finished firmware, you need to run an additional procedure. This
is configured in the project settings in the USER tab:
$K\ARM\ARMCC\bin\fromelf.exe --bin --output=@L.bin !L
This completes the configuration and the program will be successfully compiled. After compilation, an output BIN-file will be created that can be written into the crystal and the loader will be able to work with it. If it is required to close the software with a license key, you need to sign your firmware on our website.
For build utility programs for a service mode, you must apply other settings of entry point in the development environment. To do this, the parameter OFFSETJACK is used. All other settings remain the same.
As you can see above - the start of program corresponds to OFFSETJACK parameter, and the size is a fixed 0xA800. The beginning of a random RAM segment is also changed to REAL_RAM_START + JACK_SIZE and is equal to 0x2000A800. The size of the random RAM, in this case, is the rest of the segment of random RAM: REAL_RAM_SIZE - JACK_SIZE and is equal to 0x57FF.
In this case the program is completely placed in the RAM of the device.
If the DISABLE_IRQ parameter from the firmware file firmware.ini is used-you should enable interrupts
in your program. It is also desirable to adjust the address of the interrupt vectors table, despite of the
fact that the loader will make it also. In the process of initializing your SOFTWARE - VTOR may become
incorrect. For trouble-free operation, all firmware created for ST-ONE must start with lines:
int main(void){
__disable_irq();
SCB->VTOR = OFFSET;
__set_MSP(*((volatile uint32_t *) OFFSET));
__DSB ();
__enable_irq();
.....
.....
The OFFSET value is just taken from the OFFSET FWR and OFFSETJACK variables available in the readme.txt help file. In case of creating a JACK-firmware the OFFSET will be equal to OFFSETJACK. If the main firmware of the device is created, the OFFSET will be equal to OFFSET FWR.
It is recommended to develop and debug the main firmware without the participation of the loader. That is, to collect and flash the firmware into the crystal by programmator. In this case, you get a full functionality of the debugger and the offset and entry points remain the default for your chip. At the end of the development cycle, the firmware is assembled with a needed entry point (the start address) and a BIN-file is formed ready for download to the boards via ST-ONE.
Difficulties may arise with debugging of JACK-firmware. Because of the debugger cannot just put it in the SRAM of the controller and transfer the control. To do this, it is necessary to create a special INI-file and specify it to the development environment:
KEIL_ini.ini
/*----------------------------------------------------------------------------
Setup() configure PC & SP for RAM Debug
*----------------------------------------------------------------------------*/
FUNC void Setup (void) {
SP = _RDWORD(0x20000000); // Setup Stack Pointer
PC = _RDWORD(0x20000004); // Setup Program Counter
_WDWORD(0xE000ED08, 0x20000000); // Setup Vector Table Offset Register
}
// executes upon software RESET
FUNC void OnResetExec (void) {
Setup(); // Setup for Running
}
load %L incremental
Setup(); // Setup for Running
As you can see from the dump above, the stack pointer and the address of the interrupt vector table are equal to the JACK start address, and the start of the program is +4. Thus, using a special initialization file you can debug the code directly in the operational memory of the controller and get all the debugging capabilities. Reassembly of JACK with other parameters is not required for publishing, it is a ready executable code.