This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NFC can't start up with SoftDevice S140 using SDK 15.3

Hi All,

I have a problem when enabling the NFC tag t2t with the soft device S140 with 52840.

I can run the NFC example project 'nRF5_SDK_15.3.0_59ac345\examples\nfc\record_urlrecord_url' correctly on my hardware, but when porting the demo code to my project, the NFC tag cannot be start up. By reviewing the posts on the forum, I guess it should be the problem of the soft device.

I have read the post here:

https://devzone.nordicsemi.com/f/nordic-q-a/42141/nrf52832---nfc-stops-working-when-softdevice-is-enabled/164732#164732

I had followed the instruction to patch the file "flash_placement.xml", but it not work, perhaps it might be workable only for SDK14.0 ?

My environment is:

NRF52840

SoftDevice 6.1.1,  S140

nRF5_SDK_15.3.0_59ac345

Keil ARM 5.21

The projects codes has BLE/GPIO/SPI/TWI running smoothly. But when testing the record_url example codes, I disable them all.

Is there anything I missed ? Any help would be appreciated.

Best Regards,

Andy

Parents
  • Hi,

    Paste the test code below:

    void nfc_init(void)
    {
        uint32_t err_code = nfc_t2t_setup(nfc_callback, NULL);
        APP_ERROR_CHECK(err_code);
    
        uint32_t len = sizeof(m_ndef_msg_buf);
    
        err_code = nfc_uri_msg_encode( NFC_URI_HTTP_WWW,
                                       m_url,
                                       sizeof(m_url),
                                       m_ndef_msg_buf,
                                       &len);
    
        APP_ERROR_CHECK(err_code);
    
        err_code = nfc_t2t_payload_set(m_ndef_msg_buf, len);
        APP_ERROR_CHECK(err_code);
    
        err_code = nfc_t2t_emulation_start();
        APP_ERROR_CHECK(err_code);
    }
    
    int main(void)
    {
        power_management_init();
    
        log_init();
    	    
        product_io_init();	// Start up GPIO/SPI
        
    	my_ble_init();   // ble init. but no advertising yet.
    
        nfc_init();
    
    		
    	wdt_init();	// Start watchDog.
    	
        for (;;)
        {
    		my_app_loop();	//no BLE advertising.
    		wdt_feed();
            idle_state_handle();
        }
    }
    

    The sdk_config.h  NFC setting as below:

    While running the test code, I didn't start the BLE advertising,and let the mobile closed to the NFC tag, it will make the NRF52840 firmware crashed & restarted.

  • Did you apply the flash_placement.xml file changes?

    If you say that it doesn't start advertising, it sounds like one of your APP_ERROR_CHECK(err_code) receives an err_code != 0. Can you please try to define DEBUG in your preprocessor defines? (Let me know if you are not sure how to do that). The logging information should then tell you which APP_ERROR_CHECK() that received this err_code, and what it was.

    Best regards,

    Edvin

  • I used the Keil compiler, and programmed it via Keil (just pressing F8 while the DK is connected). 

    I initially used TagWriter from NXP, but the NFC Tools worked as well.

    merged_file.hex

    The merged_file.hex contains the softdevice and the application that you sent me. If you flash this to the nRF52840 DK, does LED1 blink?

    And what happens if you try to read the NFC? Do you get any reads? Is the data corrupted, or don't you get any readings at all?

    Do you get any NFC reads if you just use the unmodified nfc examples?

    BR,

    Edvin

  • I can get correct URL responding if I just use the unmodified record_url example., surely no SD with it. Sorry I am not in the office now, I will try your hex file , around 12 hours later, and tell you the test result. Thank you very much.

    Best Regards,

    Andy

  • You need the softdevice in order to run that application, because the application requires the softdevice. Try the merged hex file.

    BR,

    Edvin

  • Although I have no DK on hand, but when I load your HEX code, the NFC can work perfectly, I can read the correct URL. Then I make a try, use keil IDE to program my test app(the simple merged project) into the board which already has you code, it should work with you SD, but the NFC looks not working.

  • So I list something I did:

    1. Before I test my BLE related APP, I always flash the S140. I am experienced with 52840 BLE application development.

    2. Running the record_url  example, I always clear the chip and run it, because the record_url can not boot up when S140 exists. the example works.

    3. Running the merged example(record_url + ble_uart), I always flash the S140. The NFC result is fail. later I will add a LED flashing to see if it is alives.

    4. My environment is MDK 5.21a, package family is 8.24. I use a 52840 based application board.

    I will ask  my colleague who has DK on hand, and run my merged code to see what happen.

Reply
  • So I list something I did:

    1. Before I test my BLE related APP, I always flash the S140. I am experienced with 52840 BLE application development.

    2. Running the record_url  example, I always clear the chip and run it, because the record_url can not boot up when S140 exists. the example works.

    3. Running the merged example(record_url + ble_uart), I always flash the S140. The NFC result is fail. later I will add a LED flashing to see if it is alives.

    4. My environment is MDK 5.21a, package family is 8.24. I use a 52840 based application board.

    I will ask  my colleague who has DK on hand, and run my merged code to see what happen.

Children
  • Hi Edvin,

    Finally the root cause was found. In the pca10056.h, there is the button definition:

    #define BUTTON_1 11
    #define BUTTON_2 11 //12
    #define BUTTON_3 24
    #define BUTTON_4 25
    #define BUTTON_PULL NRF_GPIO_PIN_PULLUP

    The BUTTON_2 original port number was 12, in my application board, it's connected to a buzzer, when testing the merged project, it is noisy, so I redirect it to BUTTON_1, let it occupied the same port, I thought is should be OK.....But when running the APP, it's looks the BSP will check the port mapping, if duplicated, issuing an error and stop. I didn't check the LOG viewer, so miss the chance to find the root cause.

    The reason why you are correct is because the ZIP file didn't include the pca10056.h(it's located outside the example directory which I zipped), so you are referring to a correct default mapping pca10056.h, but I still mapping to a bad one.

    Thank you again for your help, I will try to test my product APP to see whether NFC can work or not.

    Best Regards,

    Andy

Related