This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RF430CL330H 3kB SRAM for NDEF Messages - how to use more than 250Bytes of it?

Other Parts Discussed in Thread: MSP430F5438A

Hi there,

I have got this IC working in my system using the SPI interface and the example code, along with the msp430f5438a.

I am unsure how to increase the size of the messages sent between the reader and the tag. I simply tried writing to the 3kB SRAM and then asking the reader to read 3kB - however this errors for anything greater than 250 Bytes. I suspect this might be to do with the parameters in the TLV and Capability Container. [clearly, this could be a limitation of the reader]. 

Does anyone have any guidance? If someone from TI could provide example code of this configuration it would be really helpful to me and other forum users I feel.

Best Regards,

James 

  • Hi James,

    What reader are you using?  Does the reader support NDEF?  Can you provide the NDEF message that you are writing?  I can check it for errors.

    When increasing the size of the data, you need to be sure that you are also changing the NLEN and payload length fields.  The capability container should not have to be changed in most situations.  Have a look at the Smart Poster example below.  This NDEF message contains 3 different records which are indicated by the header. 

    #define SMART_POSTER {    																	\
    	    /*NDEF Tag Application */    														\
    	    0xD2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x01,         									\
    	            																			\
    	    0xE1, 0x03,     /*Capability Container ID*/     									\
    	            																			\
    	    /* CC file start */    																\
    	    0x00, 0x0F,     /* CCLEN 15bytes fix*/    											\
    	    0x20,     /* Mapping version 2.0 */   									 			\
    	    0x00, 0xF9,     /* MLe (49 bytes); Maximum R-APDU data size */    					\
    	    0x00, 0xF6,     /* MLc (52 bytes); Maximum C-APDU data size */    					\
    	    0x04,     /* Tag, File Control TLV (4 = NDEF file) */    							\
    	    0x06,     /* Length, File Control TLV (6 = 6 bytes of data for this tag) */    		\
    	    0xE1, 0x04,     /* Type4 Tag File Identifier */    									\
    	    0x0B, 0xDF,     /* Max NDEF size (3037 bytes of RF430CL330 useable memory) */    	\
    	    0x00,     /* NDEF file read access condition, read access without any security */   \
    	    0x00,     /* NDEF file write access condition; write access without any security */ \
    	    /* CC file end */    																\
    	            																			\
    	    0xE1, 0x04,     /* NDEF File ID */     												\
    		0x00, 0x37,     /* NLEN */                                                          \
    		0xD1,           /* Record Header TNF = 0x01 (Well Known Type). SR=1, MB=1, ME=1 */  \
    		0x02,          	/* Type Length */													\
    		0x32,           /* Payload Length */												\
    		0x53, 0x70,     /* Record name = Sp */												\
    		0x91,          /* Record Header */													\
    		0x01,          /* Type Length */													\
    		0x18,          /* Payload Length */													\
    		0x54, 		   /* Type = T */														\
    		0x02,          /* Language length */												\
    		0x65, 0x6E,    /* Language = en */													\
    		0x54,          /* Type = T */														\
    		0x65, 0x78, 0x61, 0x73, 0x20, 0x49, 0x6E, 0x73, 0x74, 								\
    		0x72, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x73, 0x20, 0x4E, 0x46, 						\
    		0x43, 0x11, 																		\
    		0x01,           /* Record Header */													\
    		0x0B,           /* NLEN */															\
    		0x55,           /* Type = U */														\
    		0x01, 			/* Abbreviation = http://www. */									\
    		0x74, 0x69, 0x2E, 0x63,      /* Payload */  										\
    		0x6F, 0x6D, 0x2F, 0x6E, 0x66, 0x63, 0x51, 0x03, 0x01, 0x61, 						\
    		0x63, 0x74, 0x00 																	\
    }

         

  • Hi Eddie,

    Thanks so much for your quick reply - I have seen your posts which have been a great help.

    Eddie LaCost said:
    What reader are you using?  Does the reader support NDEF?

    The reader is a laptop usb dongle which does support NDEF messages. 

    Eddie LaCost said:
    Can you provide the NDEF message that you are writing?  I can check it for errors.

    Sure thing. I was hoping to have one record with 3kB of data. It looks like this:

    #define RF430_DEFAULT_DATA	
    {  														
    /*NDEF Tag Application Name*/ 															
    0xD2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x01, 												
    																					/*Capability Container ID*/ 															
    0xE1, 0x03, 																			
    0x00, 0x0F,	/* CCLEN */																	
    0x20,		/* Mapping version 2.0 */													
    0x00, 0xF9,	/* MLe (49 bytes); Maximum R-APDU data size */								
    0x00, 0xF6, /* MLc (52 bytes); Maximum C-APDU data size */								
    0x04, 		/* Tag, File Control TLV (4 = NDEF file) */									
    0x06, 		/* Length, File Control TLV (6 = 6 bytes of data for this tag) */			
    0xE1, 0x04,	/* File Identifier */														
    0x0B, 0xDF, /* Max NDEF size (3037 bytes of useable memory) */							
    0x00, 		/* NDEF file read access condition, read access without any security */		
    0x00, 		/* NDEF file write access condition; write access without any security */	
    																					
    /* NDEF File ID */ 																		
    0xE1, 0x04, 																			
    																						\
    /* NDEF Payload (3000 bytes total length) */
    .....								
      			
    }

    What do you think? It seems like I might need to add a few more items under the NDEF ID?

    Many thanks, 

    James

  • James,

    Yes, below the E104 file ID, you need to have your complete NDEF record or records.  This includes an NLEN field, record header, and other information about the record.  The NDEF specification from the NFC Forum describes this in detail.  Have a look at the commented TXT record example below.  For a larger message, change NLEN and Payload length fields to match your longer payload message.  If you are unsure of the capabilities of your USB reader, you may also want to test with an NFC enabled phone, which should have no problem handling a 3K message like this. 

    /* NDEF File ID */ 																		\
    0xE1, 0x04, 																			\
    																						\
    /* NDEF File for Hello World  (48 bytes total length) */								\
    0x00, 0x14, /* NLEN; NDEF length (20 byte long message) */ 								\
    0xD1,       /* Record Header */															\
    0x01,		/* Type Length - 1 byte */ 													\
    0x10, 		/* Payload Length - 16 bytes */												\
    0x54,       /* T = text */																\
    0x02, 		/* Status byte - UTF-8, 2 byte language code */								\
    0x65, 0x6E, /* Language - 'e', 'n', */													\
    																						\
    /* 'Hello, world!' NDEF payload data; length should match NLEN*/						\
    0x48, 0x65, 0x6C, 0x6C, 0x6f, 0x2c, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x21  			\