[fpc-pascal] Armv7 fpc openocd v8

Justin Smyyth justin at smythconsulting.net
Mon May 19 04:39:36 CEST 2014


if you have an updated version of lpc13xx.pp ( I wrote the orginal) that 
would be good.


I would prob re check the C# i had for the nxp lpc 1343 chip agaist this 
file , now i can target the board i can see if i get any errors.( also check 
the specs to make sure its right too ).

A bit of work . thats ok


Justin


ps delphian at smythconsulting & justin at smythconsulting.net both route to me



-----Original Message-----
From: Michael Ring <mail at michael-ring.org>
To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
Date: Sat, 17 May 2014 10:35:58 +0200
Subject: Re: [fpc-pascal] Armv7 fpc openocd v8


First step would be to visit

http://wiki.freepascal.org/TARGET_Embedded 
[http://wiki.freepascal.org/TARGET_Embedded]

This page helps to set up basic things like cross toolchain for arm and to 
compile trunk of fpc.

Once you have worked through this you are ready to go.

ppcrossarm -i should give you a list of available controllers, when you use 
trunk you should see:

LPC1343FBD48 and LPC1343FHN33 in the list of supported controllers.

When you have followed the steps of the instructions you have also checked 
out latest FPC from trunk, you should now make yourself familiar with the 
file ./rtl/embedded/arm/lpc13xx.pp, this file holds all the register 
information.

If you want I can send you a newer version of this file, it also includes 
translations of most of the #defines of the original header files, but for 
learning first steps the checked in version is perhaps easier, it is not 
that big.

Now you are ready to compile your first hello.pas, this is the commandline 
that I usually use:

ppcrossarm -MObjFPC -Ch1024 -Cs1024 -Tembedded -Parm -vi -Cparmv7m 
-WpLPC1343FBD48 -XParm-none-eabi- hello.pas

When you use objects you need to initialize the heap, change -Ch (Heapsize) 
and -Cs (Stacksize) to your needs. -vi give you info about code and data 
size.

arm-none-eabi- is the prefix of your binutils binaries for cross compiling, 
if they are not in you path you can also put the full path in the 
commandline, but remember to only use the prefix. something like 
/usr/local/bin/arm-none-eabi- will work, C:\tools\bin\arm-none-aebi- should 
also work

For debugging you need gdb compiled as a cross debugger, I built my own gdb 
to support text UI, so --tui brings you into a basic GUI inside of gdb, 
without this you end up in plain gdb commandline.

arm-none-eabi-gdb hello.elf --tui --eval-command="target extended :3333" 
--eval-command="monitor reset halt" --eval-command="set mem 
inaccessible-by-default off" --eval-command="load"

After this you are ready to debug.

I have written an integration into lazarus looooong time ago, not sure if it 
still compiles after the huge changes thst Martin did in the last months, 
once you have everything up and running so far we can work on the 
integration into lazarus.

Michael



Am 17.05.14 01:33, schrieb Justin Smyth:
Hi everyone,

I have recently got open ocd v8 to talk to my nxp lpc 1343 via a stlinkv2 , 
should fpc ( 2.6.4 or higher support this type of CPU and does anyone have 
any ideas how to hook up gdb to openocd ? I am thinking of using Lazarus to 
step through some code if possible)

Justin

_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org 
[mailto:fpc-pascal at lists.freepascal.org]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 
[http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140519/5d9adf2e/attachment.html>


More information about the fpc-pascal mailing list