Re: [arm-gnu] arm-none-eabi-sprite problems..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] arm-none-eabi-sprite problems..



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Carlos O'Donell wrote:
> Mark Deneen wrote:
>> I'm trying to get CodeSourcery G++ to work with a STM32F103RE
>> microprocessor.  I'm familiar with the GNU toolchain and GDB, but this
>> sprite thing is all new to me!
>
> To put it simply the Sprite is a gdb server i.e. On one side can
> communicate to gdb using the gdb remote protocol, and on the other
> end it can communicate one of several different pieces of hardware
> including ULINK2, RDI, P&E USB-ML-CF etc.
>
>> I start GDB and issue:
>>
>> (gdb) target remote | arm-none-eabi-sprite ulink://cm/?opts=config
>> stm32f103re
>>
>> (gdb) load cs-test.elf
>> Loading section .text, size 0xe7f8 lma 0x8000000
>> Load failed
>>
>> Boooo!
>
> What does your "config" file contain? What options did you use for
> both of the ULINK2 configuration dialogs? What do you get if you run
> the Sprite in verbose mode with "-v"?
>
Here is the content of the config file:


- -UU0516UAE -O175 -S0 -C0 -N00("ARM CoreSight JTAG-DP") -D00(3BA00477)
- -L00(4) -N01("Unknown JTAG device") -D01(06414041) -L01(5) -TO18
- -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7
- -FD20000000 -FC800 -FN1 -FF0STM32F10x_512 -FS08000000 -FL080000


>> I'm using a Keil ULINK2.  If I flash the board with another tool, I
>> can connect with GDB and tell it to continue, examine registers and
>> whatnot.
>
> Did you use the same ULINK2 configuration options with these other
> tools?
>

Yes.

>> Since CodeSourcery doesn't support STM32 out of the "box", so I've
>> created the startup code by following the Luminary code
>> (stm32f103re-reset.S), and creating the proper interrupt vector table
>> symbols.  (stm32-isrs.S and stm32-vector.S) My stm32f103re.xml
>> follows:
>>
>> <?xml version="1.0"?>
>> <!DOCTYPE board SYSTEM "board.dtd">
>> <board>
>>   <properties>
>>     <property name="system-v7-m"/>
>>   </properties>
>>   <memory-map>
>>     <memory-device address="0x20000000" size="64K" type="ram">
>>       <description>
>>         ITCM
>>       </description>
>>     </memory-device>
>>     <memory-device address="0x8000000" size="512K" type="rom">
>
> You need a 'device="ulink"' attribute here to tell the Sprite that
> the flash is programmable by the ULINK2. I apologize that this isn't
> documented, I've filed an internal documentation issue.
>
I added this attribute.

>>       <description>
>>         Flash
>>       </description>
>>     </memory-device>
>>   </memory-map>
>> </board>
>>
>> Any idea where I went wrong?
>
> Does your board need any initialization before memory is useable?
>
Not that I know of.  There is no external memory -- it is all in the
same package as the micro.

>> Additionally, in thumb2/libcs3.a, there are object files for each
>> supported processor, as well as the common startup code (start.S and
>> start_c.c).  Also in the archive is heap.o, but I was not able to find
>> source for that.  Is this something that is available?
>
> CodeSourcery only provides the source for the board startup. You can
> think of CS3 like an SDK for writing startup code, the library
> internals may change, but you get the same API.
>

The only reason I asked is because all of the source was available
except for heap.c.

Anyway...

I accidentally left the device powered down at first.

(gdb) target remote | arm-none-eabi-sprite ulink://cm/?opts=config
stm32f103re
Remote debugging using | arm-none-eabi-sprite ulink://cm/?opts=config
stm32f103re
arm-none-eabi-sprite: ULINK - Cortex-M Error: No JTAG Devices Found
arm-none-eabi-sprite: ULINK - Cortex-M Error: No JTAG Devices Found
arm-none-eabi-sprite: ULINK - Cortex-M Error: No JTAG Devices Found
arm-none-eabi-sprite: ULINK - Cortex-M Error: No JTAG Devices Found
arm-none-eabi-sprite: ULINK - Cortex-M Error: No JTAG Devices Found
arm-none-eabi-sprite: error: Couldn't initialise ULINK (try a
power-cycle?)
arm-none-eabi-sprite: waiting for GDB connection, to pass error along
warning: Remote failure reply: E.fatal.Couldn't initialise ULINK (try
a power-cycle?)
Remote communication error: No error.

I was happy to see ULINK messages!

(gdb) target remote | arm-none-eabi-sprite ulink://cm/?opts=config
stm32f103re
Remote debugging using | arm-none-eabi-sprite ulink://cm/?opts=config
stm32f103re
arm-none-eabi-sprite: Target reset
0x08002088 in ?? ()
(gdb) load cs-test.elf
Loading section .text, size 0xed20 lma 0x8000000
Load failed

Boooo!


So, on a hunch, I changed "rom" to "flash" in the sprite xml file.  I
get a bit further now:

Loading section .text, size 0xed20 lma 0x8000000
Loading section .eh_frame, size 0x4 lma 0x800ed20
Loading section .ARM.exidx, size 0x20 lma 0x800ed24
Loading section .rodata, size 0x364c lma 0x800ed44
Loading section .data, size 0x520 lma 0x8012390
arm-none-eabi-sprite: ULINK - Cortex-M Error: Flash Timeout. Reset the
Target and try it again.
arm-none-eabi-sprite: ULINK: Erase Failed!
Error finishing flash operation

Any ideas?

Best Regards,
Mark Deneen
Saucon Technologies


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iD8DBQFJNpMutf95hArmCUURApQ/AJsHKUzavZocgo82zz9Ti0jWhCCcxQCggL2h
YyFNHLkJBugRqClE16E35+I=
=cvvd
-----END PGP SIGNATURE-----