RL78/GCC related:

+ Add RL78G14 specific linker script.
+ Move the call to the function that sets up the clocks to before the code that sets up the .data and .bss sections.
This commit is contained in:
Richard Barry 2013-03-06 10:56:03 +00:00
parent 08b959f143
commit 3b9d0819c9
3 changed files with 129 additions and 17 deletions

View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="ASCII"?>
<com.renesas.linkersection.model:SectionContainer xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:com.renesas.linkersection.model="http:///LinkerSection.ecore" targets="GNU_RL78">
<sections name=".vec" isKeep="true">
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".vec"/>
</sections>
<sections name=".vects" isKeep="true">
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="4"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".vects"/>
</sections>
<sections name=".option_bytes" isKeep="true">
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="192"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".option_bytes"/>
</sections>
<sections name=".security_id" isKeep="true">
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="196"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".security_id"/>
</sections>
<sections name=".text">
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="216"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".text"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".text.*"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="etext"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
</sections>
<sections name=".init">
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.4"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".init"/>
</sections>
<sections name=".fini">
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.5"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".fini"/>
</sections>
<sections name=".got">
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.6"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".got"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".got.plt"/>
</sections>
<sections name=".rodata MAX(., 0x3000)">
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.7"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".rodata"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".rodata.*"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_erodata"/>
</sections>
<sections name=".eh_frame_hdr">
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.8"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".eh_frame_hdr"/>
</sections>
<sections name=".eh_frame">
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.9"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".eh_frame"/>
</sections>
<sections name=".jcr">
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.10"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".jcr"/>
</sections>
<sections name=".tors">
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.11"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__CTOR_LIST__"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="___ctors"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".ctors"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="___ctors_end"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__CTOR_END__"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__DTOR_LIST__"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="___dtors"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".dtors"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="___dtors_end"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__DTOR_END__"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_mdata"/>
</sections>
<sections name=".data_original" isKeep="true">
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="1023744"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_data_original"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".data_original"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".data_original.*"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_edata_original"/>
<reservedMemAddress xsi:type="com.renesas.linkersection.model:ReferencedLabelAddress" label="//@sections.12/@contents.12"/>
</sections>
<sections name="trace_buffer" isKeep="true">
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="1024768"/>
</sections>
<sections name=".data" isKeep="true">
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="1025792"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_data"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".data"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".data.*"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_edata"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
</sections>
<sections name=".bss">
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.15"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_bss"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".bss"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".bss.**"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="COMMON"/>
<contents xsi:type="com.renesas.linkersection.model:Keyword" text=". = ALIGN(2)"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_ebss"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_end"/>
</sections>
<sections name=".stack" isNoLoad="true">
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="1048064"/>
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_stack"/>
</sections>
</com.renesas.linkersection.model:SectionContainer>

View File

@ -217,6 +217,7 @@ short main( void )
ucTemp = RESF;
ucTemp = sizeof( char* );
ucTemp = sizeof( pdTASK_CODE );
#warning Take out all references to the P1 LED.
P1 &= 0xFE; PM1 &= 0xFE;
P1_bit.no0 = 1;
@ -226,7 +227,7 @@ short main( void )
/* First create the 'standard demo' tasks. These are used to demonstrate
API functions being used and also to test the kernel port. More information
is provided on the FreeRTOS.org WEB site. */
// vStartDynamicPriorityTasks();
vStartDynamicPriorityTasks();
#warning Runs if the debugger is not connected and vStartDynamicPriorityTasks() is commented out.
vStartPolledQueueTasks( tskIDLE_PRIORITY );
vCreateBlockTimeTasks();

View File

@ -8,8 +8,8 @@
/* */
/* This file is generated by e2studio. */
/* */
/***********************************************************************/
/***********************************************************************/
/*reset_program.asm*/
@ -18,11 +18,11 @@
.global _PowerON_Reset /*! global Start routine */
.short _PowerON_Reset
#ifdef CPPAPP
#ifdef CPPAPP
___dso_handle:
.global ___dso_handle
#endif
#endif
.extern _HardwareSetup /*! external Sub-routine to initialise Hardware*/
@ -30,9 +30,9 @@ ___dso_handle:
.extern _mdata
.extern _ebss
.extern _bss
.extern _edata
.extern _main
.extern _main
.extern _stack
.extern _exit
@ -40,7 +40,7 @@ ___dso_handle:
;; DE = end of list
;; BC = step direction (+2 or -2)
*/
.text
/* call to _PowerON_Reset */
@ -48,8 +48,11 @@ _PowerON_Reset:
/* initialise user stack pointer */
movw sp,#_stack /* Set stack pointer */
/* call the hardware initialiser */
call !!_HardwareSetup
nop
/* load data section from ROM to RAM */
/* load data section from ROM to RAM */
;; block move to initialize .data
;; we're copying from 00:[_romdatastart] to 0F:[_datastart]
@ -58,7 +61,7 @@ _PowerON_Reset:
sel rb0 /* ;;bank 0 */
movw de, #_mdata /* src ROM address of data section in de */
movw hl, #_data /* dest start RAM address of data section in hl */
sel rb1 /* bank 1 */
movw hl, #_data /* dest start RAM address of data section in hl */
movw ax, #_edata /* ;; size of romdata section in ax */
@ -79,7 +82,7 @@ _PowerON_Reset:
br $1b
1:
/* bss initialisation : zero out bss */
sel rb0 /* bank 0 */
movw hl, #_bss /* store the start address of bss in hl */
@ -101,10 +104,6 @@ _PowerON_Reset:
1:
sel rb0 /* bank 0 */
/* call the hardware initialiser */
call !!_HardwareSetup
nop
/* start user program */
movw ax, #0
@ -118,4 +117,4 @@ _PowerON_Reset:
_exit:
br $_exit
.end
.end