cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a NDEF Text message using M24SR with STM32F411

yves239955
Associate
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
1 ACCEPTED SOLUTION

Accepted Solutions
JP Miller
Senior
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.

View solution in original post

2 REPLIES 2
yves239955
Associate
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 Miller
Senior
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.