0
votes

I got trouble with making ARM execute instructions stored in the external RAM.

I wrote a small program that can blink led based on LPC3250 architecture. The program run properly if I download it to the internal RAM of LPC3250 via IAR online-debug. But it cannot run if I put it in the external RAM.

The external RAM is a block of SRAM built in the SPARTAN-6(Xilinx FPGA), DATA width is 32-bits, memory depth is 4096, means address width is 12-bits. This RAM can be initialized through a COE file.

So I get the BIN file of the Program via IAR, then convert the BIN file into a COE file, which will be used to initialize the SRAM. But every time, the processor just execute the three E59FF018(LDR PC,(PC, #0X18)) instructions at the beginning of SRAM, cannot jump to the main().

I cannot figure out why. As LPC3250 required, I add 4 bytes(0x13579BD2) to the beginning of BIN file via UltraEditor before generating the COE file. The UM of LPC3250 said it will start to execute the code at the address 0xE0000004 of external ram if the value in 0xE0000000 is 0x13579BD2. From the COE file I can see there are 5 same instructions(E59FF018) behind 0x13579BD2.

Please tell me where I'm wrong and What I need to do exactly to make it right.

1
you have an LPC3250 and an fpga tied to the external interface? where an SDRAM would be? In order to execute from the external ram it has to fail to find code elsewhere, have you probed to see that it is actually trying to read from the external interface? - old_timer
this is according to the LPC3250 users manual. - old_timer
Yeah, I can see that the processor tried to read from the external SRAM. The external SRAM is created by using a IP core(Block Memory). And I do not use SDRAM. And there is no SPI device. I'm sure that the processor accessed the first four 32-bits words in the external SRAM. - Wtswkz
Now, I guess it may be because I don't do the right configuration for IAR linker if I want to execute codes from external RAM. Actually I don't know how to config the linker. Any advice? - Wtswkz
I use gnu tools not IAR, dont know how to control the IAR linker. - old_timer

1 Answers

0
votes

Well, I almost forget that I have asked this question 3 years ago. Now, I have found the cause. It's about the Address signal output from the ARM. I misunderstand that the Address signal from the ARM is Byte addressing, actually it's Double words addressing. So I shouldn't dismiss the low two bits of the Address signal when processing in the FPGA, it has been dismissed already by the ARM.

In a word, my problem is an addressing problem.