Samraksh / eMote

eMote OS -- Multiple Ports (using .NET MF v4.3)
0 stars 0 forks source link

configuration files #24

Open ChrisAtSamraksh opened 11 years ago

ChrisAtSamraksh commented 11 years ago

If the configuration files for code / memory placement are changed, this change appears to need the change reflected in both the tinybooter and tinyclr.

Upon removal of the NOR external memory the radio would not initialize properly after the configuration files were changed and a new tinybooter and tinyclr were programmed.

MichaelAtSamraksh commented 11 years ago

I propose the relocation issue be fixed via automatic configuration from platform_selector.h

Benefit: Time saved in preventing the relocation config problem happening in the future to someone else. This is not the last time the address space layout will change. Benefit: We can trim the wasted memory region that occurs between the end of TinyBooter and the beginning of TinyCLR. Right now TinyCLR starts at 0x0802 0000 which makes it human friendly, but really TinyCLR should start at 0x0800 0000 + sizeof(TinyBooter).

I looked into code/memory placement when I removed the tinybooter in my private build last month. While the TINYCLR_SOLO preprocessor definition helps, the XML scatterfile configurations need to be conditionally changed to match the configuration set by the TINYCLR_SOLO preprocessor definition. Both the XML scatterfile for TinyCLR and the XML scatterfile for TinyBooter need to be changed to accommodate shifting native applications around.

#ifdef TINYCLR_SOLO
    *(__IO uint32_t *) VectorTableOffsetRegister |= (uint32_t) 0;
#else
    *(__IO uint32_t *) VectorTableOffsetRegister |= (uint32_t) TINYCLR_OFFSET;
#endif
#define TINYCLR_OFFSET 0x20000
#ifndef TINYCLR_OFFSET
#define TINYCLR_OFFSET 0x20000
#endif