R2C2 Programming/Debugging Issue

161 views
Skip to first unread message

WeeHau Kang

unread,
Feb 22, 2013, 10:34:40 AM2/22/13
to r2c2-repr...@googlegroups.com
Hi,

My name is Weehau. I am more of a Microchip programmer, and recently just purchased a R2C2 kit to kick start with Arm-cortex M3 programming. The reason why I opted for R2C2 is because I am interested in the high performance reprap electronics based on 32-bit ARM processor, comparing to what's available in the Reprap industry. The other more important reason is that I have some interesting ideas to be implemented and contributed to the development of R2C2. After reading through the tutorial/guide in R2C2 development page on setting up eclipse and OpenOCD, I have purchased a ARM-USB-TINY and finally able to get the JTAG connected to the eclipse.

this is the log data from eclipse console window
------------------------------------------------------------------------------------------------------
Open On-Chip Debugger 0.4.0 (2010-02-22-19:05)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
srst_only separate srst_gates_jtag srst_open_drain
500 kHz
Info : clock speed 500 kHz
Info : JTAG tap: LPC1758.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : LPC1758.cpu: hardware has 6 breakpoints, 4 watchpoints
------------------------------------------------------------------------------------------------------------------------

However I was able to get only until this point. The Debug/Flash failed when i launched the debug menu ( I followed the same steps to configure in the

"Programming and debugging using Eclipse and JTAG").


This was always shown in the console window:

--------------------------------------------------------------------------------------------------------------------------

Info : accepting 'gdb' connection from 0
Warn : acknowledgment received, but no packet pending
cortex_m3 interrupt mask on
Info : JTAG tap: LPC1758.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Warn : LPC1758.cpu -- clearing lockup after double fault
target state: halted
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x61000003 pc: 0xad8511be msp: 0x10007db8
auto erase enabled
auto unlock enabled
Info : Padding image section 0 with 0 bytes
wrote 65536 bytes from file ./FLASH_RUN/project.elf in 13.611779s (4.702 kb/s)
Warn : negative acknowledgment, but no packet pending
Warn : negative acknowledgment, but no packet pending
Warn : negative acknowledgment, but no packet pending
-----------------------------------------------------------------------------------------------------------

I can't get debug to work properly and the more bad news is I am now stuck because of the original firmware shipped with the board was erased. Can somebody help?

Rui Ribeiro

unread,
Feb 22, 2013, 1:01:46 PM2/22/13
to r2c2-repr...@googlegroups.com
Hi Wee,
 
When you make it work, please tell me how you did it!
 
I've purchased 3 or 4 JTAG adaptors and tried several development kits... nothing worked. Well... the Keil worked, but the free version could not hold all the code.
 
During the tests I've made while developing, I've found out that the best way was to use the serial port (there is a pair on the extension pins that gives you a second serial) back to the PC using a serial/usb dongle. I've also used the beeper to make some debugging... it is really hardcore and like the "hold days", just big fun!
 
Hoping to get some news from you.
Rui


2013/2/22 WeeHau Kang <weeha...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "R2C2 - electronic board to control RepRap 3D printers and others" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r2c2-reprap-and...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jorge Pinto

unread,
Feb 22, 2013, 1:09:59 PM2/22/13
to r2c2-repr...@googlegroups.com
> When you make it work, please tell me how you did it!
>
> I've purchased 3 or 4 JTAG adaptors and tried several development kits...
> nothing worked. Well... the Keil worked, but the free version could not hold
> all the code.

Hello.

I wrote the page "Programming and debugging using Eclipse and JTAG":
http://www.3dprinting-r2c2.com/?q=content/programming-and-debugging-using-eclipse-and-jtag

I have experiencie with this tools, for AMRs like STM32F100 (ST),
LPC2103 (NXP), AT91SAM7S (Atmel), AT91SAM9260 (Atmel), IMX233
(FreeScale).


