Reply by "chr...@gmail.com"●January 18, 20122012-01-18
Phil , Richard
Thank you for your help..
I got a very nice lesson...
I wanted to run everything from sram/sdram just because
the upload speed is fast and will cut down much time
of the debugging cycle, not to mention the
unlimited breakpoints.
I followed Richards approach and the build
was successful. I have also changed a bit the
linker script.
changed the line:
} >sdram AT> ram
to
}>sdram
in the prog: section
Anyone who might be helped by this kind of setup
is free to contact me
Presumably _start is too far away for your 'b' instruction.
Therefore,
if possible, use the linker to keep _start closer, or try changing to an
ldr instruction (if that would work for the Reset, don't see why not).
Replace with:
ldr pc, _start_const
then somewhere after the vector table:
_start_const: .word _start /* Load the 32bit address */
Regards,
Richard.
+ http://www.FreeRTOS.org
Designed for Microcontrollers.
More than 7000 downloads per month.
Reply by Phil Young●January 18, 20122012-01-18
Requesting a build for large memory models will not help fix problems in
your assembler, it will only instruct the compiler to generate assembler
that supports longer offsets.
By the name of the file it sounds like this is part of the startup code, not
a file generated by a compiler, so it will not help to change the compiler
settings.
Since you are having issues in the init file which is written in assembler
you need to modify the .s file to branch to an address that it in range
where you can then perform a second long jump to your code, or simply change
the instruction to do a long jump.
I'm not familiar with the particular init file so don't know which
option is
best, if the branch is part of a vector table then you will need to use the
first option, if it's not part of the vector table then just change the
branch itself.
Regards
Phil.
From: l... [mailto:l...] On Behalf Of
c...@gmail.com
Sent: 17 January 2012 22:19
To: l...
Subject: [lpc2000] LPC2478 debugging FreeRTOS in external SDRAM with
openocd-0.5.0
Hello Friends,
I've build a PCB around a LPC2478 with 64MB SDRAM, 16MB NOR Flash and a
TFT
screen.
I'm using eclipse, openocd-0.5.0, code sourcery toolchain under Linux
1) By doing the SDRAM init phase in the openocd cfg file, I have managed to
debug
led flasher programs in SDRAM. These small programs do not use interrupts.
So,
the linker file is quite simple.
2) I have also successfully run FreeRTOS both in internal SRAM and internal
Flash. I used/modified
linker files that existed in the FreeRTOS distribution.
Concerning 1 and 2 means that my setup is pretty solid for debugging.
What I would like to do, is to be able to debug FreeRTOS in SDRAM, having
all interrupt vectors in SRAM (MEMMAP = 2).
But I have no solid background on linker scripts and startup code.
When I compile with the following ld script I get the error :
Description Resource Path Location Type
relocation truncated to fit: R_ARM_JUMP24 against `.text'
SBC_lpc2478_v0.1
line 139, external location:
/tmp/ccSepNbk.o:/data/LPC2478/SBC_lpc2478_v0.1/boot_orig.s C/C++ Problem
i tried the -mlong-calls but had no success.
on 139 line in boot_orig.s is the jump to startup
( b _start /* reset - _start */)
Here is my linker script and below that, my startup code
any thoughts or examples or documentation greatly appreciated
(to be honest I tried to read the ld manual from GNU but I got lost... )
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(32 / 8);
_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
__undf: b . /* undefined */
__pabt: b . /* program abort */
__dabt: b . /* data abort */
__fiq: b . /* FIQ */
-------------- end of boot.s ---------------------
Reply by "chr...@gmail.com"●January 18, 20122012-01-18
Hello Friends,
I've build a PCB around a LPC2478 with 64MB SDRAM, 16MB NOR Flash and a
TFT
screen.
I'm using eclipse, openocd-0.5.0, code sourcery toolchain under Linux
1) By doing the SDRAM init phase in the openocd cfg file, I have managed to
debug
led flasher programs in SDRAM. These small programs do not use interrupts.
So,
the linker file is quite simple.
2) I have also successfully run FreeRTOS both in internal SRAM and internal
Flash. I used/modified
linker files that existed in the FreeRTOS distribution.
Concerning 1 and 2 means that my setup is pretty solid for debugging.
What I would like to do, is to be able to debug FreeRTOS in SDRAM, having
all interrupt vectors in SRAM (MEMMAP = 2).
But I have no solid background on linker scripts and startup code.
When I compile with the following ld script I get the error :
Description Resource Path Location Type
relocation truncated to fit: R_ARM_JUMP24 against `.text'
SBC_lpc2478_v0.1
line 139, external location:
/tmp/ccSepNbk.o:/data/LPC2478/SBC_lpc2478_v0.1/boot_orig.s C/C++ Problem
i tried the -mlong-calls but had no success.
on 139 line in boot_orig.s is the jump to startup
( b _start /* reset - _start */)
Here is my linker script and below that, my startup code
any thoughts or examples or documentation greatly appreciated
(to be honest I tried to read the ld manual from GNU but I got lost... )
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(32 / 8);
_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;