Skip to content

Fix GCC_ARM non-contiguous FW for K64F and K66F #13832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

#if !defined(MBED_APP_START)
#define MBED_APP_START 0
#elif MBED_APP_START > 0 && MBED_APP_START < 0x410
#error MBED_APP_START too small and will overwrite interrupts and flash config
#endif

#if !defined(MBED_APP_SIZE)
Expand All @@ -63,12 +65,21 @@
#define m_interrupts_start MBED_APP_START
#define m_interrupts_size 0x00000400

#if MBED_APP_START == 0

#define m_flash_config_start MBED_APP_START + 0x400
#define m_flash_config_size 0x00000010

#define m_text_start MBED_APP_START + 0x410
#define m_text_size MBED_APP_SIZE - 0x410

#else

#define m_text_start MBED_APP_START + 0x400
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this 0x400 padding left (due to vectors, that are used below in ROM) ? Its not present in GCC ARM if MBED_APP_SIZE is 0

Copy link
Contributor Author

@moshe-shahar moshe-shahar Oct 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the interrupts area. In GCC_ARM I moved the interrupts to the .text area.
In ARM, everything was in LR_IROM1 from the beginning.

#define m_text_size MBED_APP_SIZE - 0x400

#endif

#define m_interrupts_ram_start 0x1FFF0000
#define m_interrupts_ram_size __ram_vector_table_size__

Expand Down Expand Up @@ -100,9 +111,11 @@ LR_IROM1 m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; lo
VECTOR_ROM m_interrupts_start m_interrupts_size { ; load address = execution address
* (RESET,+FIRST)
}
#if MBED_APP_START == 0
ER_m_flash_config m_flash_config_start FIXED m_flash_config_size { ; load address = execution address
* (FlashConfig)
}
#endif
ER_IROM1 m_text_start m_text_size { ; load address = execution address
* (InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ __stack_size__ = MBED_CONF_TARGET_BOOT_STACK_SIZE;

#if !defined(MBED_APP_START)
#define MBED_APP_START 0
#elif MBED_APP_START > 0 && MBED_APP_START < 0x410
#error MBED_APP_START too small and will overwrite interrupts and flash config
#endif

#if !defined(MBED_APP_SIZE)
Expand All @@ -72,9 +74,13 @@ M_CRASH_DATA_RAM_SIZE = 0x100;
/* Specify the memory areas */
MEMORY
{
#if MBED_APP_START == 0
m_interrupts (RX) : ORIGIN = MBED_APP_START, LENGTH = 0x400
m_flash_config (RX) : ORIGIN = MBED_APP_START + 0x400, LENGTH = 0x10
m_text (RX) : ORIGIN = MBED_APP_START + 0x410, LENGTH = MBED_APP_SIZE - 0x410
#else
m_text (RX) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
#endif
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00030000
}
Expand All @@ -89,6 +95,7 @@ SECTIONS
. = ALIGN(8);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(8);
#if MBED_APP_START == 0
} > m_interrupts

.flash_config :
Expand All @@ -97,8 +104,9 @@ SECTIONS
KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */
. = ALIGN(8);
} > m_flash_config

/* The program code and other data goes into internal flash */
#else
} > m_text
#endif
.text :
{
. = ALIGN(8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
#endif

#if !defined(MBED_APP_START)

#define MBED_APP_START 0
#elif MBED_APP_START > 0 && MBED_APP_START < 0x410
#error MBED_APP_START too small and will overwrite interrupts and flash config
#endif

#if !defined(MBED_APP_SIZE)
Expand All @@ -75,12 +78,21 @@
#define m_interrupts_start MBED_APP_START
#define m_interrupts_size 0x00000400

#if MBED_APP_START == 0

#define m_flash_config_start MBED_APP_START + 0x400
#define m_flash_config_size 0x00000010

#define m_text_start MBED_APP_START + 0x410
#define m_text_size MBED_APP_SIZE - 0x410

#else

#define m_text_start MBED_APP_START + 0x400
#define m_text_size MBED_APP_SIZE - 0x400

#endif

#define m_interrupts_ram_start 0x1FFF0000
#define m_interrupts_ram_size __ram_vector_table_size__

Expand All @@ -104,9 +116,11 @@ LR_IROM1 m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; load
VECTOR_ROM m_interrupts_start m_interrupts_size { ; load address = execution address
* (RESET,+FIRST)
}
#if MBED_APP_START == 0
ER_m_flash_config m_flash_config_start FIXED m_flash_config_size { ; load address = execution address
* (FlashConfig)
}
#endif
ER_IROM1 m_text_start m_text_size { ; load address = execution address
* (InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ __ram_vector_table__ = 1;

#if !defined(MBED_APP_START)
#define MBED_APP_START 0
#elif MBED_APP_START > 0 && MBED_APP_START < 0x410
#error MBED_APP_START too small and will overwrite interrupts and flash config
#endif

#if !defined(MBED_APP_SIZE)
Expand All @@ -74,9 +76,13 @@ M_CRASH_DATA_RAM_SIZE = 0x100;
/* Specify the memory areas */
MEMORY
{
#if MBED_APP_START == 0
m_interrupts (RX) : ORIGIN = MBED_APP_START, LENGTH = 0x400
m_flash_config (RX) : ORIGIN = MBED_APP_START + 0x400, LENGTH = 0x10
m_text (RX) : ORIGIN = MBED_APP_START + 0x410, LENGTH = MBED_APP_SIZE - 0x410
#else
m_text (RX) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
#endif
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00030000
}
Expand All @@ -91,6 +97,7 @@ SECTIONS
. = ALIGN(8);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(8);
#if MBED_APP_START == 0
} > m_interrupts

.flash_config :
Expand All @@ -99,7 +106,9 @@ SECTIONS
KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */
. = ALIGN(8);
} > m_flash_config

#else
} > m_text
#endif
.text :
{

Expand Down