------------------------------------------------------------------------------------------------------
Open On-Chip Debugger 0.4.0 (2010-02-22-19:05)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
srst_only separate srst_gates_jtag srst_open_drain
500 kHz
Info : clock speed 500 kHz
Info : JTAG tap: LPC1758.cpu tap/device found: 0x4ba00477 (mfg: 0x23b,
part: 0xba00, ver: 0x4)
Info : LPC1758.cpu: hardware has 6 breakpoints, 4 watchpoints
------------------------------------------------------------------------------------------------------------------------

This output means that JTAG is working and can communicate with LPC.


Info : Padding image section 0 with 0 bytes
wrote 65536 bytes from file ./FLASH_RUN/project.elf in 13.611779s (4.702 kb/s)
Warn : negative acknowledgment, but no packet pending
Warn : negative acknowledgment, but no packet pending

Try to connect using Telnet to OpenOCD and run commands like erase
flash memory, etc and see the output.

Maybe you can try to lower the communication frequency of JTAG... that
"Warn : negative acknowledgment, but no packet pending" may mean
communications failed.

--
Jorge Pinto
+351 927 145 983
jpi...@bitbox.pt


www.bitbox.pt
IEUA - Universidade de Aveiro
Portugal

Confidencialidade: Este e-mail, assim como respectivos anexos, é
confidencial e não pode ser revelado ou utilizado por terceiros não
autorizados. Se o recebeu por engano, solicitamos que não o utilize
para nenhum fim, notifique o remetente e proceda à sua destruição.

Confidentiality notice: This e-mail, as well as existing files, is
confidential and may not be disclosed to or used by any other person
than the addresse unless when authorized. If you have received this
e-mail by mistake, we request not to make any use whatsoever of its
contents, notify us and proceed to its destruction.

WeeHau Kang

unread,
Feb 23, 2013, 9:15:50 PM2/23/13
to r2c2-repr...@googlegroups.com
Hi Rui,

Thanks for your sharing. I will let you know when I can make it work. It's quite disappointing when we expected it to work, after investing so much money and time thou!


2013/2/22 WeeHau Kang <weeha...@gmail.com>
To unsubscribe from this group and stop receiving emails from it, send an email to r2c2-reprap-and-cnc+unsub...@googlegroups.com.

WeeHau Kang

unread,
Feb 23, 2013, 11:48:01 PM2/23/13
to r2c2-repr...@googlegroups.com

Dear Jorge/others,

Thanks for your reply. I have tried to set the JTAG frequency to 200khz but still came back with same issue.

I have attached my eclipse configuration here. Also R2C2 firmware v1.0.3. Can you take a look of what is likely to cause the problem? e.g Makefile or startup file etc.

I will be very grateful and appreciate if any of you can spend some time to shed some light on this. I have been working on this for almost 2 weeks but not getting any progress. It's really frustrating and disappointing after spending so much money to purchase the kit but it turned out not working. I believe Rui Ribeiro and others will feel the same. Appreciate if you can do something about this.

Thanks in advance!


 
Eclipse-OpenOCD-GDB Settings.docx
R2C2_Firmware-v1.0.3.zip

WeeHau Kang

unread,
Feb 23, 2013, 11:48:20 PM2/23/13
to r2c2-repr...@googlegroups.com
Eclipse-OpenOCD-GDB Settings.docx
R2C2_Firmware-v1.0.3.zip

Rui Ribeiro

unread,
Feb 24, 2013, 4:25:52 AM2/24/13
to r2c2-repr...@googlegroups.com
Dont give up yet, Jorge will help you. 

One of my problems was that I didn't had much time or "motivation". 

For me OpenOCD didnt't work, neither on Windows neither on Linux, but I'm not sure that I had the correct binaries (tried a few though). 

Maybe a cool thing that R2C2 team/support/community could provide to the community would be a ready to use virtual machine. 

