Skip to main content
Visitor II
January 13, 2016
Solved

How to create a NDEF Text message using M24SR with STM32F411

  • January 13, 2016
  • 2 replies
  • 943 views
Posted on January 13, 2016 at 13:59

Dear all,

How to create a NDEF Text message using M24SR with STM32F411?

I manage to create a 7 bits text message using M24SR_UpdateBinary (and mbed lib)

How to create a >7 bits NDEF text message using only ST libraries?

Thanks,

Regards

YMA

#ndef-text-m24sr-stm32f411
    This topic has been closed for replies.
    Best answer by JP Miller
    Posted on January 15, 2016 at 14:36

    Hello,

    With the 7 characters limitation you are mentioning, the function call:

     M24SR_UpdateBinary (wtot, 16, NDEF_Buffer+wtot);

    should instead be:

     M24SR_UpdateBinary (wtot, 7, NDEF_Buffer+wtot);

    Other than that the code seems to correctly take into account this limitation.

    M24SR is not limited to a 7 characters update. The limitation is somewhere else. Maybe it is worth checking where this limitation comes from.

    Best regards,

    Have a nice day.

    2 replies

    Visitor II
    January 14, 2016
    Posted on January 14, 2016 at 16:10

    Due to 7 char limitation i managed as follow (but it is not THE solution),

        uint16_t wtot = 0;

        if(message.size()>7){

            do{

                  M24SR_UpdateBinary (wtot, 16, NDEF_Buffer+wtot);

                   wtot+=7;

               }

               while(wtot<=message.size());

        }

        else{

              M24SR_UpdateBinary (0, 16, NDEF_Buffer);

        }

    where message is string character text message to write and NDEF_Buffer, NDEF content, for example:

    NDEF_Buffer={0x00,0x12,0xd1,0x1,0xe,0x54,0x2,0x65,0x6e,0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f,0x72,0x6c,0x64} for message=''Hello World''

    Hoppe this will help people as nowhere on the net i found a real answer

    JP MillerAnswer
    ST Employee
    January 15, 2016
    Posted on January 15, 2016 at 14:36

    Hello,

    With the 7 characters limitation you are mentioning, the function call:

     M24SR_UpdateBinary (wtot, 16, NDEF_Buffer+wtot);

    should instead be:

     M24SR_UpdateBinary (wtot, 7, NDEF_Buffer+wtot);

    Other than that the code seems to correctly take into account this limitation.

    M24SR is not limited to a 7 characters update. The limitation is somewhere else. Maybe it is worth checking where this limitation comes from.

    Best regards,

    Have a nice day.