You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Amr Bekhit <am...@gmail.com> on 2019/05/02 07:37:02 UTC

Re: nRF52 NFC

Hi Guillermo,

I'm happy to share the code I have so far. It's a bit rough as it's just a
quick port of the library to work with mynewt. Until I get it up on github,
you may want to try the following:

The library has quite a few #defines that are used to include various bits
of code. I created a separate mynewt library package to hold the library
code and I put the following in the pkg.yml file:

pkg.cflags: '-DNFC_NDEF_MSG_TAG_TYPE=4 -DNFC_NDEF_RECORD_ENABLED
-DNFC_NDEF_URI_MSG_ENABLED -DNFC_NDEF_URI_REC_ENABLED -DNRF52832_XXAA
-DHAL_NFC_FIELD_TIMER_PERIOD=100'

These #defines were extracted from the sdk_config.h file that is present in
the NFC example projects (I took it from the
nfc_writeable_ndef_msg_pca10040 project). This ensures that these constants
are defined when the project is compiled.

Please give this a go, it might help you get your version working. If
you're still running into any issues, I'm happy to upload my rough version.

Amr

On Mon, 29 Apr 2019 at 17:34, guilleortas@gmail.com <gu...@gmail.com>
wrote:

> Dear Amr,
>
> I'm writing to you as I'm currently working on quite a similar project. I
> also need to port the Nordic NFC library into Mynewt on the nRF52 DK board
> (i.e. PCA 10040).
> I'm running into problems in the process. My small proof-of-concept
> program runs fine on the board directly using the Segger IDE, but I can't
> get it to work under newt. I tried to configure the interrupt vector as
> specified and make the bootloader not use the NFC pins as GPIO, but still
> no luck. It seems I'm missing something else.
>
> I was wondering if you could share your sample application to get the
> basic NFC functionality running on newt. It would be much appreciated.
>
> Thank you,
> Guillermo
>
> On 2019/04/18 15:14:39, Amr Bekhit <am...@gmail.com> wrote:
> > Hi,
> >
> > I managed to get it to work - after modifying the NFC code to use
> > NVIC_SetVector, I realised why it was still not working: the bootloader
> > also needs to be configured to not setup the NFC pins as GPIO (via
> > the NFC_PINS_AS_GPIO syscfg value, which by default is set to 1). Once
> the
> > bootloader was recompiled with NFC_PINS_AS_GPIO set to 0, the NFC code in
> > the application now works fine and can operate is a NFC type-4 tag.
> >
> > I've run into this problem before - it's quite important to take care of
> > the configuration settings in the bootloader, because they can affect the
> > operation of the application as well.
> >
> > Amr
> >
> > On Thu, 18 Apr 2019 at 16:35, Amr Bekhit <am...@gmail.com> wrote:
> >
> > > Hi Andrzej
> > >
> > > You need to implement this handler and set interrupt vector using
> > >> NVIC_SetVector() - Mynewt does not provide handlers for interrupts
> which
> > >> are not used in code.
> > >>
> > >
> > > I've given that I go but still wasn't able to get it to work - you can
> see
> > > the modified code here: https://pastebin.com/A2cvwfSv. I basically
> just
> > > renamed the NFC irq function and called NVIC_SetVector before
> > > NVIC_EnableIRQ. There's probably something fundamental I'm missing
> here...
> > >
> >
>