-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bootloader datagram setup * datagram class complete with test cases * bootloader progress * remove crc32 from can_datagram.py + modified unit test * bootloader datagram setup * datagram class complete with test cases * bootloader progress * complete flash_application code, unit tests required * add jump application, both flash and jump app needs testing * test jump application, valid results * complete unit tests and remove typeerrors for flash app * add and test multi-board flashing and jumping * add and test validation static methods * fix crc bits for can_datagram.py * add state machine for bootloader * add BOOTLOADER_FLASH_COMPLETE state for the state machine * [API/CLI] Redid start and data messaging. Needs new tests. Begun API + Flash devlopment * [DATA STATES] Seperated first data msg and following messages with arbitration id * [JUMP APP/START] Wrote brief skeleton functions, needs more error handling * [ADDED BACK DATA_READY STATE FOR SIMPLICITY] * [LINKERSCRIPTS + SCON CHANGES FOR APPLICTION/BOOT FLASHING] * [JUMP APPLICATION ASSEMBLY AND BAREMETAL CAN DRIVER] * need to fix packet loss in can transmission * [Formatting] * BOOTLOADER * Semi-working * BOOTLOADER IS WORKING LETS GO * Major cleanup * formatingg/linting * fixed small changes * formatting * Build fix * build change * build system changes --------- Co-authored-by: Your Name <[email protected]> Co-authored-by: Aditya Sen <[email protected]>
- Loading branch information
1 parent
c7862e5
commit 7a0a7ae
Showing
48 changed files
with
2,199 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Message Definitions in plaintext are on the wiki at: | ||
# https://uwmidsun.atlassian.net/l/cp/Pxn8Xhm8 | ||
# | ||
# If you are making changes to this file please update the corresponding entry | ||
# on the wiki. If you need to add a new message use a reasonable | ||
# reserved ID. The higher ID the lower the priority. Generally | ||
# - 0-13: Critical messages (have ACK) | ||
# - 14-30: Actionable messages (trigger a change in another system) | ||
# - 30-63: Data messages (usually not actionable by an onboard device) | ||
|
||
--- | ||
Messages: | ||
bootloader_start: | ||
id: 30 | ||
target: | ||
bootloader: | ||
watchdog: 0 | ||
critical: true | ||
signals: | ||
data0: | ||
length: 8 | ||
data1: | ||
length: 8 | ||
data2: | ||
length: 8 | ||
data3: | ||
length: 8 | ||
data4: | ||
length: 8 | ||
data5: | ||
length: 8 | ||
data6: | ||
length: 8 | ||
data7: | ||
length: 8 | ||
bootloader_data: | ||
id: 31 | ||
target: | ||
bootloader: | ||
watchdog: 0 | ||
critical: true | ||
signals: | ||
data0: | ||
length: 8 | ||
data1: | ||
length: 8 | ||
data2: | ||
length: 8 | ||
data3: | ||
length: 8 | ||
data4: | ||
length: 8 | ||
data5: | ||
length: 8 | ||
data6: | ||
length: 8 | ||
data7: | ||
length: 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
ENTRY(Reset_Handler) | ||
|
||
_bootloader_size = 11K; | ||
|
||
_flash_start = 0x08000000; | ||
_flash_size = 64K; | ||
_flash_page_size = 1K; | ||
|
||
_ram_start = 0x20000000; | ||
_ram_size = 20K; | ||
|
||
_bootloader_start = _flash_start; | ||
_application_start = _bootloader_start + _bootloader_size; | ||
|
||
_application_size = _flash_size - (_application_start - _flash_start); | ||
|
||
_vector_table_size = 0xEC; /* used for relocating the vector table to RAM for the application */ | ||
|
||
/* TODO: explicitly set aside the last page for calib */ | ||
|
||
MEMORY | ||
{ | ||
BOOTLOADER (rx) : ORIGIN = _flash_start, LENGTH = _bootloader_size | ||
APPLICATION (rx) : ORIGIN = _application_start, LENGTH = _application_size | ||
RAM (rwx) : ORIGIN = _ram_start, LENGTH = _ram_size | ||
} | ||
|
||
/* highest address of the user mode stack */ | ||
_estack = _ram_start + _ram_size; |
141 changes: 141 additions & 0 deletions
141
platform/linker_scripts/bootloader/sections_flash_application.ld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
/* | ||
Linker subscript for section definitions for the bootloaded application. | ||
See https://uwmidsun.atlassian.net/l/c/mHxmqjvn for more information. | ||
*/ | ||
|
||
SECTIONS | ||
{ | ||
/* The vector table stored at .isr_vector must end up at the beginning of the application flash. | ||
This isn't at address 0, but the bootloader will set the vector table here when jumping to the | ||
application's reset handler. */ | ||
.isr_vector : | ||
{ | ||
. = ALIGN(4); | ||
KEEP(*(.isr_vector)) /* Startup code */ | ||
. = ALIGN(4); | ||
} >APPLICATION | ||
|
||
/* application program code is stored in the .text section, which goes to application flash */ | ||
.text : | ||
{ | ||
. = ALIGN(4); | ||
*(.hardfault) /* Hardfault handlers */ | ||
*(.text) /* normal code */ | ||
*(.text.*) /* -ffunction-sections code */ | ||
*(.rodata) /* read-only data (constants) */ | ||
*(.rodata*) /* -fdata-sections read only data */ | ||
*(.glue_7) /* TBD - needed ? */ | ||
*(.glue_7t) /* TBD - needed ? */ | ||
|
||
/* Necessary KEEP sections (see http://sourceware.org/ml/newlib/2005/msg00255.html) */ | ||
KEEP (*(.init)) | ||
KEEP (*(.fini)) | ||
|
||
. = ALIGN(4); | ||
_etext = .; | ||
/* This is used by the startup in order to initialize the .data section */ | ||
_sidata = _etext; | ||
} >APPLICATION | ||
|
||
/* Dummy section to provide an offset for the vector table at the start of RAM. | ||
The bootloader relocates the vector table to the start of RAM, so the .data section needs to start | ||
after the vector table. This phony section increments the RAM counter to accomplish this. */ | ||
.data_phony : AT ( _sidata ) | ||
{ | ||
. += _vector_table_size; | ||
} >RAM | ||
|
||
/* This is the initialized data section | ||
The program executes knowing that the data is in the RAM | ||
but the loader puts the initial values in the APPLICATION flash. | ||
It is one task of the startup to copy the initial values from flash to RAM. */ | ||
.data : AT ( _sidata ) | ||
{ | ||
. = ALIGN(4); | ||
/* This is used by the startup in order to initialize the .data secion */ | ||
_sdata = .; | ||
_data = .; | ||
|
||
*(.data) | ||
*(.data.*) | ||
*(.RAMtext) | ||
|
||
. = ALIGN(4); | ||
/* This is used by the startup in order to initialize the .data secion */ | ||
_edata = .; | ||
} >RAM | ||
|
||
/* This is the uninitialized data section */ | ||
.bss : | ||
{ | ||
. = ALIGN(4); | ||
/* This is used by the startup in order to initialize the .bss secion */ | ||
_sbss = .; | ||
__bss_start__ = .; | ||
_bss = .; | ||
*(.bss) | ||
*(.bss.*) /* patched by elias - allows the use of -fdata-sections */ | ||
*(COMMON) | ||
|
||
. = ALIGN(4); | ||
/* This is used by the startup in order to initialize the .bss secion */ | ||
_ebss = . ; | ||
__bss_end__ = .; | ||
} >RAM | ||
|
||
.eh_frame : | ||
{ | ||
. = ALIGN(4); | ||
KEEP (*(.eh_frame)) | ||
} >RAM | ||
|
||
PROVIDE ( end = _ebss ); | ||
PROVIDE ( _end = _ebss ); | ||
|
||
__exidx_start = .; | ||
__exidx_end = .; | ||
|
||
/* after that it's only debugging information. */ | ||
|
||
/* remove the debugging information from the standard libraries */ | ||
/DISCARD/ : | ||
{ | ||
libc.a ( * ) | ||
libm.a ( * ) | ||
libgcc.a ( * ) | ||
} | ||
|
||
/* Stabs debugging sections. */ | ||
.stab 0 : { *(.stab) } | ||
.stabstr 0 : { *(.stabstr) } | ||
.stab.excl 0 : { *(.stab.excl) } | ||
.stab.exclstr 0 : { *(.stab.exclstr) } | ||
.stab.index 0 : { *(.stab.index) } | ||
.stab.indexstr 0 : { *(.stab.indexstr) } | ||
.comment 0 : { *(.comment) } | ||
/* DWARF debug sections. | ||
Symbols in the DWARF debugging sections are relative to the beginning | ||
of the section so we begin them at 0. */ | ||
/* DWARF 1 */ | ||
.debug 0 : { *(.debug) } | ||
.line 0 : { *(.line) } | ||
/* GNU DWARF 1 extensions */ | ||
.debug_srcinfo 0 : { *(.debug_srcinfo) } | ||
.debug_sfnames 0 : { *(.debug_sfnames) } | ||
/* DWARF 1.1 and DWARF 2 */ | ||
.debug_aranges 0 : { *(.debug_aranges) } | ||
.debug_pubnames 0 : { *(.debug_pubnames) } | ||
/* DWARF 2 */ | ||
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } | ||
.debug_abbrev 0 : { *(.debug_abbrev) } | ||
.debug_line 0 : { *(.debug_line) } | ||
.debug_frame 0 : { *(.debug_frame) } | ||
.debug_str 0 : { *(.debug_str) } | ||
.debug_loc 0 : { *(.debug_loc) } | ||
.debug_macinfo 0 : { *(.debug_macinfo) } | ||
/* SGI/MIPS DWARF 2 extensions */ | ||
.debug_weaknames 0 : { *(.debug_weaknames) } | ||
.debug_funcnames 0 : { *(.debug_funcnames) } | ||
.debug_typenames 0 : { *(.debug_typenames) } | ||
.debug_varnames 0 : { *(.debug_varnames) } | ||
} |
Oops, something went wrong.