OpenOCD lpc1758.cfg for flashing bootloader?

92 views
Skip to first unread message

Bryan Lambrecht

unread,
Mar 10, 2013, 11:57:27 PM3/10/13
to r2c2-repr...@googlegroups.com
So I am trying to flash a new chip with the boot loader (prototype) and I have the Olimex-Jtag-Tiny-H dongle. However I am having a difficult time getting everything to work in windows (downloading ubuntu now just in case).

I have the Jtag and OCD set up and look like it is working correctly, but eclips is not cooperating with me right now. However I did notice that it looks like I might be able to just flash the chip with just the openOCD program using the release booloader .bin. From what I can tell I need to modify the lpc1758.cfg file to include the commands to flash the chip.

I'm not quite sure how to setup this file, and don't want to do something stupid like write the bootloader to the wrong segment in memory or something and brick the chip. So I was hoping some one has done this before (with out eclips) and has the lpc1758.cfg file I can snag, or can point me in the right direction.

Thanks!

Jorge Pinto

unread,
Mar 11, 2013, 12:44:43 PM3/11/13
to r2c2-repr...@googlegroups.com
2013/3/11 Bryan Lambrecht <bryan.l...@gmail.com>
So I am trying to flash a new chip with the boot loader (prototype) and I have the Olimex-Jtag-Tiny-H dongle. However I am having a difficult time getting everything to work in windows (downloading ubuntu now just in case).

I have the Jtag and OCD set up and look like it is working correctly, but eclips is not cooperating with me right now. However I did notice that it looks like I might be able to just flash the chip with just the openOCD program using the release booloader .bin. From what I can tell I need to modify the lpc1758.cfg file to include the commands to flash the chip.

I just have experience on Linux Ubuntu and on that case, I would:
- run OpenCOD with this command (this is the same used on Eclispe): "sudo openocd -f openocd_v0.4.0-scripts/olimex-jtag-tiny.cfg -f openocd_v0.4.0-scripts/lpc1758.cfg"
- use Telnet and connect to OpenOCD, and then use the following commands (this is the same used on Eclispe):

reset
sleep 100
halt
sleep 100
flash write_image erase unlock ./FLASH_RUN/project.elf
sleep 100
exit 

 
I'm not quite sure how to setup this file, and don't want to do something stupid like write the bootloader to the wrong segment in memory or something and brick the chip. So I was hoping some one has done this before (with out eclips) and has the lpc1758.cfg file I can snag, or can point me in the right direction.

IMO, you will never brick LPC175x - you will always be able to flash it.

"flash write_image" line is flashing the "project.elf" to 0 address, where the bootloader should be flashed/from where LPC175x boots.

After bootloader verifies if SDCard have "firmware.bin" file, it simple jumps to address where firmware starts, which is (on firmware "main.c"):
#define USER_FLASH_START 0x10000 /* For USB bootloader */

--
Jorge Pinto


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.

Bryan Lambrecht

unread,
Mar 13, 2013, 12:01:16 AM3/13/13
to r2c2-repr...@googlegroups.com
Thanks Jorge,

I ended up trying CooCox, for the flash program and it was more in the format that I'm used to. It states that the chip is flashed and can verify the flash was successful/correct, but doesn't boot up.

I'm not quite sure what is going wrong, but I'm glad to hear that I probably wont brick it in my attempts to get it working.

I think I might just go full blown Ubuntu and see if I can get the JTAG debuger up and going.

Thanks!

Jorge Pinto

unread,
Mar 13, 2013, 6:06:07 AM3/13/13
to r2c2-repr...@googlegroups.com
2013/3/13 Bryan Lambrecht <bryan.l...@gmail.com>
Thanks Jorge,

I ended up trying CooCox, for the flash program and it was more in the format that I'm used to. It states that the chip is flashed and can verify the flash was successful/correct, but doesn't boot up.

I'm not quite sure what is going wrong, but I'm glad to hear that I probably wont brick it in my attempts to get it working.

I think I might just go full blown Ubuntu and see if I can get the JTAG debuger up and going.

You may also try to get familiar with OpenOCD commands for erase and flash memory (they are just 2 or 3 commands) -- see the OpenOCD manual.
 
Reply all
Reply to author
Forward
0 new messages