This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

J-Link lite under Eclipse

Hello,

I am porting a blinky program to my custom board having nRF51822. The program is compiled under Eclipse (+ GCC) and is downloaded to the board via J-Link Lite. But the program is halted as follows: ...Target halted (PC = 0xFFFFFFFE). I would like to know the reason and how to solve it.

I have two boards as follows: Board A: PCA10028 (Nordic Development Kit including SEGGER J-Link OB) Board B: A custom board having nRF51822 (connected with J-Link Lite)

When I compiled the blinky program with Keil, the same executable file could be download to Board A and Board B, and the program could run well on both boards. However, when I compiled the program with Eclipse+GCC, the executable program could be download to Board A and run well on the board. For Board B, the program halted at 0xFFFFFFFE.

I think that the custom board plus J-Link Lite is probably similar to PCA10028 and this seems to be proven by running the same executable file compiled by Keil. I expected naturally that GCC compiled program run on both boards. But the result is not so.

I am not sure the reason, but I assume that J-Link Lite has no GDB server capability but J-Link OB in PCA10028 has it. But if so, with Keil, why does the same program run on both boards?

I would appreciate having your advice and suggestion how to solve it. Than you.

  • Do you have a different version of the nrf51822 on your custom board, one with a different amount of RAM in it than on the PCA10028? If you do then you need to change the linker map file when you're using GCC so that the stack stays within the actual RAM on the chip. That's exactly the error I'd expect to see if you're trying to initialize the stack where there is no RAM. The GCC linker files tend to put the stack at the top of all available RAM, so if you get that wrong, the program won't run. Either Keil doesn't do that, or you have specified a smaller-RAM version of the chip when you're compiling in Keil so the image works on either board.

    And J-Link Lite has GDB server and all the other capabilities of the other JLinks, a Segger is a Segger is a Segger ,they all work about the same.

  • Thank you very much for your comment. My custom board has nrf51822 having 16KB RAM and nrf51422 of PCA10028 has 32KB RAM. I have forgotten the fact. Your comment is correct. The blinky program compiled by GCC runs well on the custom board now. It looks that there is difference between the executable object by Keil and the one by GCC on how to treat RAM. If you know it, could you please let me know it? Thank you very much again for your advice. Best regards.

  • I told you what the difference is in my answer. There are two possible differences either

    1. the Keil version was compiled with the profile for a 16kB chip and the GCC one was compiled with a link map for the 32Kb chip. The 16k version will run on either OR

    2. Keil puts the stack directly after the last block of allocated memory, which in the case of blinky is very low down, and doesn't use the rest of the 32Kb because it doesn't need it, however the GCC linker map always puts the stack at the very end of user memory (which is generally a good idea) so if you tell it you have the wrong amount of RAM, it doesn't work.

  • Thank you very much again for you additional comment. Best regards.

Related