SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By Madis

I have problem with LM3S9B95 controller and "Open On-Chip Debugger 0.4.0 (2010-02-22-19:05)"

flash programming does not seem to work. I checked the debug output of the openocd, it seems to operate correctly. For mass erase it writes 0xA4420004 to address 0x400fd008 and starts polling it. But the thing is that the operation seems to never finish. This MERASE bit never returns to 0 again and openocd hangs... Does anybody have any comments, hints?

I attach my debug output file.

But in case I compile a short code sample I can load it to RAM, move pc to there and execute it. Eclipse and gdb are quite happy. So the controller itself seems to work somehow...

Thanks, Madis
You do not have the required permissions to view the files attached to this post.
User avatar
By itikhonov
May be
Mass erase must not be used if Flash protection bits are used


The mass erase function using the MERASE bit in the Flash Memory Control (FMC) register must
not be used in systems that clear any of the Flash Memory Protection Program Enable n (FMPPEn)
bits. For Rev C1 devices, this means that mass erase must not be used because bits in the FMPPE0
registers are cleared to protect the reset patch that is stored in the first block of Flash memory. For
Rev C3 and C5 devices, mass erase can be used as long as none of the FMPPEn bits are cleared.

Erase Flash memory with the page erase function using the ERASE bit in the FMC register instead
of the mass erase function.

Silicon Revision Affected:
C3, C5

Not yet fixed.
By Madis

I started to check the versions/revisions of my controller too. Device is C1 and errata seems to enlighten the issue...

I will start my code at 0x1000 and not use mass_erase then, will see what happens.

By Madis
Ok, 0x1000 if fine. In case not using mass_erase openocd works fine. I link my code to address 0x1000 and seems to work...

Thanks, Madis
User avatar
By itikhonov
Yeah i thought software bugs are nightmare till i hit compiler bugs till i hit hardware bugs :)
By drwho9437
Madis or anyone else can you tell me how to program the LM3S9xxx chip without using mass erase?

write_image seems to automatically call mass erase even without the "erase" command. I am using the most reason OpenOCD development release. Tired issuing sector erases but it seemed to just hang on those.