Skip to content

Commit

Permalink
hacks for extra RAM usage - needs total overwrite of bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Jun 4, 2015
1 parent 10464ea commit 9c063c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions boards/PICO_R1_3.py
Expand Up @@ -20,7 +20,7 @@
'default_console' : "EV_SERIAL1",
'default_console_tx' : "B6",
'default_console_rx' : "B7",
'variables' : 3040,
'variables' : 4860,
'bootloader' : 1,
'binary_name' : 'espruino_%v_pico_1r3.bin',
'binaries' : [
Expand All @@ -42,12 +42,13 @@
'dac' : 0,
'saved_code' : {
'address' : 0x08004000,
'length' : 16384*7,
'page_size' : 16384, # size of pages
'page_number' : 1, # number of page we start at (0 based)
'pages' : 3, # number of pages we're using
'pages' : 4, # number of pages we're using
'flash_available' : 384 # binary will have a hole in it, so we just want to test against full size
},
'place_text_section' : 0x00010000, # note flash_available above
'place_text_section' : 0x00020000, # note flash_available above
};
# left-right, or top-bottom order
board = {
Expand Down
5 changes: 4 additions & 1 deletion scripts/build_platform_config.py
Expand Up @@ -92,6 +92,7 @@
flash_saved_code_sector = 11
# F4 has different page sizes in different places
flash_saved_code_pages = (flash_needed+flash_page_size-1)/flash_page_size
flash_saved_code_length = "(FLASH_PAGE_SIZE*FLASH_SAVED_CODE_PAGES)"
total_flash = board.chip["flash"]*1024

if "saved_code" in board.chip:
Expand All @@ -100,6 +101,8 @@
flash_saved_code_sector = board.chip["saved_code"]["page_number"]
flash_saved_code_pages = board.chip["saved_code"]["pages"]
flash_available_for_code = board.chip["saved_code"]["flash_available"]*1024
if "length" in board.chip["saved_code"]:
flash_saved_code_length = board.chip["saved_code"]["length"]
else:
flash_saved_code_start = "(FLASH_START + FLASH_TOTAL - FLASH_SAVED_CODE_LENGTH)"
flash_available_for_code = total_flash - (flash_saved_code_pages*flash_page_size)
Expand Down Expand Up @@ -254,7 +257,7 @@ def codeOutDevicePin(device, pin, definition_name):
codeOut("#define BOOTLOADER_SIZE "+str(common.get_bootloader_size(board)))
codeOut("#define ESPRUINO_BINARY_ADDRESS "+hex(common.get_espruino_binary_address(board)))
codeOut("")
codeOut("#define FLASH_SAVED_CODE_LENGTH (FLASH_PAGE_SIZE*FLASH_SAVED_CODE_PAGES)")
codeOut("#define FLASH_SAVED_CODE_LENGTH "+str(flash_saved_code_length))
codeOut("#define FLASH_SAVED_CODE_START "+str(flash_saved_code_start))
codeOut("#define FLASH_MAGIC_LOCATION (FLASH_SAVED_CODE_START + FLASH_SAVED_CODE_LENGTH - 4)")
codeOut("#define FLASH_MAGIC 0xDEADBEEF")
Expand Down

0 comments on commit 9c063c9

Please sign in to comment.