- linux based
- eclipse / openocd
- git enabled

This is a chalange for you, Jorge!

Rui
To unsubscribe from this group and stop receiving emails from it, send an email to r2c2-reprap-and...@googlegroups.com.

WeeHau Kang

unread,
Feb 27, 2013, 9:46:13 AM2/27/13
to r2c2-repr...@googlegroups.com
Can somebody help? Anyone who has successfully compiled and loaded the firmware into the board mind to share how you did it?

Thanks.

Jorge Pinto

unread,
Feb 27, 2013, 1:14:53 PM2/27/13
to r2c2-repr...@googlegroups.com
2013/2/27 WeeHau Kang <weeha...@gmail.com>:
> Can somebody help? Anyone who has successfully compiled and loaded the
> firmware into the board mind to share how you did it?

Hi.

The first thing is to build the bootloader and flash it - you can use
JTAG or serial port for it. After you have the bootloader working you
can flash the firmware easily - follow this instructions:
http://www.3dprinting-r2c2.com/?q=content/r2c2-usb-bootloader

bobc

unread,
Feb 27, 2013, 7:29:25 PM2/27/13
to r2c2-repr...@googlegroups.com


On Wednesday, February 27, 2013 2:46:13 PM UTC, WeeHau Kang wrote:
Can somebody help? Anyone who has successfully compiled and loaded the firmware into the board mind to share how you did it?


I never found Eclipse/openocd/arm-jtag-tiny a very reliable system. I could get it working for a bit then it would all hang up and require restarting. I used openocd to Flash download the bootloader. Altogether the experience was very frustrating and I wasted a lot of time trying build and configure the software, and getting help is pretty hard. Unfortunately, these are about the only open source tools available, so if you want to go that route you will most likely have to get under the hood and figure things out yourself.

Programming the R2C2 with Eclipse/open-ocd is pretty much the same as any other LPC1758, so you might be able to get help from other places, e.g. the NXP forums.

For most of my development I used Rowley Crossworks, which is not free, but much more reliable. I also bought a Segger Jlink and Rowley JTAG adapters which perform much better. Again, not cheap, but I figure I want to spend my time writing code not debugging tools, and has been a worthwhile investment for me. I use similar professional tools at work, which I guess is an advantage.

There are some free versions of commercial tools, such as Keil and IAR, although these are size limited they might at least help you flash the bootloader.


Jorge Pinto

unread,
Feb 28, 2013, 10:07:42 AM2/28/13
to r2c2-repr...@googlegroups.com
> Programming the R2C2 with Eclipse/open-ocd is pretty much the same as any
> other LPC1758, so you might be able to get help from other places, e.g. the
> NXP forums.

The same is true for others ARMs from other vendors, like STM32
(cheap, popular on DIY) and SAM3X8E (Arduino Due):

- FreeRTOS.org STM32 demo using Eclipse, OpenOCD and GCC:
http://developers.stf12.net/eclipse-demo

WeeHau Kang

unread,
Mar 6, 2013, 9:55:33 AM3/6/13
to r2c2-repr...@googlegroups.com
Dear Bob,

Thanks for your useful information. I am still having trouble to get the debug running. I think i will probably give up using the open source platform and opt for crossworks. Can you teach me how to port the existing R2C2 project into crossworks? The crossworks can only load .hzp and .hzr files which i couldn't locate in the R2C2 firmware folder. 

Do you use skype for chat? my skype ID : KANGWEEHAU.

Thanks

bobc

unread,
Mar 6, 2013, 2:18:33 PM3/6/13
to r2c2-repr...@googlegroups.com
If you look on the edge branch you should find a Crossworks project file. The edge branch has diverged quite a lot from master, but the project should provide a guide. You will need to change some project files and also some of the include paths. If I have some time I will try to put together a working project for the master branch.

Sorry, I don't use skype.
Reply all
Reply to author
Forward
0 new messages