Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

CM510 and AVR Dargon

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
5 postsPage 1 of 1
5 postsPage 1 of 1

CM510 and AVR Dargon

Post by angelocarenzo » Thu Jan 05, 2012 4:40 pm

Post by angelocarenzo
Thu Jan 05, 2012 4:40 pm

Hello to all forum people;
fisr of all I would like to congratulate with RoboSavvy forum.
Here I found some important and interestings issues.

I'm university student of Genoa (Italy).
I'm doing a sort of driver for Bioloid control in C language for an University exam.
I tried my code with 2 motor AX-12. I downloaded the code and something work well and something doesn't work.

Now I have a big problem.
:?:

Code: Select all
I have to verify with the Jtag where are my bugs.

I bought the AvrDargon Jtag.
I connected the Avr Dargon with the Biloid digital card with wires in ISP programming mode: MOSI, MISO, SCk etc...

Using Avr 5.0 and Avr Programming the interface show me a message:
Timestamp: 2012-01-05 16.33.05.545
Severity: ERROR
ComponentId: 20100
StatusCode: 0

Programming session setup failed: TCF command: Device:startSession failed: Code:1 ,Service: ,Message from peer:Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00


Is there something that try to connect tha Avr Dragon and CM510?
Any suggestions would be more appreciate!!!

Many thanks in advanced.
Reagrds.
Angelo.
Hello to all forum people;
fisr of all I would like to congratulate with RoboSavvy forum.
Here I found some important and interestings issues.

I'm university student of Genoa (Italy).
I'm doing a sort of driver for Bioloid control in C language for an University exam.
I tried my code with 2 motor AX-12. I downloaded the code and something work well and something doesn't work.

Now I have a big problem.
:?:

Code: Select all
I have to verify with the Jtag where are my bugs.

I bought the AvrDargon Jtag.
I connected the Avr Dargon with the Biloid digital card with wires in ISP programming mode: MOSI, MISO, SCk etc...

Using Avr 5.0 and Avr Programming the interface show me a message:
Timestamp: 2012-01-05 16.33.05.545
Severity: ERROR
ComponentId: 20100
StatusCode: 0

Programming session setup failed: TCF command: Device:startSession failed: Code:1 ,Service: ,Message from peer:Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00


Is there something that try to connect tha Avr Dragon and CM510?
Any suggestions would be more appreciate!!!

Many thanks in advanced.
Reagrds.
Angelo.
angelocarenzo
Newbie
Newbie
Posts: 2
Joined: Thu Jan 05, 2012 4:26 pm

Post by siempre.aprendiendo » Thu Jan 05, 2012 6:27 pm

Post by siempre.aprendiendo
Thu Jan 05, 2012 6:27 pm

I think that CM-510 doesn't have the connector for JTAG, but while you wait an answer from someone with more knowledge in "hardware debugging" you can try the simple and classic "software debugging" with printf. Something like this:

Code: Select all
   if (debugMode)
      printf( "\n\ninput state:%d data:%X\n\n", nextIs, data);


You can create a debug function and use several values for debug levels, not only 0 for false and ant any-other-value for true. For example:

Code: Select all
void debug(char *str, int value, int debugLevel);


I didn't neeed it, but I think you can even use the Standard predefined macros:

Code: Select all
     fprintf (stderr, "Internal error: "
                      "negative string length "
                      "%d at %s, line %d.",
              length, __FILE__, __LINE__);
I think that CM-510 doesn't have the connector for JTAG, but while you wait an answer from someone with more knowledge in "hardware debugging" you can try the simple and classic "software debugging" with printf. Something like this:

Code: Select all
   if (debugMode)
      printf( "\n\ninput state:%d data:%X\n\n", nextIs, data);


You can create a debug function and use several values for debug levels, not only 0 for false and ant any-other-value for true. For example:

Code: Select all
void debug(char *str, int value, int debugLevel);


I didn't neeed it, but I think you can even use the Standard predefined macros:

Code: Select all
     fprintf (stderr, "Internal error: "
                      "negative string length "
                      "%d at %s, line %d.",
              length, __FILE__, __LINE__);
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Post by Fritzoid » Thu Jan 05, 2012 8:19 pm

