[fpc-devel] Embedded Strings on nRF51-DK

Michael Ring mail at michael-ring.org
Sun Apr 19 17:24:35 CEST 2015


The CMSIS is a format created by ARM that (as one of it's features) 
describes all registers and fields of an arm chip in a language 
independant way.


I have created a patch for you that adds the interface-unit for the 
nrf51 chips.

Please check out a fresh copy of fpc-trunk

then apply this patch:

http://temp.michael-ring.org/nrf51.diff

and build the new compiler:

make clean buildbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=arm 
SUBARCH=armv6m CROSSOPT="-O2 -gw2" BINUTILSPREFIX=arm-none-eabi-

install it:

sudo make installbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=arm 
SUBARCH=armv6m CROSSOPT="-O2 -gw2" BINUTILSPREFIX=arm-none-eabi-

You may need o change BINUTILSPREFIX=arm-none-eabi- when your binutils 
have a different name and sudo is not necessary on windows

Now you have support for the nrf51 chips, ppcrossarm -i should give you:

nRF51822_xxAA,nRF51822_xxAB,nRF51822_xxAC,nRF51422_xxAA,nRF51422_xxAB
   nRF51422_xxAC

as new Microcontroller types.

This unit will help you with raw access to all registers, I am not sure 
if Nordic Semiconductor also offers documentation on this level, so your 
mileage may vary.

But you now have a basis to play arround with linking to the nrf51 libs 
and accessing the bluetooth stack provided by NC in the fpc way.

This is a helpfull way to do the compile:

ppcrossarm -MObjFPC -Scghi -al -Ch1024 -Cs1024 -Tembedded -Parm -vewnhix 
-l -Cparmv6m -O-  -WpnRF51822_xxAC -XParm-none-eabi- -a hello.pas -sh

everything is compiled, but not linked.

you can then have a look at link.res, check that all necessary sections 
are included. When happy you can call ppas.sh to do the actual linking.

I also have two nrf51 USB-thumb sticks please keep me posted on your 
success, I wanted to also do a small bluetooth project based on those 
modules. My plan was to do this in C (this is painful, but often the 
faster way) but I may switch to also try to do the project in fpc based 
on your results.....


Michael


Am 18.04.15 um 11:16 schrieb Paul Michell:
> Michael
>
> Thanks for the offer of help.  I'm totally new to embedded work.  I am aware
> of the FPC embedded compiler target, but I don't yet understand  the nRF51 SDK
> enough to set up the required files.  I would like to move to this approach
> and I have read:
>
> http://wiki.freepascal.org/TARGET_Embedded
>
> What I am unsure about is how this would work with the RF/Bluetooth firmware
> of the nRF51.  I have deliberately been staying as close to the GCC method as
> possible so that I can use all of the SDK resources.  But if it is possible to
> use the target embedded approach that would be much better.
>
> I don't know what the chip's CMSIS data is.  I tried to google it and there is
> some mention of a 'SDK CMSIS pack' here:
>
> http://developer.nordicsemi.com/
>
> Does this tell you what needs to be known?  Would you need to produce a
> different controller definition for each SoftDevice configuration?
>
> If you think this is worth attempting I would be happy to help set this up.
>
> Kind regards,
>
> Paul
>
> On Friday 17 Apr 2015 08:44:55 Michael Ring wrote:
>> I can generate the pascal unit for the nrf51 module from the CMSIS Data
>> of this chip.
>>
>> Drop me a note if are you interested, this unit should make your life a
>> lot easier.
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel




More information about the fpc-devel mailing list