aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/lpc43xx/Makefile2
-rw-r--r--lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld10
-rw-r--r--lib/lpc43xx/vector.c3
3 files changed, 9 insertions, 6 deletions
diff --git a/lib/lpc43xx/Makefile b/lib/lpc43xx/Makefile
index e8bd8fc..91169d4 100644
--- a/lib/lpc43xx/Makefile
+++ b/lib/lpc43xx/Makefile
@@ -25,7 +25,7 @@ PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
-CFLAGS = -O2 -g -Wall -Wextra -I../../include -fno-common \
+CFLAGS = -O2 -g3 -Wall -Wextra -I../../include -fno-common \
-mcpu=cortex-m4 -mthumb -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD \
-mfloat-abi=hard -mfpu=fpv4-sp-d16
diff --git a/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld b/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld
index f833aaf..850218b 100644
--- a/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld
+++ b/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld
@@ -56,26 +56,26 @@ SECTIONS
_etext_ram = . + ORIGIN(ram);
_etext_rom = . + ORIGIN(rom_flash);
- . = ORIGIN(ram);
-
.data : {
_data = .;
*(.data*) /* Read-write initialized data */
. = ALIGN(4);
_edata = .;
- } >ram AT >rom
+ } >ram_data AT >rom
.bss : {
+ . = _edata;
*(.bss*) /* Read-write zero initialized data */
*(COMMON)
. = ALIGN(4);
_ebss = .;
- } >ram
+ } >ram_data
/* exception unwind data - required due to libgcc.a issuing /0 exceptions */
.ARM.extab : {
+ . = _ebss;
*(.ARM.extab*)
- } >ram
+ } >ram_data
/*
* The .eh_frame section appears to be used for C++ exception handling.
diff --git a/lib/lpc43xx/vector.c b/lib/lpc43xx/vector.c
index 631e54e..daef5a9 100644
--- a/lib/lpc43xx/vector.c
+++ b/lib/lpc43xx/vector.c
@@ -171,6 +171,9 @@ void reset_handler(void)
if( (&_etext_ram-&_text_ram) > 0 )
{
src = &_etext_rom-(&_etext_ram-&_text_ram);
+ /* Change Shadow memory to ROM (for Debug Purpose in case Boot has not set correctly the M4MEMMAP because of debug) */
+ CREG_M4MEMMAP = (unsigned long)src;
+
for(dest = &_text_ram; dest < &_etext_ram; )
{
*dest++ = *src++;