Post by Fritzoid
Thu Jan 05, 2012 8:19 pm

I'm a little confused here... angelo wrote
I connected the Avr Dargon with the Biloid digital card with wires in ISP programming mode: MOSI, MISO, SCk etc...


Are we talking about an add-on digital card with an AVR that you are programming or are we talking about the CM-510. You seem to be trying to use the ISP interface which is common for programming add-on cards.

According to the schematic there's a JTAG interface on the CM-510 controller board, but you would need to open up the case to get at it. Since all I have is an ISP I've never tried this myself.
I'm a little confused here... angelo wrote
I connected the Avr Dargon with the Biloid digital card with wires in ISP programming mode: MOSI, MISO, SCk etc...


Are we talking about an add-on digital card with an AVR that you are programming or are we talking about the CM-510. You seem to be trying to use the ISP interface which is common for programming add-on cards.

According to the schematic there's a JTAG interface on the CM-510 controller board, but you would need to open up the case to get at it. Since all I have is an ISP I've never tried this myself.
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am

Post by i-Bot » Thu Jan 05, 2012 11:41 pm

Post by i-Bot
Thu Jan 05, 2012 11:41 pm

Even if you connect the JTAG pins there often problems on how the reset is wired. Also it may be that the JTAG is disabled in the ATMega fuses of the production CM-510 units.

Debugging with JTAG is also quite a steep additional learning curve. If you can use the classic techniques suggested above without JTAG it might be quicker.
Even if you connect the JTAG pins there often problems on how the reset is wired. Also it may be that the JTAG is disabled in the ATMega fuses of the production CM-510 units.

Debugging with JTAG is also quite a steep additional learning curve. If you can use the classic techniques suggested above without JTAG it might be quicker.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by planius » Sun Jan 08, 2012 2:13 am

Post by planius
Sun Jan 08, 2012 2:13 am

The JTAG port is not directly accessible on the CM510, the JTAG port signals are split up over ADC4-7, it would be quite easy to make a mistake in wiring it up, so check you got all the connections right. See here for correct wiring:
http://support.atmel.no/knowledgebase/avrstudiohelp/mergedProjects/AVRDragon/AVRDragon_connecting_to_target_through_the_jtag_interface.htm
For the CM510 the pins are:
TCK = ADC4
TMS = ADC5
TDO = ADC6
TDI = ADC7

According to the ATMega2561 datasheet fuse and lock bits need to be as follows:
The JTAGEN Fuse must be programmed to enable the JTAG Test Access Port. In addition, the
OCDEN Fuse must be programmed and no Lock bits must be set for the On-chip debug system
to work. As a security feature, the On-chip debug system is disabled when either of the LB1 or
LB2 Lock bits are set.

In addition the code needs to be compiled with full debug support. Assuming you have done all of the above correctly, I don't know what the issue might be.
The JTAG port is not directly accessible on the CM510, the JTAG port signals are split up over ADC4-7, it would be quite easy to make a mistake in wiring it up, so check you got all the connections right. See here for correct wiring:
http://support.atmel.no/knowledgebase/avrstudiohelp/mergedProjects/AVRDragon/AVRDragon_connecting_to_target_through_the_jtag_interface.htm
For the CM510 the pins are:
TCK = ADC4
TMS = ADC5
TDO = ADC6
TDI = ADC7

According to the ATMega2561 datasheet fuse and lock bits need to be as follows:
The JTAGEN Fuse must be programmed to enable the JTAG Test Access Port. In addition, the
OCDEN Fuse must be programmed and no Lock bits must be set for the On-chip debug system
to work. As a security feature, the On-chip debug system is disabled when either of the LB1 or
LB2 Lock bits are set.

In addition the code needs to be compiled with full debug support. Assuming you have done all of the above correctly, I don't know what the issue might be.
planius
Savvy Roboteer
Savvy Roboteer
Posts: 40
Joined: Wed Jul 20, 2011 5:33 am


5 postsPage 1 of 1
5 postsPage 1 of 1