stellaris flash

Hi!

I have a little question regarding stellaris flash programming. I have two boards available here, LM3S8962 demoboard and my own design based on LM3S6950. And both behave the same.

In case I have small binary/hex images (like up to 60K…), everything goes as expected. But openocd fails to flash image which size is about 100K. It reports:

Debug: 2698 75028 stellaris.c:821 stellaris_write(): (bank=00038508 buffer=00C122F0 offset=00000000 count=00016DC9)

Warning: 2699 75028 stellaris.c:836 stellaris_write(): offset size must be word aligned

Error: 2700 75028 flash.c:103 flash_driver_write(): error writing to flash at address 0x00000000 at offset 0x00000000 (-904)

Debug: 2701 75028 command.c:387 find_and_run_command(): Command failed with error code -904

Im a little bit confused here. Any idesas what can by wrong?

toolchain for compiling: codesourcery lite

openocd ver 717 (from yagarto website)

config file:

#daemon configuration

telnet_port 4444

gdb_port 3333

#interface

interface ft2232

ft2232_device_desc “Stellaris Evaluation Board A”

ft2232_layout evb_lm3s811

ft2232_vid_pid 0x0403 0xbcd9

jtag_speed 20

#LM3S811 Evaluation Board has only srst

#reset_config srst_only separate

reset_config trst_and_srst

#jtag scan chain

#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

jtag_device 4 0x1 0xf 0xe

#target configuration

daemon_startup attach

#target

#target arm7tdmi

target cortex_m3 little run_and_halt 0

4k working area at base of ram

working_area 0 0x20000800 0x4000 nobackup

#flash configuration

flash bank stellaris 0 0 0 0 0

debug_level 3

Thank you,

Madis

Hi!

I’m experiencing the same problems with a recent build of OCD on a luminary LM3S1958. Small images can be flashed, larger ones fail with “offset size must be word aligned”.

Did you (or anyone else) find a solution to this problem?

Best regards,

Ralf

svn 717 is quite old - try a newer version.

The error relates to the way the hex,s19.elf is being created - in multiple sections by the linker.

A newer version of openocd should fix the problem, you could also try programming using a binary file.

if you are still getting trouble update to the latest and post a debug log.

Cheers

Spen

I’m using the lastest version from SVN (updated and compiled yesterday) and try to program a bin file.

The problem is exactly the same as described, the count variable (whatever this is) is not a multiple of four and therefore the flash process is aborted with

“offset size must be word aligned”.

The same process works perfectly with smaller bin files.

Best regards,

Ralf

could you produce a full debug log?

Cheers

Spen

I had that problem before, and managed ti get around it by padding the files.

echo " " >>file.bin

Until it works.

Great, thanks. Padding the file helped.

As this is obviously a bug in openOCD, shall i report it somewhere?

You could post the bug on the development mailing list: https://lists.berlios.de/mailman/listin … evelopment

The bug tracker would be the best place:

http://developer.berlios.de/bugs/?group_id=4148

attach a full debug log including the problem binary.

your version is quite old and openocd does now include the ability to pad files if required.

This however should not be an issue with binary files, and from the error you get is more related to the address you are trying to program.

the luminary flash driver requires 32bit aligned addresses to program correctly.

Cheers

Spen

I will post it to the bug tracker soon.

To avoid misunderstanding, i’m using the latest software version and try to program to adress 0x4000.

The error encountered is not related to the start adress but to the file size which leads to a value of the count variable which is not a multiple of four and with this to the error described

Best regards,

Ralf

I have committed a fix for this - could you try with the latest svn?

Cheers

Spen