Using an IDE and JTAG debugging to develop RLP code

Hi everybody.

We have just started experimenting with RLP on EMX module and would like to set up an environment that allowed us to debug native code before deploying on EMX module.

Since Yagarto way to set up an environment is not so easy, we’d like to use CrossWorks for ARM 2.0 IDE to deploy native code on a Embedded Artists LPC2478 board, just to use exactly same target processor for code generation.

We tried to build a proof-of-concept sample that includes RLP.h (for prototypes and signatures), a simple RLP.c with native call implementation and a main.c tester that let us to simulate loading and calling of native module from .NET MF. We succeeded in debugging on EA boards via JTAG very easily, but
generated ELF file cannot be loaded by RLP subsystem on EMX (FEZ-Cobra). It raises an exception.

Looking at .lds linker script and to makefile we know there must be something that breaks ELF loading, but we don’t know what.

Additionally, it seems not so simple to use an external linker script in CrossWorks and not possible at all to import a MAKEFILE.

Any suggestion?

You will need to modify CrossWorks project settings to place the memory regions exactly to where EMX expects them to be.

I actually done exactly what you are trying to do before and use crossworks too. This was fro a video playback project where I use crossworks to test out the video decoding libs and then when testing was done, we moved the ELF to RLP. This was years ago so I do not remember much

…this can get one step crazier than this! You can step in C# code in visual studio using USB cable and, at the same time and and on the same target, you can step in RLP code using JTAG and CrossWorks. Of course, explaining this will need 10 pages and a day of work!

Along these same lines, the Cobra board does not have a JTAG connector so how can JATG be used with this board?

Regards,
Synapsys

The JTAG pins are on the EMX module. A 30 minute work from experience hardware engineer and you will have JTAG. It is still easier to use your board for RLP testing though.

Thanks for the reply Gus.

[quote]…this can get one step crazier than this! You can step in C# code in visual studio using USB cable and, at the same time and and on the same target, you can step in RLP code using JTAG and CrossWorks. Of course, explaining this will need 10 pages and a day of work!
[/quote]

This is exactly what I want to do :smiley:

Then is it correct to assume that in order to use JTAG with the Cobra it is necessary to solder wires directly to the EMX module and run them to a 20-pin JTAG format header as indicated on the EMX dev board schematic?

Regards,
Synapsys

Yes or use the dev board.

OK, we did it.

At [url]http://dl.dropbox.com/u/7414592/Embedded/RLPExample_Yagarto_and_Crossworks.rar[/url] you can download a complete example containing managed solution and 2 native projects, sharing source code (i.e. RLPExample.c and RLP.h), for Yagarto (in root directory) and CrossWorks IDE (in CW folder).

It was tested only on EMX module but it should work with on USBizi too with little or no modifications.

Great work

This is something I should blog about

We just updated the previous download adding a new CrossWorks project that uses GHI linker script as external linker script.

It is by far the quickest approach since it doesn’t require authoring custom MemoryMap and SectionPlacement XML files.

Thanks for the great work Innovative!

Question, what JATG adapter did you use to test with?

Regards,
Synapsys

I didn’t know you can import a linker script into crossworks :slight_smile: This is good news

Synapsys:

We have got several JTAG adapters, even if some of them are actually chinese clones of original ones, but at this time J-LInk seems to be the most adopted by IDEs.

Gus:

We just purchased an EMX Dev Board with JTAG support: is there something we 'll have to do to “enable” JTAG or is it enabled by default?

I read some forum post concerning JTAG protection levels to avoid risk of flash cloning, but I don’t know if such protection can limit RLP debugging capabilities.

I do not recommend using JTAG on EMX. Why? To use JTAG, you probably need to initialize SDRAM and FLASH and you need to know about the internal connection (schematics ) of EMX. So even if you have JTAG working then what would be the next step?

It is much easier to use your other board which is made specifically for JTAG purposes.

[quote]I do not recommend using JTAG on EMX. Why? To use JTAG, you probably need to initialize SDRAM and FLASH and you need to know about the internal connection (schematics ) of EMX. So even if you have JTAG working then what would be the next step?
[/quote]

So what you’re saying Gus is you don’t recommend using JTAG on a Cobra for debugging purposes. Is that correct?

Regards,
Synapsys

Thanks for the reply Innocvative :slight_smile:

I’m trying to keep the cost of entry into RLP development to a minimum. After searching the Internet I discovered a Wiggler clone circuit that I can build out of junk box parts. It uses the parallel port which my primary development system doesn’t have but I have older machines I can use.

Since Corssworks has a $150 license fee after the trial period I am going to try using Eclipse with OpenOCD.

Regards,
Synapsys

Yes correct. I know I said you can solder wires to get JTAG and that is easy but I wasn’t thinking of the more info you need after wiring the JTAG

[quote]Yes correct. I know I said you can solder wires to get JTAG and that is easy but I wasn’t thinking of the more info you need after wiring the JTAG
[/quote]

Exactly what info is needed after wiring the JTAG? The schematics for the EMX module are available on the GHI website. And the JTAG connector is available on the EMX dev board (although it appears not to be installed). Is there some firmware difference between the EMX module on the EMX dev board and the Cobra that would prevent JTAG from working?

I am (was?) planning on using RLP to perform high speed I/O (in short bursts) which would require realtime in circuit debugging. It appears that RLP is okay if you are running code that can be debugged and tested on other hardware (such as a strictly arithmetic algorithm). But, in my opinion, RLP is relatively useless on a Cobra for debugging hardware dependant code without access to JTAG :’(

Regards,
Synapsys

Not being able to debug is not the end of the world.

In the past I’ve programmed a LCD controller and graphical user interface with RS485 communication etc. Without being able to debug a single line.

Put some structure in your code and test small pieces before you put them togetter. Testing can be done by toggling output lines. You could connect a led array to a couple of outputs so you can visualise your program flow.

EMX schematics are not available

[quote]Not being able to debug is not the end of the world.
[/quote]
I never intended to imply it was :-[

[quote]In the past I’ve programmed a LCD controller and graphical user interface with RS485 communication etc. Without being able to debug a single line.
[/quote]

I’ve done my share of “blind” debugging in the past. I’ve been a computer systems engineer since the early 70’s (now retired). I realize that it is possible to implement code without the aid of a debugger. However it appears to me that since the EMX module has JTAG hardware (built into the ARM micro) that tool should be available. If there is some reason why it can’t be I simply wanted to know the reason.

Regards,
Synapsys