Compare commits

...

2 commits

Author SHA1 Message Date
1a980a9ffd new todo item added
Added todo for the documentation generation.
2024-11-10 12:49:39 -08:00
4e6e041073 Added an example linker file for ref
Going to use the example linker file for a refernce along with the ld
documentation.
2024-11-10 12:49:15 -08:00
3 changed files with 83 additions and 5 deletions

View file

@ -14,6 +14,8 @@
1. Clone/copy the repo locally.
2. Check the requirements to make sure you're development enviroment is ready.
3. Update the linker script files to target your current uC.
4. Change line 45 of `Doxyfile` with the project name.
5.
## Running Tests
@ -25,3 +27,5 @@
- [ ] Add messages for case where tool-chain is missing.
- [ ] Check for FreeBSD & Linux compat.
- [ ] Add in RTOS stuff.

63
example.ld Normal file
View file

@ -0,0 +1,63 @@
/* Define the memory regions: Flash and RAM */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
}
/* Define entry point (usually the reset handler defined in startup code) */
ENTRY(Reset_Handler)
/* Define the sections of the program */
SECTIONS
{
/* Code section, mapped to Flash memory */
.text :
{
KEEP(*(.isr_vector)) /* Vector table, which must be at the beginning of Flash */
*(.text) /* All code goes here */
*(.rodata) /* Read-only data (e.g., const variables) */
_etext = .; /* Mark the end of text section */
} > FLASH
/* Initialized data section, copied from Flash to RAM at startup */
.data :
{
_sdata = .; /* Start of data section */
*(.data) /* Initialized data */
_edata = .; /* End of data section */
} > RAM AT > FLASH
/* Uninitialized data section, placed in RAM but not stored in Flash */
.bss :
{
_sbss = .; /* Start of BSS */
*(.bss) /* Uninitialized data */
*(COMMON) /* Common symbols (zero-initialized) */
_ebss = .; /* End of BSS */
} > RAM
/* Stack section */
._stack :
{
. = ALIGN(8); /* Align to 8-byte boundary */
_estack = .; /* End of stack (top of the stack) */
. = . + 2048; /* Reserve 2 KB for stack */
_sstack = .; /* Start of stack */
} > RAM
/* Heap section */
.heap :
{
_sheap = .; /* Start of heap */
. = . + 2048; /* Reserve 2 KB for heap */
_eheap = .; /* End of heap */
} > RAM
}
/* Provide symbols to be used in the startup code */
PROVIDE(_stack_start = _sstack);
PROVIDE(_stack_end = _estack);
PROVIDE(_heap_start = _sheap);
PROVIDE(_heap_end = _eheap);

View file

@ -37,11 +37,22 @@ MEMORY
floating_point = 0;
SECTIONS
{
. = 0x10000;
.text : { *(.text) }
. = 0x8000000;
.data : { *(.data) }
.bss : { *(.bss) }
/* Code section, mapped to Flash memory */
.tect :
{
KEEP(*(.isr_vector)) /* Vector table, which must be at the beginning of Flash*/
*(.text) /* All code goes here */
*(.rodata) /* Read-only data (e.g., const vars) */
_etext = .; /* Mark the end of text section */
} > FLASH
/* Initialized data section, copied from Flash to RAM on startup. */
.data :
{
_sdata = .; /* Start of data section */
*(.data) /* Initialized data */
_edata = .; /* End of data section */
} > RAM AT > FLASH
}